@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { clientHandler.removeInputChannel(inputChannel); SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError( new LocalTransportException( String.format("Sending the partition request to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } };
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { clientHandler.removeInputChannel(inputChannel); inputChannel.onError( new LocalTransportException( "Sending the partition request failed.", future.channel().localAddress(), future.cause() )); } } };
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { clientHandler.removeInputChannel(inputChannel); SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError( new LocalTransportException( String.format("Sending the partition request to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } };
public void close(RemoteInputChannel inputChannel) throws IOException { clientHandler.removeInputChannel(inputChannel); if (closeReferenceCounter.decrement()) { // Close the TCP connection. Send a close request msg to ensure // that outstanding backwards task events are not discarded. tcpChannel.writeAndFlush(new NettyMessage.CloseRequest()) .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); // Make sure to remove the client from the factory clientFactory.destroyPartitionRequestClient(connectionId, this); } else { clientHandler.cancelRequestFor(inputChannel.getInputChannelId()); } }
public void close(RemoteInputChannel inputChannel) throws IOException { clientHandler.removeInputChannel(inputChannel); if (closeReferenceCounter.decrement()) { // Close the TCP connection. Send a close request msg to ensure // that outstanding backwards task events are not discarded. tcpChannel.writeAndFlush(new NettyMessage.CloseRequest()) .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); // Make sure to remove the client from the factory clientFactory.destroyPartitionRequestClient(connectionId, this); } else { clientHandler.cancelRequestFor(inputChannel.getInputChannelId()); } }
public void close(RemoteInputChannel inputChannel) throws IOException { clientHandler.removeInputChannel(inputChannel); if (closeReferenceCounter.decrement()) { // Close the TCP connection. Send a close request msg to ensure // that outstanding backwards task events are not discarded. tcpChannel.writeAndFlush(new NettyMessage.CloseRequest()) .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); // Make sure to remove the client from the factory clientFactory.destroyPartitionRequestClient(connectionId, this); } else { clientHandler.cancelRequestFor(inputChannel.getInputChannelId()); } }