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 class
Envelope.Compressor
static class
Envelope.Decoder
static class
Envelope.Decompressor
static class
Envelope.Encoder
static class
Envelope.Header
-
Field Summary
Fields Modifier and Type Field Description io.netty.buffer.ByteBuf
body
Envelope.Header
header
static byte
PROTOCOL_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 Envelope
clone()
static Envelope
create(Message.Type type, int streamId, ProtocolVersion version, java.util.EnumSet<Envelope.Header.Flag> flags, io.netty.buffer.ByteBuf body)
io.netty.buffer.ByteBuf
encodeHeader()
void
encodeHeaderInto(java.nio.ByteBuffer buf)
void
encodeInto(java.nio.ByteBuffer buf)
boolean
release()
void
retain()
Envelope
with(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:
clone
in 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)
-
-