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
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.IntactFrameNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields inherited from class org.apache.cassandra.net.FrameDecoder
allocator -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecode(Collection<FrameDecoder.Frame> into, ShareableBytes newBytes, int headerLength) Decode a number of frames using the above abstract method implementations.static FrameDecoderLZ4fast(BufferPoolAllocator allocator) Methods inherited from class org.apache.cassandra.net.FrameDecoder
activate, channelInactive, channelRead, channelReadComplete, discard, handlerAdded, isActive, reactivateMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Method Details
-
fast
-