K - Key type.V - Value type.public class RedisStateMachine<K,V> extends Object
| Constructor and Description |
|---|
RedisStateMachine()
Initialize a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the state machine to free resources.
|
boolean |
decode(ByteBuf buffer,
CommandOutput<K,V,?> output)
Decode a command using the input buffer.
|
boolean |
decode(ByteBuf buffer,
RedisCommand<K,V,?> command,
CommandOutput<K,V,?> output)
Attempt to decode a redis response and return a flag indicating whether a complete response was read.
|
void |
reset()
Reset the state machine.
|
protected void |
safeMulti(CommandOutput<K,V,?> output,
int count,
RedisCommand<K,V,?> command)
Safely sets
CommandOutput.multi(int). |
protected void |
safeSet(CommandOutput<K,V,?> output,
ByteBuffer bytes,
RedisCommand<K,V,?> command)
Safely sets
CommandOutput.set(ByteBuffer). |
protected void |
safeSet(CommandOutput<K,V,?> output,
long integer,
RedisCommand<K,V,?> command)
Safely sets
CommandOutput.set(long). |
protected void |
safeSetError(CommandOutput<K,V,?> output,
ByteBuffer bytes,
RedisCommand<K,V,?> command)
Safely sets
CommandOutput.setError(ByteBuffer). |
public boolean decode(ByteBuf buffer, CommandOutput<K,V,?> output)
buffer - Buffer containing data from the server.output - Current command output.public boolean decode(ByteBuf buffer, RedisCommand<K,V,?> command, CommandOutput<K,V,?> output)
buffer - Buffer containing data from the server.command - the command itselfoutput - Current command output.public void reset()
public void close()
protected void safeSet(CommandOutput<K,V,?> output, long integer, RedisCommand<K,V,?> command)
CommandOutput.set(long). Completes a command exceptionally in case an exception occurs.output - integer - command - protected void safeSet(CommandOutput<K,V,?> output, ByteBuffer bytes, RedisCommand<K,V,?> command)
CommandOutput.set(ByteBuffer). Completes a command exceptionally in case an exception occurs.output - bytes - command - protected void safeMulti(CommandOutput<K,V,?> output, int count, RedisCommand<K,V,?> command)
CommandOutput.multi(int). Completes a command exceptionally in case an exception occurs.output - count - command - protected void safeSetError(CommandOutput<K,V,?> output, ByteBuffer bytes, RedisCommand<K,V,?> command)
CommandOutput.setError(ByteBuffer). Completes a command exceptionally in case an exception occurs.output - bytes - command - Copyright © 2018 lettuce.io. All rights reserved.