|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.ods.StoreObjectBase
public abstract class StoreObjectBase
A base class for store object implementations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreObject |
---|
IStoreObject.EncodingType |
Method Summary | |
---|---|
void |
acquire()
Implementation of IStoreObject.acquire() |
int |
dispose()
Default implementation of IStoreObject.dispose()
This is the default implementation of the dispose method. |
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. |
com.eaio.uuid.UUID |
getId()
Implementation of IStoreObject.getId() |
int |
getOwnershipCount()
Implementation of MessageView.getOwnershipCount() |
long |
getStableTransactionId()
Gets the transactionId considered stabilized by the application. |
long |
getTransactionId()
Get the application transaction id. |
com.neeve.util.UtlReferenceTracker |
referenceTracker()
Implementation of MessageView.getOwnershipCount() |
IStoreObject |
setBinding(IStoreBinding binding)
Set the store binding associated with an object. |
void |
setCheckpointVersion(long version)
Update checkpoint version of an object |
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 txnid)
Set the application transaction id. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.neeve.ods.IStoreObject |
---|
deserialize, deserializeMetadata, deserializeMetadata, getContentEncodingType, getOfid, getType, serialize, serializeMetadata, setFieldValue |
Method Detail |
---|
public final void setId(com.eaio.uuid.UUID id)
IStoreObject
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 IStoreObject.getId()
to be the same instance, just an equivalent one.
setId
in interface IStoreObject
public final com.eaio.uuid.UUID ensureId()
IStoreObject
IStoreObject.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 IStoreObject.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.
ensureId
in interface IStoreObject
public final com.eaio.uuid.UUID getId()
IStoreObject.getId()
getId
in interface IStoreObject
public final IStoreObject setTransactionId(long txnid)
IStoreObject
setTransactionId
in interface IStoreObject
txnid
- The transaction id to setpublic final long getTransactionId()
IStoreObject
getTransactionId
in interface IStoreObject
public final IStoreObject setStableTransactionId(long id)
IStoreObject
setStableTransactionId
in interface IStoreObject
id
- The stable transaction id to setpublic final long getStableTransactionId()
IStoreObject
getStableTransactionId
in interface IStoreObject
public final IStoreObject setBinding(IStoreBinding binding)
IStoreObject
setBinding
in interface IStoreObject
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.
public final IStoreBinding getBinding()
IStoreObject
getBinding
in interface IStoreObject
public final int getOwnershipCount()
MessageView.getOwnershipCount()
getOwnershipCount
in interface IStoreObject
public final void acquire()
IStoreObject.acquire()
acquire
in interface IStoreObject
public int dispose()
IStoreObject.dispose()
This is the default implementation of the dispose method. The implementation just decrements the ownership count. Implementations that implement view object pooling or other such functionality should override this method but invoke this method to decrement the object reference count.
dispose
in interface IStoreObject
public final com.neeve.util.UtlReferenceTracker referenceTracker()
MessageView.getOwnershipCount()
referenceTracker
in interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker
public final void setCheckpointVersion(long version)
IStoreObject
setCheckpointVersion
in interface IStoreObject
version
- The new checkpoint version.
Note: May only be called by an
{@link IStoreBinding} to update the checkpoint version
of the object.
public final long getCheckpointVersion()
IStoreObject
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.
getCheckpointVersion
in interface IStoreObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |