|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStoreWriter
Represents a store writer.
This interface defines a store writer. Store writers durably write store objects and/or transactions to an abstract destination.
Method Summary | |
---|---|
void |
commit(boolean sync)
Commit the set of recorded operations. |
boolean |
isShared()
Indicates whether the writer is writing to a shared resource. |
void |
onRoleChange(IStoreBinding.Role role)
Invoked to notify of a change to the role of the using store binding. |
void |
recordPersisterMetadata(PktBuffer buffer)
Record a persister metadata This method is invoked by a store binding to record the persister's metadata. |
IStoreCommitQueue.IEntry |
recordPut(com.eaio.uuid.UUID id,
short ofid,
short otype,
IStoreObject object,
PktPacket serializedObject,
IStoreObject.EncodingType contentEncodingType,
PktBuffer serializedMetadata)
Record a put operation. |
IStoreCommitQueue.IEntry |
recordRemove(com.eaio.uuid.UUID id,
short ofid,
short otype,
IStoreObject object,
PktBuffer serializedMetadata,
long transactionId,
long stableTransactionId,
long checkpointVersion)
Record a remove operation. |
IStoreCommitQueue.IEntry |
recordSend(com.eaio.uuid.UUID id,
short ofid,
short otype,
IStoreObject object,
PktPacket serializedObject,
IStoreObject.EncodingType contentEncodingType,
PktBuffer serializedMetadata)
Record a send operation Note: The IStoreWriter will assume ownership of the serialized object and call PktPacket.dispose() once it is done writing
the object during commit. |
IStoreCommitQueue.IEntry |
recordUpdate(com.eaio.uuid.UUID id,
short ofid,
short otype,
IStoreObject object,
PktPacket serializedObject,
IStoreObject.EncodingType contentEncodingType,
PktBuffer serializedMetadata)
Record an update operation. |
void |
sync()
Sync any buffered operations to the write destination. |
Method Detail |
---|
boolean isShared()
This method returns whether the writer is accessing a shared resource between primary and backup cluster members. Shared writers are only opened on the primary cluster members while non-shared writers are opened concurrently on both. However, transactions are recorded and committed concurrently on both shared and non-shared writers.
void onRoleChange(IStoreBinding.Role role)
This method is invoked by a store binding to notify a writer of a a change in the binding's role.
void recordPersisterMetadata(PktBuffer buffer)
This method is invoked by a store binding to record the persister's metadata. The method is invoked by the primary and backup store binding during store commit.
Note: The IStoreWriter will must copy the metadata in the supplied buffer object before returning from this method.
buffer
- The buffer containing the serialized metadataIStoreCommitQueue.IEntry recordPut(com.eaio.uuid.UUID id, short ofid, short otype, IStoreObject object, PktPacket serializedObject, IStoreObject.EncodingType contentEncodingType, PktBuffer serializedMetadata)
This method is invoked by a store binding to record a put commit operation. The method is invoked by the primary and backup store binding during store commit.
Note: The IStoreWriter will assume ownership of the serialized
object and call PktPacket.dispose()
once it is done writing
the object during commit. If the caller to hold on to the PktPacket
it should call PktPacket.acquire()
prior to calling this method.
id
- The id of the put object.ofid
- The id of the object's factory.otype
- The put object's typeobject
- The put objectserializedObject
- The serialized form of the put object.contentEncodingType
- The object's content encoding type.serializedMetadata
- The serialized form of the put object's metadata.IStoreCommitQueue.IEntry recordUpdate(com.eaio.uuid.UUID id, short ofid, short otype, IStoreObject object, PktPacket serializedObject, IStoreObject.EncodingType contentEncodingType, PktBuffer serializedMetadata)
Note: The IStoreWriter will assume ownership of the serialized
object and call PktPacket.dispose()
once it is done writing
the object during commit. If the caller to hold on to the PktPacket
it should call PktPacket.acquire()
prior to calling this method.
id
- The id of the updated object.ofid
- The id of the object's factory.otype
- The updated object's typeobject
- The updated object.serializedObject
- The serialized form of the updated object.contentEncodingType
- The object's content encoding type.serializedMetadata
- The serialized form of the updated object's metadata.
IStoreCommitQueue.IEntry recordSend(com.eaio.uuid.UUID id, short ofid, short otype, IStoreObject object, PktPacket serializedObject, IStoreObject.EncodingType contentEncodingType, PktBuffer serializedMetadata)
Note: The IStoreWriter will assume ownership of the serialized
object and call PktPacket.dispose()
once it is done writing
the object during commit. If the caller to hold on to the PktPacket
it should call PktPacket.acquire()
prior to calling this method.
id
- The id of the sent object.ofid
- The id of the object's factory.otype
- The sent object's typeobject
- The sent object.serializedObject
- The serialized form of the sent object.contentEncodingType
- The object's content encoding type.serializedMetadata
- The serialized form of the sent object's metadata.
IStoreCommitQueue.IEntry recordRemove(com.eaio.uuid.UUID id, short ofid, short otype, IStoreObject object, PktBuffer serializedMetadata, long transactionId, long stableTransactionId, long checkpointVersion)
id
- The id of the removed object.ofid
- The id of the object's factory.otype
- The removed object's typeobject
- The removed object.serializedMetadata
- The serialized form of the sent object's metadata.transactionId
- The transaction id.stableTransactionId
- The stable transactionId.checkpointVersion
- The checkpoint version.
void commit(boolean sync)
sync
- Indicates whether the commit should cause the recorded
operations to be persisted and sync'd to the writer destination
before the method returns. See sync()
for a description of what
'sync' implies.This method is invoked by a store binding to commit the recorded operations. The method is invoked on a primary store binding when upon completion of the commit operation.
void sync()
This operation should cause any buffered operations to be flushed to the writer destination. This method must block and wait until all recorded operations invoked prior to this method are safely at the destination.
No record operations will be invoked concurrently with this method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |