Search in sources :

Example 1 with TaskRunnerListener

use of io.druid.indexing.overlord.TaskRunnerListener in project druid by druid-io.

the class KafkaSupervisor method possiblyRegisterListener.

public void possiblyRegisterListener() {
    if (listenerRegistered) {
        return;
    }
    Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner();
    if (taskRunner.isPresent()) {
        taskRunner.get().registerListener(new TaskRunnerListener() {

            @Override
            public String getListenerId() {
                return supervisorId;
            }

            @Override
            public void locationChanged(final String taskId, final TaskLocation newLocation) {
            // do nothing
            }

            @Override
            public void statusChanged(String taskId, TaskStatus status) {
                notices.add(new RunNotice());
            }
        }, MoreExecutors.sameThreadExecutor());
        listenerRegistered = true;
    }
}
Also used : TaskRunnerListener(io.druid.indexing.overlord.TaskRunnerListener) TaskStatus(io.druid.indexing.common.TaskStatus) TaskLocation(io.druid.indexing.common.TaskLocation) TaskRunner(io.druid.indexing.overlord.TaskRunner)

Aggregations

TaskLocation (io.druid.indexing.common.TaskLocation)1 TaskStatus (io.druid.indexing.common.TaskStatus)1 TaskRunner (io.druid.indexing.overlord.TaskRunner)1 TaskRunnerListener (io.druid.indexing.overlord.TaskRunnerListener)1