@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override protected <V, R> void handleError(final AsyncDetails<V, R> details, RPromise<R> promise, Throwable cause) { if (isRedisBasedQueue() && promise instanceof BatchPromise) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); sentPromise.tryFailure(cause); promise.tryFailure(cause); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } semaphore.release(); return; } super.handleError(details, promise, cause); }
@Override protected <V, R> void handleSuccess(final AsyncDetails<V, R> details, RPromise<R> promise, RedisCommand<?> command, R res) { if (RedisCommands.EXEC.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, res); return; } if (RedisCommands.DISCARD.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, null); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } return; } if (isRedisBasedQueue()) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); super.handleSuccess(details, sentPromise, command, null); semaphore.release(); } }
@Override protected <V, R> void handleError(final AsyncDetails<V, R> details, RPromise<R> promise, Throwable cause) { if (isRedisBasedQueue() && promise instanceof BatchPromise) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); sentPromise.tryFailure(cause); promise.tryFailure(cause); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } semaphore.release(); return; } super.handleError(details, promise, cause); }
@Override protected <V, R> void handleSuccess(final AsyncDetails<V, R> details, RPromise<R> promise, RedisCommand<?> command, R res) { if (RedisCommands.EXEC.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, res); return; } if (RedisCommands.DISCARD.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, null); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } return; } if (isRedisBasedQueue()) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); super.handleSuccess(details, sentPromise, command, null); semaphore.release(); } }
R res = future.getNow(); if (res instanceof ScanResult) { ((ScanResult) res).setRedisClient(details.getConnectionFuture().getNow().getRedisClient());
R res = future.getNow(); if (res instanceof ScanResult) { ((ScanResult) res).setRedisClient(details.getConnectionFuture().getNow().getRedisClient());
if (details.getConnectionFuture().cancel(false)) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to get connection! " if (details.getConnectionFuture().isSuccess()) { if (details.getWriteFuture() == null || !details.getWriteFuture().isDone()) { if (details.getAttempt() == connectionManager.getConfig().getRetryAttempts()) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to send command! " + "Node source: " + source + ", connection: " + details.getConnectionFuture().getNow() + ", current command in queue: " + details.getConnectionFuture().getNow().getCurrentCommand() + ", command: " + command + ", command params: " + LogHelper.toString(details.getParams()) + " after " + connectionManager.getConfig().getRetryAttempts() + " retry attempts"));
if (details.getConnectionFuture().cancel(false)) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to get connection! " if (details.getConnectionFuture().isSuccess()) { if (details.getWriteFuture() == null || !details.getWriteFuture().isDone()) { if (details.getAttempt() == connectionManager.getConfig().getRetryAttempts()) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to send command! " + "Node source: " + source + ", connection: " + details.getConnectionFuture().getNow() + ", current command in queue: " + details.getConnectionFuture().getNow().getCurrentCommand() + ", command: " + command + ", command params: " + LogHelper.toString(details.getParams()) + " after " + connectionManager.getConfig().getRetryAttempts() + " retry attempts"));
@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } });
@Override protected <V, R> void handleError(final AsyncDetails<V, R> details, RPromise<R> promise, Throwable cause) { if (isRedisBasedQueue() && promise instanceof BatchPromise) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); sentPromise.tryFailure(cause); promise.tryFailure(cause); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } semaphore.release(); return; } super.handleError(details, promise, cause); }
@Override protected <V, R> void handleSuccess(final AsyncDetails<V, R> details, RPromise<R> promise, RedisCommand<?> command, R res) { if (RedisCommands.EXEC.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, res); return; } if (RedisCommands.DISCARD.getName().equals(command.getName())) { super.handleSuccess(details, promise, command, null); if (executed.compareAndSet(false, true)) { details.getConnectionFuture().getNow().forceFastReconnectAsync().addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { CommandBatchService.super.releaseConnection(details.getSource(), details.getConnectionFuture(), details.isReadOnlyMode(), details.getAttemptPromise(), details); } }); } return; } if (isRedisBasedQueue()) { BatchPromise<R> batchPromise = (BatchPromise<R>) promise; RPromise<R> sentPromise = (RPromise<R>) batchPromise.getSentPromise(); super.handleSuccess(details, sentPromise, command, null); semaphore.release(); } }
R res = future.getNow(); if (res instanceof ScanResult) { ((ScanResult) res).setRedisClient(details.getConnectionFuture().getNow().getRedisClient());
if (details.getConnectionFuture().cancel(false)) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to get connection! Try to increase 'nettyThreads' and 'connection pool' settings or set decodeInExecutor = true and increase 'threads' setting" if (details.getConnectionFuture().isSuccess()) { if (details.getWriteFuture() == null || !details.getWriteFuture().isDone()) { if (details.getAttempt() == connectionManager.getConfig().getRetryAttempts()) { if (details.getException() == null) { details.setException(new RedisTimeoutException("Unable to send command! " + "Node source: " + source + ", connection: " + details.getConnectionFuture().getNow() + ", current command in queue: " + details.getConnectionFuture().getNow().getCurrentCommand() + ", command: " + command + ", command params: " + LogHelper.toString(details.getParams()) + " after " + connectionManager.getConfig().getRetryAttempts() + " retry attempts"));