protected JobPushProcessor(TaskTrackerAppContext appContext) { super(appContext); this.remotingClient = appContext.getRemotingClient(); // 线程安全的 jobRunnerCallback = new JobRunnerCallback(); if (isEnableFailStore()) { retryScheduler = new RetryScheduler<JobRunResult>(JobPushProcessor.class.getSimpleName(), appContext, FailStorePathBuilder.getJobFeedbackPath(appContext), 3) { @Override protected boolean isRemotingEnable() { return remotingClient.isServerEnable(); } @Override protected boolean retry(List<JobRunResult> results) { return retrySendJobResults(results); } }; retryScheduler.start(); NodeShutdownHook.registerHook(appContext, this.getClass().getName(), new Callable() { @Override public void call() throws Exception { retryScheduler.stop(); } }); } }
protected JobPushProcessor(TaskTrackerAppContext appContext) { super(appContext); this.remotingClient = appContext.getRemotingClient(); // 线程安全的 jobRunnerCallback = new JobRunnerCallback(); if (isEnableFailStore()) { retryScheduler = new RetryScheduler<JobRunResult>(JobPushProcessor.class.getSimpleName(), appContext, FailStorePathBuilder.getJobFeedbackPath(appContext), 3) { @Override protected boolean isRemotingEnable() { return remotingClient.isServerEnable(); } @Override protected boolean retry(List<JobRunResult> results) { return retrySendJobResults(results); } }; retryScheduler.start(); NodeShutdownHook.registerHook(appContext, this.getClass().getName(), new Callable() { @Override public void call() throws Exception { retryScheduler.stop(); } }); } }
protected JobPushProcessor(TaskTrackerAppContext appContext) { super(appContext); this.remotingClient = appContext.getRemotingClient(); // 线程安全的 jobRunnerCallback = new JobRunnerCallback(); if (isEnableFailStore()) { retryScheduler = new RetryScheduler<JobRunResult>(JobPushProcessor.class.getSimpleName(), appContext, FailStorePathBuilder.getJobFeedbackPath(appContext), 3) { @Override protected boolean isRemotingEnable() { return remotingClient.isServerEnable(); } @Override protected boolean retry(List<JobRunResult> results) { return retrySendJobResults(results); } }; retryScheduler.start(); NodeShutdownHook.registerHook(appContext, this.getClass().getName(), new Callable() { @Override public void call() throws Exception { retryScheduler.stop(); } }); } }