@Override public void killed(ProgramRunId programRunId) { stop(programRunId, ProgramRunStatus.KILLED, null); }
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); } }
TopicId programEventTopic = NamespaceId.SYSTEM.topic(cConf.get(Constants.AppFabric.PROGRAM_STATUS_RECORD_EVENT_TOPIC)); ProgramStateWriter programStateWriter = new MessagingProgramStateWriter(cConf, messagingService);
@Override public void killed(ProgramRunId programRunId) { stop(programRunId, ProgramRunStatus.KILLED, null); }
@Override public void completed(ProgramRunId programRunId) { stop(programRunId, ProgramRunStatus.COMPLETED, null); }
@Override public void error(ProgramRunId programRunId, Throwable failureCause) { stop(programRunId, ProgramRunStatus.FAILED, failureCause); }
@Override public void completed(ProgramRunId programRunId) { stop(programRunId, ProgramRunStatus.COMPLETED, null); }
@Override public void error(ProgramRunId programRunId, Throwable failureCause) { stop(programRunId, ProgramRunStatus.FAILED, failureCause); }