@Override public void operationComplete(ChannelFuture future) { if (future.isCancelled()) { LOG.error("Close cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Close failed on ID " + id, future.cause()); } } };
@Override public void operationComplete(ChannelFuture future) { if (future.isCancelled()) { LOG.error("Close cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Close failed on ID " + id, future.cause()); } } };
@Override public void operationComplete(ChannelFuture future) { //Asynch write completed //Up the semaphore writeResources.release(); if (future.isCancelled()) { LOG.error("Write cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Write error on ID " + id, future.cause()); } } };
@Override public void operationComplete(ChannelFuture future) { writeResources.release(); if (future.isCancelled()) { LOG.error("Write cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Write error on ID " + id, future.cause()); } } };
@Override public void operationComplete(ChannelFuture future) { if (future.isCancelled()) { LOG.error("Close cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Close failed on ID " + id, future.cause()); } } };
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) { pendingWrites--; if (future.isCancelled()) { LOG.error("Write cancelled on ID " + id); } else if (!future.isSuccess()) { LOG.error("Write error on ID " + id, future.cause()); } synchronized (writeMonitor) { writeMonitor.notifyAll(); } } };
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { unsubscribe(); /*Unsubscribe from source if the promise is cancelled.*/ } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { InternalLogger internalLogger = logNotifyFailure ? logger : null; if (future.isSuccess()) { Void result = future.get(); PromiseNotificationUtil.trySuccess(delegate, result, internalLogger); } else if (future.isCancelled()) { PromiseNotificationUtil.tryCancel(delegate, internalLogger); } else { Throwable cause = future.cause(); PromiseNotificationUtil.tryFailure(delegate, cause, internalLogger); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isCancelled()) { if (connectTimeoutFuture != null) { connectTimeoutFuture.cancel(false); } connectPromise = null; close(voidPromise()); } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { InternalLogger internalLogger = logNotifyFailure ? logger : null; if (future.isSuccess()) { Void result = future.get(); PromiseNotificationUtil.trySuccess(delegate, result, internalLogger); } else if (future.isCancelled()) { PromiseNotificationUtil.tryCancel(delegate, internalLogger); } else { Throwable cause = future.cause(); PromiseNotificationUtil.tryFailure(delegate, cause, internalLogger); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { InternalLogger internalLogger = logNotifyFailure ? logger : null; if (future.isSuccess()) { Void result = future.get(); PromiseNotificationUtil.trySuccess(delegate, result, internalLogger); } else if (future.isCancelled()) { PromiseNotificationUtil.tryCancel(delegate, internalLogger); } else { Throwable cause = future.cause(); PromiseNotificationUtil.tryFailure(delegate, cause, internalLogger); } }
/** * Gets new channel. * * @param address the address * @return the new channel */ protected Channel getNewChannel(InetSocketAddress address) { Channel channel = null; ChannelFuture f = this.bootstrap.connect(address); try { f.await(this.nettyClientConfig.getConnectTimeoutMillis(), TimeUnit.MILLISECONDS); if (f.isCancelled()) { throw new FrameworkException(f.cause(), "connect cancelled, can not connect to fescar-server."); } else if (!f.isSuccess()) { throw new FrameworkException(f.cause(), "connect failed, can not connect to fescar-server."); } else { channel = f.channel(); } } catch (Exception e) { throw new FrameworkException(e, "can not connect to fescar-server."); } return channel; }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { promise.setSuccess(streamChannel); } else if (future.isCancelled()) { promise.cancel(false); } else { if (streamChannel.isRegistered()) { streamChannel.close(); } else { streamChannel.unsafe().closeForcibly(); } promise.setFailure(future.cause()); } } });
private void checkWriteFuture(final Entry entry, final RPromise<Void> attemptPromise, final AsyncDetails details, final RedisConnection connection, ChannelFuture future, long responseTimeout, int attempts, final AtomicInteger slots, final RPromise<Void> mainPromise) { if (future.isCancelled() || attemptPromise.isDone()) { return;