Add lifecycle hooks to KubernetesTaskRunner (#14790)

This commit is contained in:
George Shiqi Wu 2023-08-10 00:16:44 -04:00 committed by GitHub
parent b1988b2f93
commit c8537dbeaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,8 @@ import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.concurrent.Execs;
import org.apache.druid.java.util.common.lifecycle.LifecycleStart;
import org.apache.druid.java.util.common.lifecycle.LifecycleStop;
import org.apache.druid.java.util.emitter.EmittingLogger; import org.apache.druid.java.util.emitter.EmittingLogger;
import org.apache.druid.java.util.emitter.service.ServiceEmitter; import org.apache.druid.java.util.emitter.service.ServiceEmitter;
import org.apache.druid.java.util.emitter.service.ServiceMetricEvent; import org.apache.druid.java.util.emitter.service.ServiceMetricEvent;
@ -325,6 +327,7 @@ public class KubernetesTaskRunner implements TaskLogStreamer, TaskRunner
} }
@Override @Override
@LifecycleStart
public void start() public void start()
{ {
cleanupExecutor.scheduleAtFixedRate( cleanupExecutor.scheduleAtFixedRate(
@ -342,6 +345,7 @@ public class KubernetesTaskRunner implements TaskLogStreamer, TaskRunner
@Override @Override
@LifecycleStop
public void stop() public void stop()
{ {
log.debug("Stopping KubernetesTaskRunner"); log.debug("Stopping KubernetesTaskRunner");