@Override public void error(Throwable cause) { LOG.trace("Program {} stopped with error: {}", programRunId, cause); programStateWriter.error(programRunId, cause); } }
@Override public void error(Throwable cause) { LOG.trace("Program {} stopped with error: {}", programRunId, cause); programStateWriter.error(programRunId, cause); } }
private void notifyFailed(Throwable cause) { programStateWriter.error(programRunId, cause); provisionerNotifier.deprovisioning(programRunId); } }
private void notifyFailed(Throwable cause) { programStateWriter.error(programRunId, cause); provisionerNotifier.deprovisioning(programRunId); } }
public void error(Throwable failureCause) { stopHeartbeatThread(); programStateWriter.error(programRunId, failureCause); }
public void error(Throwable failureCause) { stopHeartbeatThread(); programStateWriter.error(programRunId, failureCause); }
"Fixed RunRecord for program run %s in %s state because it is actually not running", programRunId, record.getStatus()); programStateWriter.error(programRunId, new ProgramRunAbortedException(msg)); fixedPrograms.add(programRunId); LOG.warn(msg);
"Fixed RunRecord for program run %s in %s state because it is actually not running", programRunId, record.getStatus()); programStateWriter.error(programRunId, new ProgramRunAbortedException(msg)); fixedPrograms.add(programRunId); LOG.warn(msg);
() -> LOG.error("No task state found while deprovisioning the cluster. " + "The cluster will be marked as orphaned.")); programStateWriter.error(programRunId, new IllegalStateException("No task state found while deprovisioning the cluster.")); provisionerNotifier.orphaned(programRunId); + "The cluster will be marked as orphaned.", existing.getProvisionerName())); programStateWriter.error(programRunId, new IllegalStateException("Provisioner not found while deprovisioning the cluster.")); provisionerNotifier.orphaned(programRunId);
() -> LOG.error("No task state found while deprovisioning the cluster. " + "The cluster will be marked as orphaned.")); programStateWriter.error(programRunId, new IllegalStateException("No task state found while deprovisioning the cluster.")); provisionerNotifier.orphaned(programRunId); + "The cluster will be marked as orphaned.", existing.getProvisionerName())); programStateWriter.error(programRunId, new IllegalStateException("Provisioner not found while deprovisioning the cluster.")); provisionerNotifier.orphaned(programRunId);
programStateWriter.error(programRunId, new IllegalStateException("Program runtime terminated abnormally. " + "Please inspect logs for root cause.", e));
programStateWriter.error(programRunId, new IllegalStateException("Program runtime terminated abnormally. " + "Please inspect logs for root cause.", e));
programRunId, args, () -> LOG.error("Could not provision cluster for the run because provisioner {} does not exist.", name)); programStateWriter.error(programRunId, new IllegalStateException("Provisioner does not exist.")); provisionerNotifier.deprovisioned(programRunId); return () -> { }; "plugins: '%s'", programRunId.getProgram(), name, groupByRequirement(unfulfilledRequirements)))); programStateWriter.error(programRunId, new IllegalArgumentException("Provisioner does not meet all the " + "requirements for the program to run.")); provisionerNotifier.deprovisioned(programRunId);
programRunId, args, () -> LOG.error("Could not provision cluster for the run because provisioner {} does not exist.", name)); programStateWriter.error(programRunId, new IllegalStateException("Provisioner does not exist.")); provisionerNotifier.deprovisioned(programRunId); return () -> { }; "plugins: '%s'", programRunId.getProgram(), name, groupByRequirement(unfulfilledRequirements)))); programStateWriter.error(programRunId, new IllegalArgumentException("Provisioner does not meet all the " + "requirements for the program to run.")); provisionerNotifier.deprovisioned(programRunId);
programLifecycleService.startInternal(programDescriptor, newProgramOptions, programRunId); } catch (Exception e) { programStateWriter.error(programRunId, e);
programLifecycleService.startInternal(programDescriptor, newProgramOptions, programRunId); } catch (Exception e) { programStateWriter.error(programRunId, e);
private void publishProgramStatus(ProgramRunId programRunId, ProgramStatus status) { ProgramStateWriter stateWriter = new MessagingProgramStateWriter(cConf, messagingService); switch (status) { case INITIALIZING: stateWriter.start(programRunId, new SimpleProgramOptions(programRunId.getParent()), null, null); break; case RUNNING: stateWriter.running(programRunId, null); break; case COMPLETED: stateWriter.completed(programRunId); break; case FAILED: stateWriter.error(programRunId, new Exception("Program run failed")); break; case KILLED: stateWriter.killed(programRunId); break; default: throw new IllegalArgumentException("Unsupported program status " + status); } }
private void runAndWait(ProgramRunner programRunner, Program program, ProgramOptions options) throws Exception { Closeable closeable = createCloseable(programRunner, program); // Publish the program's starting state RunId runId = ProgramRunners.getRunId(options); String twillRunId = options.getArguments().getOption(ProgramOptionConstants.TWILL_RUN_ID); ProgramDescriptor programDescriptor = new ProgramDescriptor(program.getId(), program.getApplicationSpecification()); programStateWriter.start(program.getId().run(runId), options, twillRunId, programDescriptor); ProgramController controller; try { controller = programRunner.run(program, options); } catch (Throwable t) { // If there is any exception when running the program, close the program to release resources. // Otherwise it will be released when the execution completed. programStateWriter.error(program.getId().run(runId), t); Closeables.closeQuietly(closeable); throw t; } blockForCompletion(closeable, controller); if (controller instanceof WorkflowDataProvider) { updateWorkflowToken(((WorkflowDataProvider) controller).getWorkflowToken()); } else { // This shouldn't happen throw new IllegalStateException("No WorkflowToken available after program completed: " + program.getId()); } }
private void runAndWait(ProgramRunner programRunner, Program program, ProgramOptions options) throws Exception { Closeable closeable = createCloseable(programRunner, program); // Publish the program's starting state RunId runId = ProgramRunners.getRunId(options); String twillRunId = options.getArguments().getOption(ProgramOptionConstants.TWILL_RUN_ID); ProgramDescriptor programDescriptor = new ProgramDescriptor(program.getId(), program.getApplicationSpecification()); programStateWriter.start(program.getId().run(runId), options, twillRunId, programDescriptor); ProgramController controller; try { controller = programRunner.run(program, options); } catch (Throwable t) { // If there is any exception when running the program, close the program to release resources. // Otherwise it will be released when the execution completed. programStateWriter.error(program.getId().run(runId), t); Closeables.closeQuietly(closeable); throw t; } blockForCompletion(closeable, controller); if (controller instanceof WorkflowDataProvider) { updateWorkflowToken(((WorkflowDataProvider) controller).getWorkflowToken()); } else { // This shouldn't happen throw new IllegalStateException("No WorkflowToken available after program completed: " + program.getId()); } }
programStateWriter.running(anotherWorkflowRun, null); long lastProcessed = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); programStateWriter.error(anotherWorkflowRun, null); waitUntilProcessed(programEventTopic, lastProcessed);