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:
ChannelHandler, ChannelInboundHandler
Aggregates
RedisMessage parts into ArrayRedisMessage. This decoder
should be used together with RedisDecoder.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.RedisArrayAggregator(int maxElements, int maxNestedArrayDepth) Create a new instance that will aggregate anArrayHeaderRedisMessageand its subsequent elements into anArrayRedisMessage. -
Method Summary
Modifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.protected voiddecode(ChannelHandlerContext ctx, RedisMessage msg, List<Object> out) Decode from one message to an other.voidDo nothing by default, sub-classes may override this method.Methods inherited from class MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadCompleteModifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.voidchannelRead(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredModifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelRegistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelUnregistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelWritabilityChanged()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline.voiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableModifier and TypeMethodDescriptionprotected voidvoidDo nothing by default, sub-classes may override this method.booleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Constructor Details
-
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. This applies cumulatively.maxNestedArrayDepth- the maximum depth of the nested array before an exception will be thrown
-
-
Method Details
-
decode
protected void decode(ChannelHandlerContext ctx, RedisMessage msg, List<Object> out) throws Exception Description copied from class:MessageToMessageDecoderDecode from one message to an other. This method will be called for each written message that can be handled by this decoder.- Specified by:
decodein classMessageToMessageDecoder<RedisMessage>- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToMessageDecoderbelongs tomsg- the message to decode to an other oneout- theListto which decoded messages should be added- Throws:
Exception- is thrown if an error occurs
-
handlerRemoved
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceChannelHandler- Overrides:
handlerRemovedin classChannelHandlerAdapter- Throws:
Exception
-
channelInactive
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelInactivein interfaceChannelInboundHandler- Overrides:
channelInactivein classChannelInboundHandlerAdapter- Throws:
Exception
-
RedisArrayAggregator(int, int)instead to define a max size of the array to aggregate.