use of io.cdap.cdap.runtime.spi.runtimejob.RuntimeJobStatus in project cdap by caskdata.
the class TetheringRuntimeJobManager method stop.
@Override
public void stop(ProgramRunInfo programRunInfo) throws Exception {
RuntimeJobDetail jobDetail = getDetail(programRunInfo).orElse(null);
if (jobDetail == null) {
return;
}
RuntimeJobStatus status = jobDetail.getStatus();
if (status.isTerminated() || status == RuntimeJobStatus.STOPPING) {
return;
}
LOG.debug("Stopping run {} with following configurations: tethered instance name {}, tethered namespace {}.", programRunInfo.getRun(), tetheredInstanceName, tetheredNamespace);
byte[] payload = Bytes.toBytes(GSON.toJson(programRunInfo));
TetheringControlMessage message = new TetheringControlMessage(TetheringControlMessage.Type.STOP_PIPELINE, payload);
publishToControlChannel(message);
}
Aggregations