public final class PktSubheaderODS extends PktSubheaderVariable
This class is the subheader used by ODS store binding to hold serialized control information for store objects.
| Modifier and Type | Field and Description |
|---|---|
static short |
ENTRY_TYPE_MESSAGE
Specifies that the entry is for a message
|
static short |
ENTRY_TYPE_PUT
Specifies that the entry is for a put
|
static short |
ENTRY_TYPE_REMOVE
Specifies that the entry is for a remove
|
static short |
ENTRY_TYPE_SEND
Specifies that the entry is for a send
|
static short |
ENTRY_TYPE_UPDATE
Specifies that the entry is for an update
|
static int |
FLAG_COMMIT_ACK_REQUIRED
Specifies that a commit ack needs to be sent back
|
static int |
FLAG_COMMIT_END
Specifies the end of a commit batch
|
static int |
FLAG_COMMIT_ENTRY_IN_INIT
Specifies that the commit entry is part of an init
|
static int |
FLAG_COMMIT_ENTRY_IS_PUT
Specifies that the commit entry is for a put
|
static int |
FLAG_COMMIT_ENTRY_IS_REMOVE
Specifies that the commit entry is for a remove
|
static int |
FLAG_COMMIT_ENTRY_IS_SEND
Specifies that the commit entry is for a send
|
static int |
FLAG_COMMIT_ENTRY_IS_UPDATE
Specifies that the commit entry is for an update
|
static int |
FLAG_COMMIT_START
Specifies the beginning of a commit batch
|
static byte |
V1 |
static byte |
V2 |
static byte |
VERSION |
PREAMBLE_LENGTH, PREAMBLE_LENGTH_V1count, head, next, prev| Modifier and Type | Method and Description |
|---|---|
static int |
calcSerializedLength(ByteBuffer buffer,
int offset)
Calculate serialized length of a serialized ODS subheader
|
static int |
calcSerializedLength(IOBuffer buffer,
int offset)
Calculate serialized length of a serialized ODS subheader
|
static int |
calcSerializedLength(long addr,
int offset)
Calculate serialized length of a serialized ODS subheader
|
void |
copyObjectMetadataFrom(IOElasticBuffer metadata)
Copy the object metadata (V1 Subheader Field) from an elastic IO buffer.
|
void |
copyObjectMetadataTo(IOElasticBuffer buffer,
int offset)
Copy the object metadata (V1 Subheader Field) to a elastic IO buffer.
|
void |
copyPersisterMetadataFrom(IOElasticBuffer metadata)
Copy the persister metadata (V2 Subheader Field) from an elastic IO buffer.
|
void |
copyPersisterMetadataTo(IOElasticBuffer buffer,
int offset)
Copy the persister metadata (V2 Subheader Field) to a elastic IO buffer.
|
static PktBody |
create()
Create a default ODS subheader with the latest version
|
static PktBody |
create(Properties props)
Create a latest version ODS subheader qualified by a property set
|
static PktBody |
create(short version)
Creates a ODS subheader of a specific version
|
int |
doGetInitialBufferLength()
Invoked to fetch the initial buffer length of the body for packet bodies
The default implementation of this method invokes
PktBody.doGetSerializedLength(). |
int |
doGetSerializedLength()
Invoked to fetch the serialized length of the body
|
long |
getCheckpointVersion()
Get the checkpoint version (V1 Subheader Field).
|
static long |
getCheckpointVersion(long addr,
int offset)
Get the checkpoint version (V1 Subheader Field).
|
short |
getCommitEntryType()
Get the commit entry type (V1 Subheader Field).
|
static short |
getCommitEntryType(long addr,
int offset)
Get the commit entry type (V1 Subheader Field).
|
short |
getContentEncodingType()
Get the contentEncodingType type(V1 Subheader Field).
|
static short |
getContentEncodingType(long addr,
int offset)
Get the content encoding type (V1 Subheader Field).
|
boolean |
getFlagCommitAckRequired()
Get the 'commit ack required' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEnd()
Get the 'commit end' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEntryInInit()
Get the 'commit entry in INIT' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEntryIsPut()
Get the 'commit entry is PUT' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEntryIsRemove()
Get the 'commit entry is REMOVE' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEntryIsSend()
Get the 'commit entry is SEND' flag (V1 Subheader Field).
|
boolean |
getFlagCommitEntryIsUpdate()
Get the 'commit entry is UPDATE' flag (V1 Subheader Field).
|
boolean |
getFlagCommitStart()
Get the 'commit start' flag (V1 Subheader Field).
|
int |
getFlags()
Get the flags (V1 Subheader Field).
|
static int |
getFlags(long addr,
int offset)
Get the flags (V1 Subheader Field).
|
static short |
getLatestSubheaderVersion()
Get the latest subheader version.
|
short |
getObjectFactoryId()
Get the object factory id (V1 Subheader Field).
|
static short |
getObjectFactoryId(long addr,
int offset)
Get the object factory id (V1 Subheader Field).
|
com.eaio.uuid.UUID |
getObjectId()
Get the object id (V1 Subheader Field).
|
int |
getObjectMetadataLength()
Get the object metadata length (V1 Subheader Field).
|
int |
getObjectMetadataOffset()
Get the object metadata offset into the backing buffer (V1 Subheader Field).
|
short |
getObjectType()
Get the object type (V1 Subheader Field).
|
static short |
getObjectType(long addr,
int offset)
Get the object type (V1 Subheader Field).
|
int |
getPersisterMetadataLength()
Get the persister metadata length (V2 Subheader Field).
|
int |
getPersisterMetadataOffset()
Get the persister metadata offset into the backing buffer (V1 Subheader Field).
|
int |
getSerializedLength(ByteBuffer buffer,
int offset)
Get the serialized length from the serialized form
|
int |
getSerializedLength(IOBuffer buffer,
int offset)
Get the serialized length from the serialized form
|
int |
getSerializedLength(long addr,
int offset)
Get the serialized length from the serialized form
|
long |
getStableTransactionId()
Get the stable transactionId (V1 Subheader Field).
|
static long |
getStableTransactionId(long addr,
int offset)
Get the stable transaction id (V1 Subheader Field).
|
short |
getSubheaderVersion()
Get the header format version (V1 Subheader Field).
|
long |
getTimestamp()
Get the persist timestamp (V1 Subheader Field).
|
long |
getTransactionId()
Get the transactionId (V1 Subheader Field).
|
static long |
getTransactionId(long addr,
int offset)
Get the transactionId (V1 Subheader Field).
|
boolean |
hasPersisterMetadata()
Get whether the subheader has persister metadata (V2 Subheader Field).
|
void |
initializeBuffer()
Implementation of
IOElasticBuffer.Initializer.initializeBuffer()
The default implementation of this method is no-op. |
static void |
prepare(PktPacket packet,
com.eaio.uuid.UUID objectId,
short ofid,
short otype,
short contentEncodingType,
long transactionId,
long stableTransactionId,
long checkpointVersion,
long timestamp,
byte flags)
Prepare a packet with an ODS subheader with latest version.
|
void |
setCheckpointVersion(long checkpointVersion)
Set the checkpoint version (V1 Subheader Field).
|
static void |
setCheckpointVersion(long addr,
int offset,
long val)
Set the checkpoint version (V1 Subheader Field).
|
void |
setCommitEntryType(short entryType)
Set the commit entry type (V1 Subheader Field).
|
void |
setContentEncodingType(short contentEncodingType)
Set the contentEncodingType type (V1 Subheader Field).
|
void |
setFlagCommitAckRequired(boolean val)
Set the 'commit ack required' flag
|
void |
setFlagCommitEnd(boolean val)
Set the 'commit end' flag (V1 Subheader Field).
|
void |
setFlagCommitEntryInInit(boolean val)
Set the 'commit entry in INIT' flag
|
void |
setFlagCommitEntryIsPut(boolean val)
Set the 'commit entry is PUT' flag
|
void |
setFlagCommitEntryIsRemove(boolean val)
Set the 'commit entry is REMOVE' flag
|
void |
setFlagCommitEntryIsSend(boolean val)
Set the 'commit entry is SEND' flag
|
void |
setFlagCommitEntryIsUpdate(boolean val)
Set the 'commit entry is UPDATE' flag
|
void |
setFlagCommitStart(boolean val)
Set the 'commit start' flag
|
void |
setFlags(byte flags)
Set the flags (V1 Subheader Field).
|
static void |
setFlags(long addr,
int offset,
byte val)
Set the flags (V1 Subheader Field).
|
void |
setObjectFactoryId(short ofid)
Set the object factory id (V1 Subheader Field).
|
void |
setObjectId(com.eaio.uuid.UUID objectId)
Set the object id (V1 Subheader Field).
|
void |
setObjectMetadataLengthUnsafe(short val)
Set the object metadata length (V1 Subheader Field)
|
void |
setObjectType(short otype)
Set the object type (V1 Subheader Field).
|
void |
setStableTransactionId(long stableTransactionId)
Set the stable transaction id (V1 Subheader Field).
|
static void |
setStableTransactionId(long addr,
int offset,
long val)
Set the stable transaction id (V1 Subheader Field).
|
void |
setTimestamp(long timestamp)
Set the persist timestamp (V1 Subheader Field).
|
void |
setTransactionId(long transactionId)
Set the transaction id (V1 Subheader Field).
|
static void |
setTransactionId(long addr,
int offset,
long val)
Set the transactionId (V1 Subheader Field).
|
String |
toString()
Returns a string representation of the object
|
getType, getType, getTypedeserialize, deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, desync, dump, getBuffer, getInitialBufferLength, getSerializedLength, getTo, getTo, getTo, getTo, getTo, getTo, getTo, getType, putFrom, putFrom, putFrom, putFrom, putFrom, putFrom, putFrom, putFrom, reset, reset, serialize, serialize, serialize, serialize, serialize, serialize, sync, syncfcount, insertAfter, insertBefore, isLinked, next, previous, unlink, wipepublic static final byte V1
public static final byte V2
public static final byte VERSION
public static final int FLAG_COMMIT_START
public static final int FLAG_COMMIT_END
public static final int FLAG_COMMIT_ACK_REQUIRED
public static final int FLAG_COMMIT_ENTRY_IS_PUT
public static final int FLAG_COMMIT_ENTRY_IS_UPDATE
public static final int FLAG_COMMIT_ENTRY_IS_REMOVE
public static final int FLAG_COMMIT_ENTRY_IS_SEND
public static final int FLAG_COMMIT_ENTRY_IN_INIT
public static final short ENTRY_TYPE_PUT
public static final short ENTRY_TYPE_UPDATE
public static final short ENTRY_TYPE_REMOVE
public static final short ENTRY_TYPE_SEND
public static final short ENTRY_TYPE_MESSAGE
public static PktBody create(Properties props)
props - The property set to use to qualify creation of the body.public static PktBody create()
public static PktBody create(short version)
public static void prepare(PktPacket packet, com.eaio.uuid.UUID objectId, short ofid, short otype, short contentEncodingType, long transactionId, long stableTransactionId, long checkpointVersion, long timestamp, byte flags)
packet - The packet to prepare.objectId - The object id to set.ofid - The object's factory id.otype - The object's type.contentEncodingType - The encoding type to set.transactionId - The current transaction id.stableTransactionId - The stable transaction id.checkpointVersion - The checkpoint version.flags - The flags to set.public static final short getLatestSubheaderVersion()
This method returns the latest subheader version i.e. the version used when subheaders are created explicitly i.e. not through deserialization
public static final int calcSerializedLength(ByteBuffer buffer, int offset)
public static final int calcSerializedLength(IOBuffer buffer, int offset)
public static final int calcSerializedLength(long addr,
int offset)
public final int doGetSerializedLength()
PktBodypublic final int getSerializedLength(ByteBuffer buffer, int offset)
PktSubheadergetSerializedLength in class PktSubheaderpublic final int getSerializedLength(IOBuffer buffer, int offset)
PktSubheadergetSerializedLength in class PktSubheaderpublic final int getSerializedLength(long addr,
int offset)
PktSubheadergetSerializedLength in class PktSubheaderpublic final int doGetInitialBufferLength()
PktBody
The default implementation of this method invokes PktBody.doGetSerializedLength(). The
concrete body implementation should override this method in case it has a better
estimate for the initial length of the backing buffer or if the doGetSerializedLength
implementation uses the backing buffer to calculate serialized length (which is
illegal per the IOElasticBuffer contract).
public final short getSubheaderVersion()
public final void setObjectId(com.eaio.uuid.UUID objectId)
objectId - The object id to set.public final com.eaio.uuid.UUID getObjectId()
NOTE:
If the packet that this header belongs to is pooled, the validity of the
returned UUID is only valid while the packet remains, undisposed.
Once the object is returned to its pool the UUID may be wiped and reused.
Consequently, callers that plan to use the returned id beyond this objects
lifespan should either make a copy of it, or aquire this object to prevent
it from be returned to its pool.
public static final short getObjectFactoryId(long addr,
int offset)
public final void setObjectFactoryId(short ofid)
ofid - The object factory id to set.public final short getObjectFactoryId()
public static final short getObjectType(long addr,
int offset)
public final void setObjectType(short otype)
otype - The object type to set.public final short getObjectType()
public static final short getContentEncodingType(long addr,
int offset)
public final void setContentEncodingType(short contentEncodingType)
contentEncodingType - The encoding type to set.public final short getContentEncodingType()
public final void setTimestamp(long timestamp)
timestamp - The timestamp to set.public final long getTimestamp()
public static final short getCommitEntryType(long addr,
int offset)
public final void setCommitEntryType(short entryType)
entryType - The commit entry type to set.public final short getCommitEntryType()
public static final void setTransactionId(long addr,
int offset,
long val)
public static final long getTransactionId(long addr,
int offset)
public final void setTransactionId(long transactionId)
transactionId - The transaction id to set.public final long getTransactionId()
public static final void setStableTransactionId(long addr,
int offset,
long val)
public static final long getStableTransactionId(long addr,
int offset)
public final void setStableTransactionId(long stableTransactionId)
stableTransactionId - The stable transaction id to set.public final long getStableTransactionId()
public static final void setCheckpointVersion(long addr,
int offset,
long val)
public static final long getCheckpointVersion(long addr,
int offset)
public final void setCheckpointVersion(long checkpointVersion)
checkpointVersion - The checkpointVersion to set.public final long getCheckpointVersion()
public static final void setFlags(long addr,
int offset,
byte val)
public static final int getFlags(long addr,
int offset)
public final void setFlags(byte flags)
flags - The flags to set.public final int getFlags()
public final void setFlagCommitStart(boolean val)
public final boolean getFlagCommitStart()
public final void setFlagCommitEnd(boolean val)
public final boolean getFlagCommitEnd()
public final void setFlagCommitAckRequired(boolean val)
public final boolean getFlagCommitAckRequired()
public final void setFlagCommitEntryIsPut(boolean val)
public final boolean getFlagCommitEntryIsPut()
public final void setFlagCommitEntryIsUpdate(boolean val)
public final boolean getFlagCommitEntryIsUpdate()
public final void setFlagCommitEntryIsRemove(boolean val)
public final boolean getFlagCommitEntryIsRemove()
public final void setFlagCommitEntryIsSend(boolean val)
public final boolean getFlagCommitEntryIsSend()
public final void setFlagCommitEntryInInit(boolean val)
public final boolean getFlagCommitEntryInInit()
public final void setObjectMetadataLengthUnsafe(short val)
NOTE: THIS METHOD IS MARKED AS UNSAFE SINCE IT IS UNSAFE TO SET THE OBJECT METADATA LENGTH INDEPENDENTLY OF COPYING THE SERIALIZED METADATA.
NOTE: THIS METHOD IS INTENDED INTERNAL USE BY THE PLATFORM.
public final int getObjectMetadataLength()
public final int getObjectMetadataOffset()
This method returns the offset into the subheader's backing buffer (obtained
via PktBody.getBuffer() where the object metadata field is serialized.
public final void copyObjectMetadataFrom(IOElasticBuffer metadata)
public final void copyObjectMetadataTo(IOElasticBuffer buffer, int offset)
public final boolean hasPersisterMetadata()
Note that this method does not return whether the subheader has persister metadata or not. It only returns whether the header version supports persister metadata
public final int getPersisterMetadataOffset()
This method returns the offset into the subheader's backing buffer (obtained
via PktBody.getBuffer() where the persister metadata field is serialized.
IllegalStateException - if the subheader version is not already 2. The
caller should only invoke this method if hasPersisterMetadata() returns
truepublic final int getPersisterMetadataLength()
IllegalStateException - if the subheader version is not already 2. The
caller should only invoke this method if hasPersisterMetadata() returns
truepublic final void copyPersisterMetadataFrom(IOElasticBuffer metadata)
buffer - The buffer to copy the persister metadata fromIllegalStateException - if the subheader version is not already 2. The
caller should only invoke this method if hasPersisterMetadata() returns
truepublic final void copyPersisterMetadataTo(IOElasticBuffer buffer, int offset)
buffer - The buffer to copy the persister metadata tooffset - The offset into the elastic IO buffer to copy the metadata to.IllegalStateException - if the subheader version is not already 2. The
caller should only invoke this method if hasPersisterMetadata() returns
truepublic final void initializeBuffer()
PktBodyIOElasticBuffer.Initializer.initializeBuffer()
The default implementation of this method is no-op. The concrete body implementation should override and implement this method if it needs to do buffer initialization.
initializeBuffer in interface IOElasticBuffer.InitializerinitializeBuffer in class PktBodyCopyright © 2019 N5 Technologies, Inc. All Rights Reserved.