Package io.netty.handler.codec.redis
Class FixedRedisMessagePool
- java.lang.Object
-
- io.netty.handler.codec.redis.FixedRedisMessagePool
-
- All Implemented Interfaces:
RedisMessagePool
@UnstableApi public final class FixedRedisMessagePool extends java.lang.Object implements RedisMessagePool
A default fixed redis message pool.
-
-
Field Summary
Fields Modifier and Type Field 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 forFixedRedisMessagePool
.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
-
Constructor Summary
Constructors Modifier Constructor Description private
FixedRedisMessagePool()
Creates aFixedRedisMessagePool
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getByteBufOfInteger(long value)
Returnsbyte[]
for givenmsg
.ErrorRedisMessage
getError(ByteBuf content)
ReturnsErrorRedisMessage
for givencontent
.ErrorRedisMessage
getError(java.lang.String content)
ReturnsErrorRedisMessage
for givencontent
.IntegerRedisMessage
getInteger(long value)
ReturnsIntegerRedisMessage
for givenvalue
.IntegerRedisMessage
getInteger(ByteBuf content)
ReturnsIntegerRedisMessage
for givencontent
.SimpleStringRedisMessage
getSimpleString(ByteBuf content)
ReturnsSimpleStringRedisMessage
for givencontent
.SimpleStringRedisMessage
getSimpleString(java.lang.String content)
ReturnsSimpleStringRedisMessage
for givencontent
.
-
-
-
Field Detail
-
DEFAULT_SIMPLE_STRINGS
private static final java.lang.String[] DEFAULT_SIMPLE_STRINGS
-
DEFAULT_ERRORS
private static final java.lang.String[] DEFAULT_ERRORS
-
MIN_CACHED_INTEGER_NUMBER
private static final long MIN_CACHED_INTEGER_NUMBER
- See Also:
- Constant Field Values
-
MAX_CACHED_INTEGER_NUMBER
private static final long MAX_CACHED_INTEGER_NUMBER
- See Also:
- Constant Field Values
-
SIZE_CACHED_INTEGER_NUMBER
private static final int SIZE_CACHED_INTEGER_NUMBER
- See Also:
- Constant Field Values
-
INSTANCE
public static final FixedRedisMessagePool INSTANCE
A shared object forFixedRedisMessagePool
.
-
byteBufToSimpleStrings
private final java.util.Map<ByteBuf,SimpleStringRedisMessage> byteBufToSimpleStrings
-
stringToSimpleStrings
private final java.util.Map<java.lang.String,SimpleStringRedisMessage> stringToSimpleStrings
-
byteBufToErrors
private final java.util.Map<ByteBuf,ErrorRedisMessage> byteBufToErrors
-
stringToErrors
private final java.util.Map<java.lang.String,ErrorRedisMessage> stringToErrors
-
byteBufToIntegers
private final java.util.Map<ByteBuf,IntegerRedisMessage> byteBufToIntegers
-
longToIntegers
private final LongObjectMap<IntegerRedisMessage> longToIntegers
-
longToByteBufs
private final LongObjectMap<byte[]> longToByteBufs
-
-
Constructor Detail
-
FixedRedisMessagePool
private FixedRedisMessagePool()
Creates aFixedRedisMessagePool
instance.
-
-
Method Detail
-
getSimpleString
public SimpleStringRedisMessage getSimpleString(java.lang.String content)
Description copied from interface:RedisMessagePool
- Specified by:
getSimpleString
in interfaceRedisMessagePool
-
getSimpleString
public SimpleStringRedisMessage getSimpleString(ByteBuf content)
Description copied from interface:RedisMessagePool
- Specified by:
getSimpleString
in interfaceRedisMessagePool
-
getError
public ErrorRedisMessage getError(java.lang.String content)
Description copied from interface:RedisMessagePool
- Specified by:
getError
in interfaceRedisMessagePool
-
getError
public ErrorRedisMessage getError(ByteBuf content)
Description copied from interface:RedisMessagePool
- Specified by:
getError
in interfaceRedisMessagePool
-
getInteger
public IntegerRedisMessage getInteger(long value)
Description copied from interface:RedisMessagePool
- Specified by:
getInteger
in interfaceRedisMessagePool
-
getInteger
public IntegerRedisMessage getInteger(ByteBuf content)
Description copied from interface:RedisMessagePool
- Specified by:
getInteger
in interfaceRedisMessagePool
-
getByteBufOfInteger
public byte[] getByteBufOfInteger(long value)
Description copied from interface:RedisMessagePool
Returnsbyte[]
for givenmsg
. Returnsnull
it does not exist.- Specified by:
getByteBufOfInteger
in interfaceRedisMessagePool
-
-