protected <R, V> void sendCommand(final AsyncDetails<V, R> details, final RedisConnection connection) { if (details.getSource().getRedirect() == Redirect.ASK) { List<CommandData<?, ?>> list = new ArrayList<CommandData<?, ?>>(2); RPromise<Void> promise = new RedissonPromise<Void>(); list.add(new CommandData<Void, Void>(promise, details.getCodec(), RedisCommands.ASKING, new Object[]{})); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, false)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection); } ChannelFuture future = connection.send(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); details.setWriteFuture(future); } }
protected <R, V> void sendCommand(final AsyncDetails<V, R> details, final RedisConnection connection) { if (details.getSource().getRedirect() == Redirect.ASK) { List<CommandData<?, ?>> list = new ArrayList<CommandData<?, ?>>(2); RPromise<Void> promise = new RedissonPromise<Void>(); list.add(new CommandData<Void, Void>(promise, details.getCodec(), RedisCommands.ASKING, new Object[]{})); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, false)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection); } ChannelFuture future = connection.send(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); details.setWriteFuture(future); } }
RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { ChannelFuture future = connection.send(new CommandsData(main, list, true)); connectionEntry.setFirstCommand(false); details.setWriteFuture(future); } else { if (RedisCommands.EXEC.getName().equals(details.getCommand().getName())) { details.setWriteFuture(future); } else { RPromise<Void> main = new RedissonPromise<Void>(); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future);
RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { ChannelFuture future = connection.send(new CommandsData(main, list, true)); connectionEntry.setFirstCommand(false); details.setWriteFuture(future); } else { if (RedisCommands.EXEC.getName().equals(details.getCommand().getName())) { details.setWriteFuture(future); } else { RPromise<Void> main = new RedissonPromise<Void>(); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future);
details.setWriteFuture(future);
details.setWriteFuture(future);
protected <R, V> void sendCommand(final AsyncDetails<V, R> details, final RedisConnection connection) { if (details.getSource().getRedirect() == Redirect.ASK) { List<CommandData<?, ?>> list = new ArrayList<CommandData<?, ?>>(2); RPromise<Void> promise = new RedissonPromise<Void>(); list.add(new CommandData<Void, Void>(promise, details.getCodec(), RedisCommands.ASKING, new Object[]{})); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, false)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection); } ChannelFuture future = connection.send(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); details.setWriteFuture(future); } }
RPromise<Void> main = new RedissonPromise<Void>(); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future); } else { if (log.isDebugEnabled()) { ChannelFuture future = connection.send(new CommandsData(main, list, true)); connectionEntry.setFirstCommand(false); details.setWriteFuture(future); } else { if (RedisCommands.EXEC.getName().equals(details.getCommand().getName())) { details.setWriteFuture(future); } else { RPromise<Void> main = new RedissonPromise<Void>(); list.add(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future);
details.setWriteFuture(future);