use of com.thinkbiganalytics.nifi.savepoint.model.SavepointReplayEvent in project kylo by Teradata.
the class DefaultJobService method stopJobExecution.
@Override
public boolean stopJobExecution(ReplayJobExecution replayJobExecution) throws JobExecutionException {
SavepointReplayJobExecution savepointReplayJobExecution = ((SavepointReplayJobExecution) replayJobExecution);
return metadataAccess.commit(() -> {
BatchJobExecution jobExecution = this.jobExecutionProvider.findByJobExecutionId(savepointReplayJobExecution.getJobExecutionId(), false);
if (jobExecution != null) {
((JpaBatchJobExecution) jobExecution).markAsRunning();
// ((JpaBatchJobExecution)jobExecution).failJob();
// trigger the jms message
SavepointReplayEvent event = new SavepointReplayEvent();
event.setJobExecutionId(savepointReplayJobExecution.getJobExecutionId());
event.setFlowfileId(savepointReplayJobExecution.getFlowFileId());
event.setAction(SavepointReplayEvent.Action.RELEASE);
savepointReplayJmsEventService.triggerSavepoint(event);
}
return true;
});
}
use of com.thinkbiganalytics.nifi.savepoint.model.SavepointReplayEvent in project kylo by Teradata.
the class DefaultJobService method restartJobExecution.
@Override
public Long restartJobExecution(ReplayJobExecution replayJobExecution) throws JobExecutionException {
SavepointReplayJobExecution savepointReplayJobExecution = ((SavepointReplayJobExecution) replayJobExecution);
return metadataAccess.commit(() -> {
BatchJobExecution jobExecution = this.jobExecutionProvider.findByJobExecutionId(savepointReplayJobExecution.getJobExecutionId(), false);
if (jobExecution != null) {
((JpaBatchJobExecution) jobExecution).markAsRunning();
// trigger the jms message
SavepointReplayEvent event = new SavepointReplayEvent();
event.setJobExecutionId(savepointReplayJobExecution.getJobExecutionId());
event.setFlowfileId(savepointReplayJobExecution.getFlowFileId());
event.setAction(SavepointReplayEvent.Action.RETRY);
savepointReplayJmsEventService.triggerSavepoint(event);
return jobExecution.getJobExecutionId();
}
return null;
});
}
Aggregations