@UnstableApi public final class FixedRedisMessagePool extends java.lang.Object implements RedisMessagePool
Modifier and Type | Field and Description |
---|---|
private java.util.Map<ByteBuf,ErrorRedisMessage> |
byteBufToErrors |
private java.util.Map<ByteBuf,IntegerRedisMessage> |
byteBufToIntegers |
private java.util.Map<ByteBuf,SimpleStringRedisMessage> |
byteBufToSimpleStrings |
private static java.lang.String[] |
DEFAULT_ERRORS |
private static java.lang.String[] |
DEFAULT_SIMPLE_STRINGS |
static FixedRedisMessagePool |
INSTANCE
A shared object for
FixedRedisMessagePool . |
private LongObjectMap<byte[]> |
longToByteBufs |
private LongObjectMap<IntegerRedisMessage> |
longToIntegers |
private static long |
MAX_CACHED_INTEGER_NUMBER |
private static long |
MIN_CACHED_INTEGER_NUMBER |
private static int |
SIZE_CACHED_INTEGER_NUMBER |
private java.util.Map<java.lang.String,ErrorRedisMessage> |
stringToErrors |
private java.util.Map<java.lang.String,SimpleStringRedisMessage> |
stringToSimpleStrings |
Modifier | Constructor and Description |
---|---|
private |
FixedRedisMessagePool()
Creates a
FixedRedisMessagePool instance. |
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteBufOfInteger(long value)
Returns
byte[] for given msg . |
ErrorRedisMessage |
getError(ByteBuf content)
Returns
ErrorRedisMessage for given content . |
ErrorRedisMessage |
getError(java.lang.String content)
Returns
ErrorRedisMessage for given content . |
IntegerRedisMessage |
getInteger(ByteBuf content)
Returns
IntegerRedisMessage for given content . |
IntegerRedisMessage |
getInteger(long value)
Returns
IntegerRedisMessage for given value . |
SimpleStringRedisMessage |
getSimpleString(ByteBuf content)
Returns
SimpleStringRedisMessage for given content . |
SimpleStringRedisMessage |
getSimpleString(java.lang.String content)
Returns
SimpleStringRedisMessage for given content . |
private static final java.lang.String[] DEFAULT_SIMPLE_STRINGS
private static final java.lang.String[] DEFAULT_ERRORS
private static final long MIN_CACHED_INTEGER_NUMBER
private static final long MAX_CACHED_INTEGER_NUMBER
private static final int SIZE_CACHED_INTEGER_NUMBER
public static final FixedRedisMessagePool INSTANCE
FixedRedisMessagePool
.private final java.util.Map<ByteBuf,SimpleStringRedisMessage> byteBufToSimpleStrings
private final java.util.Map<java.lang.String,SimpleStringRedisMessage> stringToSimpleStrings
private final java.util.Map<ByteBuf,ErrorRedisMessage> byteBufToErrors
private final java.util.Map<java.lang.String,ErrorRedisMessage> stringToErrors
private final java.util.Map<ByteBuf,IntegerRedisMessage> byteBufToIntegers
private final LongObjectMap<IntegerRedisMessage> longToIntegers
private final LongObjectMap<byte[]> longToByteBufs
private FixedRedisMessagePool()
FixedRedisMessagePool
instance.public SimpleStringRedisMessage getSimpleString(java.lang.String content)
RedisMessagePool
getSimpleString
in interface RedisMessagePool
public SimpleStringRedisMessage getSimpleString(ByteBuf content)
RedisMessagePool
getSimpleString
in interface RedisMessagePool
public ErrorRedisMessage getError(java.lang.String content)
RedisMessagePool
getError
in interface RedisMessagePool
public ErrorRedisMessage getError(ByteBuf content)
RedisMessagePool
getError
in interface RedisMessagePool
public IntegerRedisMessage getInteger(long value)
RedisMessagePool
getInteger
in interface RedisMessagePool
public IntegerRedisMessage getInteger(ByteBuf content)
RedisMessagePool
getInteger
in interface RedisMessagePool
public byte[] getByteBufOfInteger(long value)
RedisMessagePool
byte[]
for given msg
. Returns null
it does not exist.getByteBufOfInteger
in interface RedisMessagePool