public void clearErrors() { for (BatchCommandData<?, ?> commandEntry : commands) { commandEntry.clearError(); } }
for (BatchCommandData<?, ?> commandEntry : entries) { if (isWaitCommand(commandEntry)) { syncedSlaves = (Integer) commandEntry.getPromise().getNow(); } else if (!commandEntry.getCommand().getName().equals(RedisCommands.MULTI.getName()) && !commandEntry.getCommand().getName().equals(RedisCommands.EXEC.getName())) { Object entryResult = commandEntry.getPromise().getNow(); entryResult = tryHandleReference(entryResult); responses.add(entryResult);
protected void free(final Entry entry) { for (BatchCommandData<?, ?> command : entry.getCommands()) { free(command.getParams()); } }
BatchCommandData<V, R> commandData = new BatchCommandData<V, R>(mainPromise, codecToUse, command, batchParams, index.incrementAndGet()); entry.getCommands().add(commandData);
for (Entry entry : commands.values()) { for (BatchCommandData<?, ?> command : entry.getCommands()) { if (command.getPromise().isDone() && !command.getPromise().isSuccess()) { resultPromise.tryFailure(command.getPromise().cause()); break;
protected boolean isWaitCommand(BatchCommandData<?, ?> c) { return c.getCommand().getName().equals(RedisCommands.WAIT.getName()); }
BatchCommandData<V, R> commandData = new BatchCommandData<V, R>(mainPromise, codecToUse, command, batchParams, index.incrementAndGet()); entry.getCommands().add(commandData);
for (Entry entry : commands.values()) { for (BatchCommandData<?, ?> command : entry.getCommands()) { if (command.getPromise().isDone() && !command.getPromise().isSuccess()) { resultPromise.tryFailure(command.getPromise().cause()); break;
protected boolean isWaitCommand(BatchCommandData<?, ?> c) { return c.getCommand().getName().equals(RedisCommands.WAIT.getName()); }
for (BatchCommandData<?, ?> commandEntry : entries) { if (isWaitCommand(commandEntry)) { syncedSlaves = (Integer) commandEntry.getPromise().getNow(); } else if (!commandEntry.getCommand().getName().equals(RedisCommands.MULTI.getName()) && !commandEntry.getCommand().getName().equals(RedisCommands.EXEC.getName())) { Object entryResult = commandEntry.getPromise().getNow(); entryResult = tryHandleReference(entryResult); responses.add(entryResult);
BatchCommandData<?, ?> multiCommand = new BatchCommandData(RedisCommands.MULTI, new Object[] {}, index.incrementAndGet()); entry.getCommands().addFirst(multiCommand); BatchCommandData<?, ?> execCommand = new BatchCommandData(RedisCommands.EXEC, new Object[] {}, index.incrementAndGet()); entry.getCommands().add(execCommand); BatchCommandData<?, ?> offCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "OFF" }, index.incrementAndGet()); entry.getCommands().addFirst(offCommand); BatchCommandData<?, ?> onCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "ON" }, index.incrementAndGet()); entry.getCommands().add(onCommand); BatchCommandData<?, ?> waitCommand = new BatchCommandData(RedisCommands.WAIT, new Object[] { this.options.getSyncSlaves(), this.options.getSyncTimeout() }, index.incrementAndGet()); entry.getCommands().add(waitCommand);
if (c.getPromise().isSuccess() && !isWaitCommand(c) && !isAtomic) {
public void clearErrors() { for (BatchCommandData<?, ?> commandEntry : commands) { commandEntry.clearError(); } }
protected void free(final Entry entry) { for (BatchCommandData<?, ?> command : entry.getCommands()) { free(command.getParams()); } }
protected boolean isWaitCommand(BatchCommandData<?, ?> c) { return c.getCommand().getName().equals(RedisCommands.WAIT.getName()); }
for (BatchCommandData<?, ?> commandEntry : entries) { if (isWaitCommand(commandEntry)) { syncedSlaves = (Integer) commandEntry.getPromise().getNow(); } else if (!commandEntry.getCommand().getName().equals(RedisCommands.MULTI.getName()) && !commandEntry.getCommand().getName().equals(RedisCommands.EXEC.getName())) { Object entryResult = commandEntry.getPromise().getNow(); entryResult = tryHandleReference(entryResult); responses.add(entryResult);
BatchCommandData<?, ?> multiCommand = new BatchCommandData(RedisCommands.MULTI, new Object[] {}, index.incrementAndGet()); entry.getCommands().addFirst(multiCommand); BatchCommandData<?, ?> execCommand = new BatchCommandData(RedisCommands.EXEC, new Object[] {}, index.incrementAndGet()); entry.getCommands().add(execCommand); BatchCommandData<?, ?> offCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "OFF" }, index.incrementAndGet()); entry.getCommands().addFirst(offCommand); BatchCommandData<?, ?> onCommand = new BatchCommandData(RedisCommands.CLIENT_REPLY, new Object[] { "ON" }, index.incrementAndGet()); entry.getCommands().add(onCommand); BatchCommandData<?, ?> waitCommand = new BatchCommandData(RedisCommands.WAIT, new Object[] { this.options.getSyncSlaves(), this.options.getSyncTimeout() }, index.incrementAndGet()); entry.getCommands().add(waitCommand);
if (c.getPromise().isSuccess() && !isWaitCommand(c) && !isAtomic) {
public void clearErrors() { for (BatchCommandData<?, ?> commandEntry : commands) { commandEntry.clearError(); } }
protected void free(final Entry entry) { for (BatchCommandData<?, ?> command : entry.getCommands()) { free(command.getParams()); } }