|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStoreObject
Represents an ODS store object.
This interface defines the behavior of objects stored in ODSstores. An object can be stored in an ODS store if and only if it implements this interface.
Nested Class Summary | |
---|---|
static class |
IStoreObject.EncodingType
Defines the various supported encoding types. |
Method Summary | |
---|---|
void |
acquire()
Increase a store object's ownership count. |
IStoreObject |
deserialize(PktPacket serializedObject)
Deserialize an object's data. |
IStoreObject |
deserializeMetadata(PktBuffer metadata)
Deserialize an object's metadata from its serialized form. |
IStoreObject |
deserializeMetadata(PktBuffer metadata,
boolean copyDeserialize)
Deserialize an object's metadata from its serialized form. |
int |
dispose()
Dispose a store object. |
com.eaio.uuid.UUID |
ensureId()
Instructs the object to generate a UUID if not already generated. |
IStoreBinding |
getBinding()
Get the store binding associated with an object. |
long |
getCheckpointVersion()
Get an object's checkpoint version. |
IStoreObject.EncodingType |
getContentEncodingType()
Get an object's content data encoding type. |
com.eaio.uuid.UUID |
getId()
Get an object's id. |
boolean |
getIsReadOnly()
Get whether a object is read only |
short |
getOfid()
Get an object's factory id |
int |
getOwnershipCount()
Get a store object's ownership count. |
int |
getSerializedMetadataLength()
Get the length of an object's serialized metadata length |
long |
getStableTransactionId()
Gets the transactionId considered stabilized by the application. |
long |
getTransactionId()
Get the application transaction id. |
short |
getType()
Get the object type. |
PktPacket |
serialize()
Serialize an object's data. |
int |
serializeMetadata(com.neeve.io.IOElasticBuffer buffer,
int offset)
Serialize an object's metadata. |
IStoreObject |
setBinding(IStoreBinding binding)
Set the store binding associated with an object. |
void |
setCheckpointVersion(long version)
Update checkpoint version of an object |
IStoreObject |
setFieldValue(int id,
Object val)
Set the value of an object field. |
void |
setId(com.eaio.uuid.UUID id)
Set an object'd id. |
IStoreObject |
setStableTransactionId(long id)
Set the the transactionId considered stabilized by the application. |
IStoreObject |
setTransactionId(long id)
Set the application transaction id. |
Methods inherited from interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker |
---|
referenceTracker |
Method Detail |
---|
void setId(com.eaio.uuid.UUID id)
Note: This method may copy the uuid into a preallocated uuid
instance in the interest of reducing garbage collection, so the caller
should not rely on the instance subsequently returned from getId()
to be the same instance, just an equivalent one.
IllegalStateException
- If the node already has an id set.com.eaio.uuid.UUID ensureId()
getId()
must
return a non null value;
NOTE:
If this object is pooled, the validity of the returned UUID
is only
valid while the object remains undisposed (see dispose()
. 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.
com.eaio.uuid.UUID getId()
NOTE:
If this object is pooled, the validity of the returned UUID
is only
valid while the object 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.
Each ODS store object is universally identified by a UUID. This method returns an object's id.
short getOfid()
This method returns the id of the factory used to instantiate the object.
short getType()
An object type uniquely identifies the object within its factory.
boolean getIsReadOnly()
IStoreObject setTransactionId(long id)
id
- The transaction id to setlong getTransactionId()
IStoreObject setStableTransactionId(long id)
id
- The stable transaction id to setlong getStableTransactionId()
void setCheckpointVersion(long version)
version
- The new checkpoint version.
Note: May only be called by an
{@link IStoreBinding} to update the checkpoint version
of the object.
long getCheckpointVersion()
When an IStoreObject
is added to a store or mutated its
checkpoint modification counter is set to its IStoreBinding
's
next checkpoint number. This field can be used to perform 'change data
capture' or CDC on stores that are checkpointed to see if a node has
changed since a given store checkpoint.
When an object is removed for a store the store must set the checkpoint version of the object back to -1.
IStoreObject setBinding(IStoreBinding binding)
An object can be stored by one and only one store binding at any point in time. This method sets the binding associated with an object. The binding invokes this method when an object is put and removed from the store.
IStoreBinding getBinding()
IStoreObject setFieldValue(int id, Object val)
This method is invoked during the rollback process to restore field values.
IStoreObject.EncodingType getContentEncodingType()
int getSerializedMetadataLength()
int serializeMetadata(com.neeve.io.IOElasticBuffer buffer, int offset)
buffer
- The buffer to serialize the metadata tooffset
- The offset within the buffer to serialize the metadata to.
This method is invoked during the commit process to serialize an object's metadata.
PktPacket serialize()
This method is invoked during the commit process to serialize an object for replication and/or persistence and/or ICR send.
IStoreObject deserializeMetadata(PktBuffer metadata)
metadata
- The metadata in serialized form.
IStoreObject deserializeMetadata(PktBuffer metadata, boolean copyDeserialize)
metadata
- The metadata in serialized form.copyDeserialize
- Whether the deserialization process should
copy fields out of the serialized form into private members. A
value of false could result in the metadata object holding onto
the IOBuffer underlying the supplied metadata beyond the scope
of this call.
IStoreObject deserialize(PktPacket serializedObject)
serializedObject
- The object in serialized form.
void acquire()
An object's ownership count starts at 1.
int getOwnershipCount()
int dispose()
This method should be invoked by the user when done with a store object. This allows the object implementation to track the lifetime of an object allow it to potentially implement faclities (such as object pooling) to improve performance. It is guaranteed however that not invoking this method will still cause the system to run correctly and in a stable fashion. However, in such a case, the performance may not be optimal.
Once disposed, all references to the disposed object should be discarded.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |