|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.ods.StoreBinding
public final class StoreBinding
A store binding implementation
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreBinding |
---|
IStoreBinding.InterClusterReplicationRole, IStoreBinding.Operation, IStoreBinding.Role, IStoreBinding.StartupExpectation, IStoreBinding.State |
Field Summary |
---|
Fields inherited from interface com.neeve.ods.IStoreBinding |
---|
CLOSE_ICR_AS_FAIL, NO_COMMIT_COMPLETIONS, SUPPRESS_COMPLETION_EVENT_DISPATCH_IF_SYNC_COMPLETION |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final IStoreBinding create(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, IStoreReplicatorNotificationHandler replicatorNotificationHandler, int flags) throws OdsException
OdsException
public static final IStoreBinding create(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, int flags) throws OdsException
OdsException
public final String getName()
IEventSource.getName()
getName
in interface IEventSource
public final void open() throws OdsException
IStoreBinding.open(java.util.Map>)
open
in interface IStoreBinding
OdsException
public final void open(Map<IStoreBinding.StartupExpectation,Enum<?>> expectations) throws OdsException
IStoreBinding.open(java.util.Map>)
open
in interface IStoreBinding
expectations
- The set of expectations to open the store with.
This method will throw an exception if any of the expectations specified
are not met.
OdsException
public final IStoreMember getMember()
IStoreBinding.getMember()
getMember
in interface IStoreBinding
public final StoreDescriptor getDescriptor()
IStoreBinding.getDescriptor()
getDescriptor
in interface IStoreBinding
public final IStoreEventHandler getEventHandler()
IStoreBinding.getEventHandler()
getEventHandler
in interface IStoreBinding
public final IStoreBinding.State getState()
IStoreBinding.getState()
getState
in interface IStoreBinding
public final IStoreBindingStats getStats()
IStoreBinding.getStats()
getStats
in interface IStoreBinding
public final IStoreBinding.Role getRole()
IStoreBinding.getRole()
getRole
in interface IStoreBinding
public final IStoreBinding.InterClusterReplicationRole getInterClusterReplicationRole()
IStoreBinding.getInterClusterReplicationRole()
getInterClusterReplicationRole
in interface IStoreBinding
public final int getMemberCount()
IStoreBinding.getMemberCount()
getMemberCount
in interface IStoreBinding
public final boolean isPersistenceQuorumMet()
IStoreBinding.isPersistenceQuorumMet()
isPersistenceQuorumMet
in interface IStoreBinding
public final IStorePersister getPersister()
IStoreBinding.getPersister()
getPersister
in interface IStoreBinding
public final IStoreSender getICRSender()
IStoreBinding.getICRSender()
getICRSender
in interface IStoreBinding
public final IStoreTransactionLog getTransactionLog()
IStoreBinding.getTransactionLog()
getTransactionLog
in interface IStoreBinding
public final IStoreQueryEngine getQueryEngine()
IStoreBinding.getQueryEngine()
getQueryEngine
in interface IStoreBinding
public final IStoreQueryRepository asQueryRepository()
IStoreBinding.asQueryRepository()
asQueryRepository
in interface IStoreBinding
IStoreQueryRepository
for this engine or null, if it is not configured for query.public final IStoreCommitCompletionEvent createCommitCompletionEvent()
IStoreBinding.createCommitCompletionEvent()
createCommitCompletionEvent
in interface IStoreBinding
public final int sizeUnprotected()
IStoreBinding.sizeUnprotected()
sizeUnprotected
in interface IStoreBinding
public final int size()
IStoreBinding.size()
size
in interface IStoreBinding
public final void processMemberControlEvent(IStoreMemberControlEvent event)
IStoreBinding.processMemberControlEvent(com.neeve.ods.IStoreMemberControlEvent)
processMemberControlEvent
in interface IStoreBinding
event
- The event to process
This method should be invoked in response when the following events are
received from the store binding.
- IStoreMemberFoundEvent
- IStoreMemberConnectEvent
- IStoreMemberHandshakeStartReadyEvent
- IStoreMemberHandshakePrimaryHelloEvent
- IStoreMemberHandshakeBackupHelloEvent
- IStoreMemberInitReadyEvent
- IStoreMemberLostEvent
The method should be invoked serialized with the invocation of other binding
'action' methods. Users of the StoreBinding
do not have to invoke this
method since the StoreBinding
automatically invokes this method. This
method only needs to be invoked by users who want to control the scheduling of
the above event with other user events.
public final <T> void recordFieldUpdate(IStoreObject object, IStoreField<T> field, T oldValue, T newValue)
IStoreBinding.recordFieldUpdate(com.neeve.ods.IStoreObject, com.neeve.ods.IStoreField, T, T)
recordFieldUpdate
in interface IStoreBinding
object
- The object being updated.field
- The field that can be used to access the field value. If the
field is not supplied it will not be indexed even if the store supports indexing.oldValue
- The old field value.newValue
- The new field value.public final IStoreBinding put(IStoreObject object)
IStoreBinding.put(com.neeve.ods.IStoreObject)
put
in interface IStoreBinding
object
- The object to be added to the store.
public final IStoreBinding send(IStoreObject object)
IStoreBinding.send(com.neeve.ods.IStoreObject)
send
in interface IStoreBinding
object
- The object sent via the store.
public final IStoreObject get(com.eaio.uuid.UUID id)
IStoreBinding.get(com.eaio.uuid.UUID)
get
in interface IStoreBinding
id
- The object's idpublic final IStoreBinding remove(IStoreObject object)
IStoreBinding.remove(com.neeve.ods.IStoreObject)
remove
in interface IStoreBinding
public final IStoreCommitCompletionEvent commit(long transactionId, long stableTransactionId, IStoreObject[] messages, int messageCount, IStoreCommitCompletionEvent completionEvent, int flags) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)
commit
in interface IStoreBinding
transactionId
- A user supplied transaction id that will be
set in each of the objects committed by this method. This id is
not interpreted by ODS. It is only accepted here to set in objects
in the transaction to tie the objects committed by the store with
other objects in the same transaction.stableTransactionId
- A user supplied stable transaction id
that will be set in each of the objects committed by this method.
This id is not interpreted by ODS. It is only accepted here to set
in objects in the transaction to tie the objects committed by the
store with other objects in the same transaction.completionEvent
- The completion event that will be used to
communicate the completion of and replication status for the commit
operation. A value of null indicates the caller is not interested
in the results of the commit operation.flags
- Flags that qualify the commit operation. The following
flags are permitted for use:IStoreBinding.SUPPRESS_COMPLETION_EVENT_DISPATCH_IF_SYNC_COMPLETION
OdsException
- Thrown if and only if an error is encountered before
the replication phse of the the commit process. In such as case, it is
guaranteed that the state of the store and transaction log is restored
to pre-commit state before the exception is thrown.
This method commits all changes made to a store via a binding using the
calling thread since the last commit. The commit operation essentially
consists of replicating changes recorded in a store's transaction log to
other (backup) store members. When invoked, this method first prepares
for the replication process. Any failure in this pre-replication phase
is reported to the user via an exception thrown by this method. If the
replication preparation completes successfully, the commit kicks off
the replication and returns to the caller. Any failure in the replication
is now reported to the user via the commit completion event object
supplied to this method (the user should not modify the completion event
until the commit has completed). Upon completion of the replication, the
ODS runtime sets a commit completion status in the completion event
(see IStoreCommitCompletionStatus
) and notifies the user of the
completion. The notification is performed using the the notification
mode set by the user in the completion event object.
This method can be only be invoked on a binding in the open state.
This method cannot be invoked from within an event handler. Doing so can result in a deadlock.
public final IStoreCommitCompletionEvent commit(long transactionId, long stableTransactionId, IStoreCommitCompletionEvent completionEvent, int flags) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)
commit
in interface IStoreBinding
OdsException
public final IStoreCommitCompletionEvent commit(IStoreCommitCompletionEvent completionEvent) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)
commit
in interface IStoreBinding
OdsException
public final int createSavepoint()
IStoreBinding
A savepoint serves as a delimiter that can used to partially rollback a transaction.
A subsequent call to IStoreBinding.rollback(int)
with the returned savepoint version will
roll the transaction back to the state at the time of this call.
createSavepoint
in interface IStoreBinding
public final int getLastSavepoint()
IStoreBinding
Returns the savepoint version created by the last call to IStoreBinding.createSavepoint()
or the transaction's initial savepoint (0) if no savepoint has been created.
getLastSavepoint
in interface IStoreBinding
public final IStoreBinding rollback()
IStoreBinding.rollback()
rollback
in interface IStoreBinding
public final IStoreBinding rollback(int savepoint)
IStoreBinding.rollback()
rollback
in interface IStoreBinding
savepoint
- The savepoint to roll back to.
IStoreBinding.createSavepoint()
public final void fail(Exception e)
IStoreBinding.fail(java.lang.Exception)
fail
in interface IStoreBinding
e
- The exception that describes the failures. This exception
object will be attached to the binding failed event dispatched to
the user as a consequence of this method.public final void close(int flags)
IStoreBinding.close(int)
close
in interface IStoreBinding
flags
- Flags that qualify the close operation. The following
are the permissible flags that can be used with this method:IStoreBinding.NO_COMMIT_COMPLETIONS
- IStoreBinding.CLOSE_ICR_AS_FAIL
public final IStoreBinding getUnderlyingBinding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |