Search in sources :

Example 1 with AsynRemoteJobTrigger

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());
        }
    };
}
Also used : CuratorDataXTaskMessage(com.qlangtech.tis.datax.CuratorDataXTaskMessage) AsynRemoteJobTrigger(com.qlangtech.tis.fullbuild.indexbuild.impl.AsynRemoteJobTrigger) IAppSourcePipelineController(com.qlangtech.tis.order.center.IAppSourcePipelineController) IJoinTaskContext(com.qlangtech.tis.order.center.IJoinTaskContext)

Aggregations

CuratorDataXTaskMessage (com.qlangtech.tis.datax.CuratorDataXTaskMessage)1 AsynRemoteJobTrigger (com.qlangtech.tis.fullbuild.indexbuild.impl.AsynRemoteJobTrigger)1 IAppSourcePipelineController (com.qlangtech.tis.order.center.IAppSourcePipelineController)1 IJoinTaskContext (com.qlangtech.tis.order.center.IJoinTaskContext)1