@Override protected synchronized void doStop() { ThreadPool.terminate(threadPoolExecutor, 10, TimeUnit.SECONDS); }
@Override public void close() { ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS); Releasables.close(activePingingRounds.values()); closed = true; }
/** * Closes the client. */ @Override public void close() { List<Closeable> closeables = new ArrayList<>(); closeables.add(nodesService); closeables.add(injector.getInstance(TransportService.class)); for (LifecycleComponent plugin : pluginLifecycleComponents) { closeables.add(plugin); } closeables.add(() -> ThreadPool.terminate(injector.getInstance(ThreadPool.class), 10, TimeUnit.SECONDS)); closeables.add(injector.getInstance(PageCacheRecycler.class)); IOUtils.closeWhileHandlingException(closeables); }
@Override protected synchronized void doStop() { for (NotifyTimeout onGoingTimeout : onGoingTimeouts) { onGoingTimeout.cancel(); try { onGoingTimeout.cancel(); onGoingTimeout.listener.onClose(); } catch (Exception ex) { logger.debug("failed to notify listeners on shutdown", ex); } } ThreadPool.terminate(threadPoolExecutor, 10, TimeUnit.SECONDS); // close timeout listeners that did not have an ongoing timeout timeoutClusterStateListeners.forEach(TimeoutClusterStateListener::onClose); removeListener(localNodeMasterListeners); }
final List<Closeable> resourcesToClose = new ArrayList<>(); final ThreadPool threadPool = new ThreadPool(settings); resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS)); final NetworkService networkService = new NetworkService(Collections.emptyList()); try {
public static boolean terminate(ExecutorService... services) throws InterruptedException { boolean terminated = true; for (ExecutorService service : services) { if (service != null) { terminated &= ThreadPool.terminate(service, 10, TimeUnit.SECONDS); } } return terminated; }
@Override protected synchronized void doStop() { ThreadPool.terminate(threadPoolExecutor, 10, TimeUnit.SECONDS); }
@Override protected void doClose() { ThreadPool.terminate(workers, 10, TimeUnit.SECONDS); }
@Override protected void doClose() { ThreadPool.terminate(workers, 10, TimeUnit.SECONDS); }
@Override protected void stopInternal() { ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); synchronized (openChannels) { assert openChannels.isEmpty() : "there are still open channels: " + openChannels; } }
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
@Override public void close() { ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS); Releasables.close(activePingingRounds.values()); closed = true; }
@Override public void close() { ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS); Releasables.close(activePingingRounds.values()); closed = true; }
@Override public void tearDown() throws Exception { try { ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS); } finally { super.tearDown(); } }
@Override public void close() { ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS); Releasables.close(activePingingRounds.values()); closed = true; }
@Override public void close() { try { ThreadPool.terminate(threadPool(), 10, TimeUnit.SECONDS); } catch (Exception e) { throw new ElasticsearchException(e.getMessage(), e); } } }
/** * Closes the client. */ @Override public void close() { List<Closeable> closeables = new ArrayList<>(); closeables.add(nodesService); closeables.add(injector.getInstance(TransportService.class)); for (LifecycleComponent plugin : pluginLifecycleComponents) { closeables.add(plugin); } closeables.add(() -> ThreadPool.terminate(injector.getInstance(ThreadPool.class), 10, TimeUnit.SECONDS)); closeables.add(injector.getInstance(BigArrays.class)); IOUtils.closeWhileHandlingException(closeables); }
@Override protected void doClose() { transportService.removeHandler(ACTION_NAME); ThreadPool.terminate(unicastConnectExecutor, 0, TimeUnit.SECONDS); try { IOUtils.close(receivedResponses.values()); } catch (IOException e) { throw new ElasticsearchException("Error wile closing send ping handlers", e); } closed = true; }
@Override protected void doStop() { FutureUtils.cancel(this.reconnectToNodes); for (NotifyTimeout onGoingTimeout : onGoingTimeouts) { onGoingTimeout.cancel(); onGoingTimeout.listener.onClose(); } ThreadPool.terminate(updateTasksExecutor, 10, TimeUnit.SECONDS); remove(localNodeMasterListeners); }