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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FixedRedisMessagePool.RedisErrorKey
static class
FixedRedisMessagePool.RedisReplyKey
-
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
static FixedRedisMessagePool
INSTANCE
A shared object forFixedRedisMessagePool
.private java.util.Map<FixedRedisMessagePool.RedisErrorKey,ErrorRedisMessage>
keyToErrors
private java.util.Map<FixedRedisMessagePool.RedisReplyKey,SimpleStringRedisMessage>
keyToSimpleStrings
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
-
-
-
Field Detail
-
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
-
keyToSimpleStrings
private final java.util.Map<FixedRedisMessagePool.RedisReplyKey,SimpleStringRedisMessage> keyToSimpleStrings
-
byteBufToErrors
private final java.util.Map<ByteBuf,ErrorRedisMessage> byteBufToErrors
-
stringToErrors
private final java.util.Map<java.lang.String,ErrorRedisMessage> stringToErrors
-
keyToErrors
private final java.util.Map<FixedRedisMessagePool.RedisErrorKey,ErrorRedisMessage> keyToErrors
-
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(FixedRedisMessagePool.RedisReplyKey key)
ReturnsSimpleStringRedisMessage
for the givenFixedRedisMessagePool.RedisReplyKey
ornull
if it does not exist.
-
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(FixedRedisMessagePool.RedisErrorKey key)
ReturnsErrorRedisMessage
for the givenFixedRedisMessagePool.RedisErrorKey
ornull
if it does not exist.
-
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
-
-