use of org.apache.druid.java.util.common.lifecycle.LifecycleStop in project druid by druid-io.
the class K8sDruidNodeDiscoveryProvider method stop.
@LifecycleStop
public void stop() {
if (!lifecycleLock.canStop()) {
throw new ISE("can't stop.");
}
LOGGER.info("stopping");
for (NodeRoleWatcher watcher : nodeTypeWatchers.values()) {
watcher.stop();
}
listenerExecutor.shutdownNow();
LOGGER.info("stopped");
}
use of org.apache.druid.java.util.common.lifecycle.LifecycleStop in project druid by druid-io.
the class RemoteTaskRunner method stop.
@Override
@LifecycleStop
public void stop() {
if (!lifecycleLock.canStop()) {
return;
}
try {
log.info("Stopping RemoteTaskRunner...");
provisioningService.close();
Closer closer = Closer.create();
for (ZkWorker zkWorker : zkWorkers.values()) {
closer.register(zkWorker);
}
closer.register(workerPathCache);
try {
closer.close();
} finally {
workerStatusPathChildrenCacheExecutor.shutdown();
}
if (runPendingTasksExec != null) {
runPendingTasksExec.shutdown();
}
if (cleanupExec != null) {
cleanupExec.shutdown();
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
lifecycleLock.exitStop();
}
}
use of org.apache.druid.java.util.common.lifecycle.LifecycleStop in project druid by druid-io.
the class HttpRemoteTaskRunner method stop.
@Override
@LifecycleStop
public void stop() {
if (!lifecycleLock.canStop()) {
throw new ISE("can't stop.");
}
try {
log.info("Stopping...");
if (provisioningService != null) {
provisioningService.close();
}
pendingTasksExec.shutdownNow();
workersSyncExec.shutdownNow();
cleanupExec.shutdown();
log.info("Removing listener");
DruidNodeDiscovery druidNodeDiscovery = druidNodeDiscoveryProvider.getForService(WorkerNodeService.DISCOVERY_SERVICE_KEY);
druidNodeDiscovery.removeListener(nodeDiscoveryListener);
log.info("Stopping worker holders");
synchronized (workers) {
workers.values().forEach(w -> {
try {
w.stop();
} catch (Exception e) {
log.error(e, e.getMessage());
}
});
}
} finally {
lifecycleLock.exitStop();
}
log.info("Stopped.");
}
Aggregations