use of com.qlangtech.tis.fullbuild.indexbuild.impl.AsynRemoteJobTrigger in project plugins by qlangtech.
the class DistributedOverseerDataXJobSubmit method createDataXJob.
@Override
public IRemoteTaskTrigger createDataXJob(IDataXJobContext dataXJobContext, RpcServiceReference statusRpc, IDataxProcessor dataxProcessor, String dataXfileName) {
IJoinTaskContext taskContext = dataXJobContext.getTaskContext();
IAppSourcePipelineController pipelineController = taskContext.getPipelineController();
DistributedQueue<CuratorDataXTaskMessage> distributedQueue = getCuratorDistributedQueue();
// File jobPath = new File(dataxProcessor.getDataxCfgDir(null), dataXfileName);
return new AsynRemoteJobTrigger(dataXfileName) {
@Override
public void run() {
try {
CuratorDataXTaskMessage msg = getDataXJobDTO(taskContext, dataXfileName);
distributedQueue.put(msg);
pipelineController.registerAppSubExecNodeMetrixStatus(IAppSourcePipelineController.DATAX_FULL_PIPELINE + taskContext.getIndexName(), dataXfileName);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public RunningStatus getRunningStatus() {
return RunningStatus.SUCCESS;
}
@Override
public void cancel() {
pipelineController.stop(IAppSourcePipelineController.DATAX_FULL_PIPELINE + taskContext.getIndexName());
}
};
}
Aggregations