Package org.apache.cassandra.transport
Class Envelope
- java.lang.Object
-
- org.apache.cassandra.transport.Envelope
-
public class Envelope extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEnvelope.Compressorstatic classEnvelope.Decoderstatic classEnvelope.Decompressorstatic classEnvelope.Encoderstatic classEnvelope.Header
-
Field Summary
Fields Modifier and Type Field Description io.netty.buffer.ByteBufbodyEnvelope.Headerheaderstatic bytePROTOCOL_VERSION_MASK
-
Constructor Summary
Constructors Constructor Description Envelope(Envelope.Header header, io.netty.buffer.ByteBuf body)An on-wire message envelope consists of a header and a body.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Envelopeclone()static Envelopecreate(Message.Type type, int streamId, ProtocolVersion version, java.util.EnumSet<Envelope.Header.Flag> flags, io.netty.buffer.ByteBuf body)io.netty.buffer.ByteBufencodeHeader()voidencodeHeaderInto(java.nio.ByteBuffer buf)voidencodeInto(java.nio.ByteBuffer buf)booleanrelease()voidretain()Envelopewith(io.netty.buffer.ByteBuf newBody)
-
-
-
Field Detail
-
PROTOCOL_VERSION_MASK
public static final byte PROTOCOL_VERSION_MASK
- See Also:
- Constant Field Values
-
header
public final Envelope.Header header
-
body
public final io.netty.buffer.ByteBuf body
-
-
Constructor Detail
-
Envelope
public Envelope(Envelope.Header header, io.netty.buffer.ByteBuf body)
An on-wire message envelope consists of a header and a body. The header is defined the following way in native protocol version 3 and later: 0 8 16 24 32 40 +---------+---------+---------+---------+---------+ | version | flags | stream | opcode | +---------+---------+---------+---------+---------+ | length | +---------+---------+---------+---------+
-
-
Method Detail
-
retain
public void retain()
-
release
public boolean release()
-
clone
public Envelope clone()
- Overrides:
clonein classjava.lang.Object
-
create
public static Envelope create(Message.Type type, int streamId, ProtocolVersion version, java.util.EnumSet<Envelope.Header.Flag> flags, io.netty.buffer.ByteBuf body)
-
encodeHeader
public io.netty.buffer.ByteBuf encodeHeader()
-
encodeHeaderInto
public void encodeHeaderInto(java.nio.ByteBuffer buf)
-
encodeInto
public void encodeInto(java.nio.ByteBuffer buf)
-
with
public Envelope with(io.netty.buffer.ByteBuf newBody)
-
-