@PrivateApi public final class Packet extends com.hazelcast.internal.serialization.impl.HeapData implements com.hazelcast.internal.networking.OutboundFrame
Modifier and Type | Class and Description |
---|---|
static class |
Packet.Type |
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_JET_FLOW_CONTROL
Marks a Jet packet as Flow control
|
static int |
FLAG_OP_CONTROL
Marks an Operation packet as Operation control (like invocation-heartbeats)
|
static int |
FLAG_OP_RESPONSE
Marks an Operation packet as Response
|
static int |
FLAG_URGENT
Marks the packet as Urgent
|
static byte |
VERSION |
Constructor and Description |
---|
Packet() |
Packet(byte[] payload) |
Packet(byte[] payload,
int partitionId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Connection |
getConn()
Gets the Connection this Packet was send with.
|
char |
getFlags() |
Packet.Type |
getPacketType() |
int |
getPartitionId()
Returns the partition ID of this packet.
|
int |
hashCode() |
boolean |
isFlagRaised(int flagsToCheck)
Returns
true if any of the flags supplied in the argument are set. |
boolean |
isUrgent()
Checks if this Frame is urgent.
|
int |
packetSize()
Returns an estimation of the packet, including its payload, in bytes.
|
Packet |
raiseFlags(int flagsToRaise)
Raises all the flags raised in the argument.
|
Packet |
resetFlagsTo(int flagsToSet)
Resets the entire
flags bitfield to the supplied value. |
Packet |
setConn(Connection conn)
Sets the Connection this Packet is send with.
|
Packet |
setPacketType(Packet.Type type)
Sets the packet type by updating the packet type bits in the
flags bitfield. |
String |
toString() |
public static final byte VERSION
public static final int FLAG_URGENT
public static final int FLAG_OP_RESPONSE
public static final int FLAG_OP_CONTROL
public static final int FLAG_JET_FLOW_CONTROL
public Packet()
public Packet(byte[] payload)
public Packet(byte[] payload, int partitionId)
public Connection getConn()
public Packet setConn(Connection conn)
conn
- the connection.this
(for fluent interface)public Packet.Type getPacketType()
public Packet setPacketType(Packet.Type type)
flags
bitfield. Other bits
are unaffected.type
- the type to setthis
(for fluent interface)public Packet raiseFlags(int flagsToRaise)
flagsToRaise
- the flags to raisethis
(for fluent interface)public Packet resetFlagsTo(int flagsToSet)
flags
bitfield to the supplied value. This also affects the packet type bits.flagsToSet
- the flags. Only the least significant two bytes of the argument are used.this
(for fluent interface)public boolean isFlagRaised(int flagsToCheck)
true
if any of the flags supplied in the argument are set.flagsToCheck
- the flags to checktrue
if any of the flags is set, false
otherwise.public char getFlags()
char
.public int getPartitionId()
public boolean isUrgent()
com.hazelcast.internal.networking.OutboundFrame
isUrgent
in interface com.hazelcast.internal.networking.OutboundFrame
public int packetSize()
public boolean equals(Object o)
equals
in class com.hazelcast.internal.serialization.impl.HeapData
public int hashCode()
hashCode
in class com.hazelcast.internal.serialization.impl.HeapData
public String toString()
toString
in class com.hazelcast.internal.serialization.impl.HeapData
Copyright © 2018 Hazelcast, Inc.. All rights reserved.