public void clearErrors() { for (BatchCommandData<?, ?> commandEntry : commands) { commandEntry.clearError(); } }
protected boolean isWaitCommand(BatchCommandData<?, ?> c) { return c.getCommand().getName().equals(RedisCommands.WAIT.getName()); }
protected MultiDecoder<Object> messageDecoder(CommandData<Object, Object> data, List<Object> parts) { if (data == null) { if (parts.isEmpty()) { return null; } } return data.getCommand().getReplayMultiDecoder(); }
@Override public List<CommandData<Object, Object>> getPubSubOperations() { if (RedisCommands.PUBSUB_COMMANDS.contains(getCommand().getName())) { return Collections.singletonList((CommandData<Object, Object>)this); } return Collections.emptyList(); }
@Override public Object decode(ByteBuf buf, State state) throws IOException { String str = (String) LongCodec.super.getValueDecoder().decode(buf, state); return Long.valueOf(str); } };
private void handleResult(CommandData<Object, Object> data, List<Object> parts, Object result, boolean skipConvertor, Channel channel) { if (data != null && !skipConvertor) { result = data.getCommand().getConvertor().convert(result); } if (parts != null) { parts.add(result); } else { completeResponse(data, result, channel); } }
@Override public Throwable cause() { if (redirectError.get() != null) { return redirectError.get(); } return super.cause(); }
protected void sendNext(ChannelHandlerContext ctx, QueueCommand data) { if (data != null) { if (data.isExecuted()) { sendNext(ctx); } } else { sendNext(ctx); } }
@Override public boolean tryFailure(Throwable cause) { if (redirectError.get() != null) { return false; } if (cause instanceof RedisRedirectException) { return redirectError.compareAndSet(null, (RedisRedirectException) cause); } return super.tryFailure(cause); }
protected boolean isWaitCommand(BatchCommandData<?, ?> c) { return c.getCommand().getName().equals(RedisCommands.WAIT.getName()); }
@Override public List<CommandData<Object, Object>> getPubSubOperations() { if (RedisCommands.PUBSUB_COMMANDS.contains(getCommand().getName())) { return Collections.singletonList((CommandData<Object, Object>)this); } return Collections.emptyList(); }
@Override public Object decode(ByteBuf buf, State state) throws IOException { String str = (String) IntegerCodec.super.getValueDecoder().decode(buf, state); return Integer.valueOf(str); } };
protected MultiDecoder<Object> messageDecoder(CommandData<Object, Object> data, List<Object> parts) { if (data == null) { if (parts.isEmpty()) { return null; } } return data.getCommand().getReplayMultiDecoder(); }
public void clearErrors() { for (BatchCommandData<?, ?> commandEntry : commands) { commandEntry.clearError(); } }
@Override public Throwable cause() { if (redirectError.get() != null) { return redirectError.get(); } return super.cause(); }
protected void sendNext(ChannelHandlerContext ctx, QueueCommand data) { if (data != null) { if (data.isExecuted()) { sendNext(ctx); } } else { sendNext(ctx); } }
@Override public List<CommandData<Object, Object>> getPubSubOperations() { List<CommandData<Object, Object>> result = new ArrayList<CommandData<Object, Object>>(); for (CommandData<?, ?> commandData : commands) { if (RedisCommands.PUBSUB_COMMANDS.equals(commandData.getCommand().getName())) { result.add((CommandData<Object, Object>)commandData); } } return result; }
@Override public Object decode(ByteBuf buf, State state) throws IOException { String str = (String) IntegerCodec.super.getValueDecoder().decode(buf, state); return Integer.valueOf(str); } };
private Object decode(ByteBuf buf, State state, Decoder<?> decoder) throws IOException { int keyLen; if (isWindows) { keyLen = buf.readIntLE(); } else { keyLen = (int) buf.readLongLE(); } ByteBuf keyBuf = buf.readSlice(keyLen); Object key = decoder.decode(keyBuf, state); return key; }