/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
public void shutdown() { if (this.serverChannel != null) { this.serverChannel.close().awaitUninterruptibly(); } if (bootstrap != null) { if (bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); } if (bootstrap.childGroup() != null) { bootstrap.childGroup().shutdownGracefully(); } } } }
@Override public void close() { if (channelFuture != null) { // close is a local operation and should finish within milliseconds; timeout just to be safe channelFuture.channel().close().awaitUninterruptibly(10, TimeUnit.SECONDS); channelFuture = null; } if (bootstrap != null && bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); } if (bootstrap != null && bootstrap.childGroup() != null) { bootstrap.childGroup().shutdownGracefully(); } bootstrap = null; } }
@Override public void close() { if (channelFuture != null) { // close is a local operation and should finish within milliseconds; timeout just to be safe channelFuture.channel().close().awaitUninterruptibly(10, TimeUnit.SECONDS); channelFuture = null; } if (bootstrap != null && bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); } if (bootstrap != null && bootstrap.childGroup() != null) { bootstrap.childGroup().shutdownGracefully(); } bootstrap = null; } }
@Override public void close() throws IOException { int quietPeriodSecs = mTachyonConf.getInt(Constants.WORKER_NETWORK_NETTY_SHUTDOWN_QUIET_PERIOD); int timeoutSecs = mTachyonConf.getInt(Constants.WORKER_NETWORK_NETTY_SHUTDOWN_TIMEOUT); mChannelFuture.channel().close().awaitUninterruptibly(); mBootstrap.group().shutdownGracefully(quietPeriodSecs, timeoutSecs, TimeUnit.SECONDS); mBootstrap.childGroup().shutdownGracefully(quietPeriodSecs, timeoutSecs, TimeUnit.SECONDS); }
@Override public void serviceStop() throws Exception { accepted.close(); if (selector != null) { if (selector.group() != null) { selector.group().shutdownGracefully(); } if (selector.childGroup() != null) { selector.childGroup().shutdownGracefully(); } } if (channelInitializer != null) { channelInitializer.destroy(); } localFS.close(); indexReaderCache.invalidateAll(); super.serviceStop(); }
@Override public void stop() { try { accepted.close(); if (selector != null) { if (selector.group() != null) { selector.group().shutdownGracefully(); } if (selector.childGroup() != null) { selector.childGroup().shutdownGracefully(); } } if (channelInitializer != null) { channelInitializer.destroy(); } localFS.close(); indexReaderCache.invalidateAll(); } catch (Throwable t) { LOG.error(t, t); } finally { super.stop(); } }
public void shutdown(boolean waitUntilThreadsStop) { try { accepted.close(); } catch (Throwable t) { LOG.error(t.getMessage(), t); } if(bootstrap != null) { if (bootstrap.childGroup() != null) { bootstrap.childGroup().shutdownGracefully(); if (waitUntilThreadsStop) { bootstrap.childGroup().terminationFuture().awaitUninterruptibly(); } } if (bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); if (waitUntilThreadsStop) { bootstrap.childGroup().terminationFuture().awaitUninterruptibly(); } } } if (bindAddress != null) { LOG.info("Rpc (" + serviceName + ") listened on " + RpcUtils.normalizeInetSocketAddress(bindAddress)+ ") shutdown"); } }
@Override public void tearDown() { long tstart = System.currentTimeMillis(); clearConnections(); logger.info("Shutting down handler groups..."); List<Future> gfutures = new LinkedList<>(); gfutures.add(bootstrapUDTClient.group().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); if (bindTCP) { gfutures.add(bootstrapTCP.childGroup().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); gfutures.add(bootstrapTCP.group().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); } gfutures.add(bootstrapTCPClient.group().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); if (bindUDP) { gfutures.add(bootstrapUDP.group().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); } if (bindUDT) { gfutures.add(bootstrapUDT.childGroup().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); gfutures.add(bootstrapUDT.group().shutdownGracefully(1, 5, TimeUnit.MILLISECONDS)); } for (Future f : gfutures) { f.syncUninterruptibly(); } //bootstrapUDTClient = null; bootstrapTCP = null; //bootstrapTCPClient = null; bootstrapUDP = null; bootstrapUDT = null; long tend = System.currentTimeMillis(); logger.info("Netty shutdown complete. It took {}ms", tend - tstart); }
public void stop() { logger.info("Stopping the connector on the port {}", configuration.getPort()); bootstrap.group().shutdownGracefully(); bootstrap.childGroup().shutdownGracefully(); try { bootstrap.group().terminationFuture().sync(); } catch (InterruptedException e) { logger.warn("Failed while stopping the boss threads", e); } try { bootstrap.childGroup().terminationFuture().sync(); } catch (InterruptedException e) { logger.warn("Failed while stopping the worker threads", e); } }
bootstrapUDT.childGroup().scheduleAtFixedRate(new Runnable() {
if (bootstrap.childGroup() != null) { Future future = bootstrap.childGroup().shutdownGracefully(); if (waitUntilThreadsStop) { future.sync();
@Override public void start(String jobManagerAkkaUrl) throws Exception { LOG.info("Starting with JobManager {} on port {}", jobManagerAkkaUrl, getServerPort()); synchronized (startupShutdownLock) { jobManagerAddressPromise.success(jobManagerAkkaUrl); leaderRetrievalService.start(retriever); long delay = backPressureStatsTracker.getCleanUpInterval(); // Scheduled back pressure stats tracker cache cleanup. We schedule // this here repeatedly, because cache clean up only happens on // interactions with the cache. We need it to make sure that we // don't leak memory after completed jobs or long ago accessed stats. netty.getBootstrap().childGroup().scheduleWithFixedDelay(new Runnable() { @Override public void run() { try { backPressureStatsTracker.cleanUpOperatorStatsCache(); } catch (Throwable t) { LOG.error("Error during back pressure stats cache cleanup.", t); } } }, delay, delay, TimeUnit.MILLISECONDS); } }