Exemplo n.º 1
0
    private void iterate(TejasContext context) {
      String exceptionMessage = "";
      try {
        context.entry(this.task.getClass().getSimpleName());
        iterateInner(context);
        this._exceptionCount = -1;
      } catch (InterruptedException e) {
        context.logger.info(
            TejasBackgroundJob.this, "] got InterruptedException. Looks like we are going down");
      } catch (Throwable t) {
        exceptionMessage = StringUtils.serializeToString(t);
        setLastSeenException(t);
        context.logger.error(getName(), t, TejasBackgroundJob.this, " Got exception");
      } finally {
        this._exceptionCount = ((this._exceptionCount + 1) % (Integer.MAX_VALUE - 1));
        if (this._exceptionCount > this.configuration.exceptionThreshold) {
          context.alarm(
              this.configuration.alarmSeverity,
              this.configuration.componentName,
              this.configuration.alarmName,
              this.configuration.deduplicationString,
              "Name = ("
                  + getName()
                  + ")"
                  + TejasBackgroundJob.this.getClass().getSimpleName()
                  + exceptionMessage);
        }

        context.exit(this._exceptionCount == 0 ? ExitStatus.Success : ExitStatus.Failure);
      }
    }
Exemplo n.º 2
0
 public LogEntry(String dagID, String contractID, ContractExecutionReport report) {
   this.dag_id = dagID;
   this.contract_id = contractID;
   this.log_message = report.getStatus().name();
   Throwable exception = report.getCause();
   this.error_reason =
       StringUtils.makeNullSafe((exception != null) ? exception.toString() : report.getReason());
   this.detailed_description =
       StringUtils.makeNullSafe(
           (exception != null)
               ? StringUtils.serializeToString(exception)
               : report.getDetailedDescription());
 }