Package io.netty.handler.codec.redis
Class RedisArrayAggregator
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<RedisMessage>
-
- io.netty.handler.codec.redis.RedisArrayAggregator
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@UnstableApi public final class RedisArrayAggregator extends io.netty.handler.codec.MessageToMessageDecoder<RedisMessage>
AggregatesRedisMessageparts intoArrayRedisMessage. This decoder should be used together withRedisDecoder.
-
-
Constructor Summary
Constructors Constructor Description RedisArrayAggregator()Deprecated.UseRedisArrayAggregator(int, int)instead to define a max size of the array to aggregate.RedisArrayAggregator(int maxElements, int maxNestedArrayDepth)Create a new instance that will aggregate anArrayHeaderRedisMessageand its subsequent elements into anArrayRedisMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)protected voiddecode(io.netty.channel.ChannelHandlerContext ctx, RedisMessage msg, List<Object> out)voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx)-
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadComplete
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-
-
-
Constructor Detail
-
RedisArrayAggregator
@Deprecated public RedisArrayAggregator()
Deprecated.UseRedisArrayAggregator(int, int)instead to define a max size of the array to aggregate.Create a new instance that will aggregate anArrayHeaderRedisMessageand its subsequent elements into anArrayRedisMessage.This constructor specifies a maximum number of elements of 1.000.000, but this default can be increased with the "io.netty.handler.codec.redis.maxArrayLength" system property.
-
RedisArrayAggregator
public RedisArrayAggregator(int maxElements, int maxNestedArrayDepth)Create a new instance that will aggregate anArrayHeaderRedisMessageand its subsequent elements into anArrayRedisMessage.A
CodecExceptionwill be thrown if the array header specify a length greater than the given number of max elements.- Parameters:
maxElements- The maximum number of elements to aggregate in a single message.maxNestedArrayDepth- the maximum depth of the nested array before an exception will be thrown
-
-
Method Detail
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, RedisMessage msg, List<Object> out) throws Exception- Specified by:
decodein classio.netty.handler.codec.MessageToMessageDecoder<RedisMessage>- Throws:
Exception
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws Exception- Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
-