private void checkNotClosed() throws IOException { if (closeReferenceCounter.isDisposed()) { throw new LocalTransportException("Channel closed.", tcpChannel.localAddress()); } } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { inputChannel.onError(new LocalTransportException( "Sending the task event failed.", future.channel().localAddress(), future.cause() )); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { partitionRequestHandler.removeInputChannel(inputChannel); inputChannel.onError( new LocalTransportException( "Sending the partition request failed.", future.channel().localAddress(), future.cause() )); } } };
private void checkNotClosed() throws IOException { if (closeReferenceCounter.isDisposed()) { throw new LocalTransportException("Channel closed.", tcpChannel.localAddress()); } } }
private void checkNotClosed() throws IOException { if (closeReferenceCounter.isDisposed()) { final SocketAddress localAddr = tcpChannel.localAddress(); final SocketAddress remoteAddr = tcpChannel.remoteAddress(); throw new LocalTransportException(String.format("Channel to '%s' closed.", remoteAddr), localAddr); } } }
private void checkNotClosed() throws IOException { if (closeReferenceCounter.isDisposed()) { final SocketAddress localAddr = tcpChannel.localAddress(); final SocketAddress remoteAddr = tcpChannel.remoteAddress(); throw new LocalTransportException(String.format("Channel to '%s' closed.", remoteAddr), localAddr); } } }
/** * Sends a task event backwards to an intermediate result partition producer. * <p> * Backwards task events flow between readers and writers and therefore * will only work when both are running at the same time, which is only * guaranteed to be the case when both the respective producer and * consumer task run pipelined. */ public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException { checkNotClosed(); tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId())) .addListener( new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { inputChannel.onError(new LocalTransportException( "Sending the task event failed.", future.channel().localAddress(), future.cause() )); } } }); }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { handInChannel(future.channel()); } else if (future.cause() != null) { notifyOfError(new RemoteTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has failed. This might indicate that the remote task " + "manager has been lost.", connectionId.getAddress(), future.cause())); } else { notifyOfError(new LocalTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has been cancelled.", null)); } } }
/** * Called on exceptions in the client handler pipeline. * * <p>Remote exceptions are received as regular payload. */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof TransportException) { notifyAllChannelsOfErrorAndClose(cause); } else { final SocketAddress remoteAddr = ctx.channel().remoteAddress(); final TransportException tex; // Improve on the connection reset by peer error message if (cause instanceof IOException && cause.getMessage().equals("Connection reset by peer")) { tex = new RemoteTransportException("Lost connection to task manager '" + remoteAddr + "'. " + "This indicates that the remote task manager was lost.", remoteAddr, cause); } else { tex = new LocalTransportException(cause.getMessage(), ctx.channel().localAddress(), cause); } notifyAllChannelsOfErrorAndClose(tex); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError(new LocalTransportException( String.format("Sending the task event to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { inputChannel.onError(new LocalTransportException( "Sending the task event failed.", future.channel().localAddress(), future.cause() )); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError(new LocalTransportException( String.format("Sending the task event to '%s' failed.", remoteAddr), 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() )); } } };
@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() )); } } };
/** * Sends a task event backwards to an intermediate result partition producer. * <p> * Backwards task events flow between readers and writers and therefore * will only work when both are running at the same time, which is only * guaranteed to be the case when both the respective producer and * consumer task run pipelined. */ public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException { checkNotClosed(); tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId())) .addListener( new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { inputChannel.onError(new LocalTransportException( "Sending the task event failed.", future.channel().localAddress(), future.cause() )); } } }); }
/** * Sends a task event backwards to an intermediate result partition producer. * <p> * Backwards task events flow between readers and writers and therefore * will only work when both are running at the same time, which is only * guaranteed to be the case when both the respective producer and * consumer task run pipelined. */ public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException { checkNotClosed(); tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId())) .addListener( new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError(new LocalTransportException( String.format("Sending the task event to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } }); }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { handInChannel(future.channel()); } else if (future.cause() != null) { notifyOfError(new RemoteTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has failed. This might indicate that the remote task " + "manager has been lost.", connectionId.getAddress(), future.cause())); } else { notifyOfError(new LocalTransportException( String.format( "Connecting to remote task manager '%s' has been cancelled.", connectionId.getAddress()), null)); } } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { handInChannel(future.channel()); } else if (future.cause() != null) { notifyOfError(new RemoteTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has failed. This might indicate that the remote task " + "manager has been lost.", connectionId.getAddress(), future.cause())); } else { notifyOfError(new LocalTransportException( String.format( "Connecting to remote task manager '%s' has been cancelled.", connectionId.getAddress()), null)); } } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { handInChannel(future.channel()); } else if (future.cause() != null) { notifyOfError(new RemoteTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has failed. This might indicate that the remote task " + "manager has been lost.", connectionId.getAddress(), future.cause())); } else { notifyOfError(new LocalTransportException( "Connecting to remote task manager + '" + connectionId.getAddress() + "' has been cancelled.", null)); } } }