private void shutdown0() { if (channel != null) { channel.close(); channel = null; } }
/** * The close method when error occurred. Now we just call recoverFileLease. */ @Override public void recoverAndClose(CancelableProgressable reporter) throws IOException { datanodeList.forEach(ch -> ch.close()); datanodeList.forEach(ch -> ch.closeFuture().awaitUninterruptibly()); endFileLease(client, fileId); fsUtils.recoverFileLease(dfs, new Path(src), conf, reporter == null ? new CancelOnClose(client) : reporter); }
@Override public synchronized void close() { disposeSasl(); channel.close(); callCleanup = null; }
/** * End the current block and complete file at namenode. You should call * {@link #recoverAndClose(CancelableProgressable)} if this method throws an exception. */ @Override public void close() throws IOException { endBlock(); state = State.CLOSED; datanodeList.forEach(ch -> ch.close()); datanodeList.forEach(ch -> ch.closeFuture().awaitUninterruptibly()); block.setNumBytes(ackedBlockLength); completeFile(client, namenode, src, clientName, block, fileId); }
@Override public void operationComplete(Future<Channel> future) throws Exception { if (future.isSuccess()) { future.getNow().close(); } } });
datanodeList.forEach(ch -> ch.close());
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable e) { allChannels.remove(ctx.channel()); NettyRpcServer.LOG.trace("Connection {}; caught unexpected downstream exception.", ctx.channel().remoteAddress(), e.getCause()); ctx.channel().close(); } }
@Override public synchronized void stop() { if (!running) { return; } LOG.info("Stopping server on " + this.serverChannel.localAddress()); if (authTokenSecretMgr != null) { authTokenSecretMgr.stop(); authTokenSecretMgr = null; } allChannels.close().awaitUninterruptibly(); serverChannel.close(); scheduler.stop(); closed.countDown(); running = false; }
public void stop() throws IOException { serverChannel.close().syncUninterruptibly(); serverChannel = null; channelGroup.close().syncUninterruptibly(); channelGroup = null; conn.close(); conn = null; }
return; ctx.channel().close(); return;
private void shutdown0() { if (channel != null) { channel.close(); channel = null; } }
private void shutdown0() { if (channel != null) { channel.close(); channel = null; } }
@Override public void close() { for (;;) { Channel channel = pollChannel(); if (channel == null) { break; } channel.close(); } } }
@Override public void operationComplete(ChannelFuture future) { future.channel().close(); } };
@Override public void operationComplete(ChannelFuture future) { if (!future.isSuccess()) { future.channel().close(); } } };
private static void closeChannel(Channel channel) { channel.attr(POOL_KEY).getAndSet(null); channel.close(); }
@Override public void operationComplete(Future<SocketAddress> future) throws Exception { if (future.cause() != null) { channel.close(); promise.setFailure(future.cause()); } else { doConnect(future.getNow(), localAddress, promise); } } });
public void stop() throws IOException { serverChannel.close().syncUninterruptibly(); serverChannel = null; channelGroup.close().syncUninterruptibly(); channelGroup = null; conn.close(); conn = null; }
private static void registerDone(ChannelFuture future) { // Handle any errors that occurred on the local thread while registering. Even though // failures can happen after this point, they will be handled by the channel by closing the // childChannel. if (!future.isSuccess()) { Channel childChannel = future.channel(); if (childChannel.isRegistered()) { childChannel.close(); } else { childChannel.unsafe().closeForcibly(); } } }
@Override public void operationComplete(ChannelFuture future) throws Exception { try { if (future.isSuccess()) { // Perform the upgrade to the new protocol. sourceCodec.upgradeFrom(ctx); finalUpgradeCodec.upgradeTo(ctx, request); // Notify that the upgrade has occurred. Retain the event to offset // the release() in the finally block. ctx.fireUserEventTriggered(event.retain()); // Remove this handler from the pipeline. ctx.pipeline().remove(HttpServerUpgradeHandler.this); } else { future.channel().close(); } } finally { // Release the event if the upgrade event wasn't fired. event.release(); } } });