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>byteBufToErrorsprivate java.util.Map<ByteBuf,IntegerRedisMessage>byteBufToIntegersprivate java.util.Map<ByteBuf,SimpleStringRedisMessage>byteBufToSimpleStringsprivate static java.lang.String[]DEFAULT_ERRORSprivate static java.lang.String[]DEFAULT_SIMPLE_STRINGSstatic FixedRedisMessagePoolINSTANCEA shared object forFixedRedisMessagePool.private LongObjectMap<byte[]>longToByteBufsprivate LongObjectMap<IntegerRedisMessage>longToIntegersprivate static longMAX_CACHED_INTEGER_NUMBERprivate static longMIN_CACHED_INTEGER_NUMBERprivate static intSIZE_CACHED_INTEGER_NUMBERprivate java.util.Map<java.lang.String,ErrorRedisMessage>stringToErrorsprivate java.util.Map<java.lang.String,SimpleStringRedisMessage>stringToSimpleStrings
-
Constructor Summary
Constructors Modifier Constructor Description privateFixedRedisMessagePool()Creates aFixedRedisMessagePoolinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getByteBufOfInteger(long value)Returnsbyte[]for givenmsg.ErrorRedisMessagegetError(ByteBuf content)ReturnsErrorRedisMessagefor givencontent.ErrorRedisMessagegetError(java.lang.String content)ReturnsErrorRedisMessagefor givencontent.IntegerRedisMessagegetInteger(long value)ReturnsIntegerRedisMessagefor givenvalue.IntegerRedisMessagegetInteger(ByteBuf content)ReturnsIntegerRedisMessagefor givencontent.SimpleStringRedisMessagegetSimpleString(ByteBuf content)ReturnsSimpleStringRedisMessagefor givencontent.SimpleStringRedisMessagegetSimpleString(java.lang.String content)ReturnsSimpleStringRedisMessagefor 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 aFixedRedisMessagePoolinstance.
-
-
Method Detail
-
getSimpleString
public SimpleStringRedisMessage getSimpleString(java.lang.String content)
Description copied from interface:RedisMessagePool- Specified by:
getSimpleStringin interfaceRedisMessagePool
-
getSimpleString
public SimpleStringRedisMessage getSimpleString(ByteBuf content)
Description copied from interface:RedisMessagePool- Specified by:
getSimpleStringin interfaceRedisMessagePool
-
getError
public ErrorRedisMessage getError(java.lang.String content)
Description copied from interface:RedisMessagePool- Specified by:
getErrorin interfaceRedisMessagePool
-
getError
public ErrorRedisMessage getError(ByteBuf content)
Description copied from interface:RedisMessagePool- Specified by:
getErrorin interfaceRedisMessagePool
-
getInteger
public IntegerRedisMessage getInteger(long value)
Description copied from interface:RedisMessagePool- Specified by:
getIntegerin interfaceRedisMessagePool
-
getInteger
public IntegerRedisMessage getInteger(ByteBuf content)
Description copied from interface:RedisMessagePool- Specified by:
getIntegerin interfaceRedisMessagePool
-
getByteBufOfInteger
public byte[] getByteBufOfInteger(long value)
Description copied from interface:RedisMessagePoolReturnsbyte[]for givenmsg. Returnsnullit does not exist.- Specified by:
getByteBufOfIntegerin interfaceRedisMessagePool
-
-