Package org.apache.cassandra.net
Class FrameDecoderLZ4
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.apache.cassandra.net.FrameDecoder
-
- org.apache.cassandra.net.FrameDecoderLZ4
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public final class FrameDecoderLZ4 extends FrameDecoder
Framing format that compresses payloads with LZ4, and protects integrity of data in movement with CRCs (of both header and payload). Every on-wire frame contains: 1. Compressed length (17 bits) 2. Uncompressed length (17 bits) 3.isSelfContained
flag (1 bit) 4. Header padding (5 bits) 5. CRC24 of Header contents (24 bits) 6. Compressed Payload (up to 2 ^ 17 - 1 bits) 7. CRC32 of Compressed Payload (32 bits) 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Compressed Length | Uncompressed Length +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C| | CRC24 of Header | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | Compressed Payload | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CRC32 of Compressed Payload | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.net.FrameDecoder
FrameDecoder.CorruptFrame, FrameDecoder.Frame, FrameDecoder.FrameProcessor, FrameDecoder.IntactFrame
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.net.FrameDecoder
allocator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decode(java.util.Collection<FrameDecoder.Frame> into, ShareableBytes newBytes, int headerLength)
Decode a number of frames using the above abstract method implementations.static FrameDecoderLZ4
fast(BufferPoolAllocator allocator)
-
Methods inherited from class org.apache.cassandra.net.FrameDecoder
activate, channelInactive, channelRead, channelReadComplete, discard, handlerAdded, isActive, reactivate
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
fast
public static FrameDecoderLZ4 fast(BufferPoolAllocator allocator)
-
decode
@Inline protected void decode(java.util.Collection<FrameDecoder.Frame> into, ShareableBytes newBytes, int headerLength)
Decode a number of frames using the above abstract method implementations. It is expected for this method to be invoked by the implementing class'FrameDecoder.decode(Collection, ShareableBytes)
so that this implementation will be inlined, and all of the abstract method implementations will also be inlined.
-
-