Class TransactionalComponentLifecycle<X>
- All Implemented Interfaces:
TransactionalComponent
- Direct Known Subclasses:
TransactionalComponentBase,TransactionalComponentByLock,TransInteger
TransactionalComponent.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal voidabort(Transaction transaction) Abort a transaction (undo the effect of a transaction)voidattach(SysTransState state) Set the current thread to be in the transaction.final voidbegin(Transaction transaction) Start a transactionfinal voidcommit(Transaction transaction) Commit a transaction (make durable).final voidcommitEnd(Transaction transaction) Signal all commits on all components are done and replay from the journal will not happen.final ByteBuffercommitPrepare(Transaction transaction) Commit a transaction (make durable): prepare - commit - cleanupfinal voidcomplete(Transaction transaction) Finalization - the coordinator will not mention the transaction again.final SysTransStatedetach()Detach this component from the transaction of the current thread and return some internal state that can be used in a future call ofTransactionalComponent.attach(SysTransState)abstract voidEnd of the recovery phaseEvery component instance must supplied a unique number.final booleanpromote(Transaction transaction) Promote a component in a transactionabstract voidrecover(ByteBuffer ref) Notification thatrefwas really committed and is being recovered.voidfinal voidshutdown()Shutdown component, aborting any in-progress transactions.abstract voidMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.dboe.transaction.txn.TransactionalComponent
cleanStart
-
Method Details
-
startRecovery
public abstract void startRecovery()- Specified by:
startRecoveryin interfaceTransactionalComponent
-
recover
Description copied from interface:TransactionalComponentNotification thatrefwas really committed and is being recovered.- Specified by:
recoverin interfaceTransactionalComponent- Parameters:
ref- Same bytes as were written during prepare originally.
-
finishRecovery
public abstract void finishRecovery()Description copied from interface:TransactionalComponentEnd of the recovery phase- Specified by:
finishRecoveryin interfaceTransactionalComponent
-
getComponentId
Description copied from interface:TransactionalComponentEvery component instance must supplied a unique number. It is used to route journal entries to subsystems, including across restarts/recovery. Uniqueness scope is within the sameTransactionCoordinator, and the same across restarts.If a component imposes the rule of one-per-
TransactionCoordinator, the same number can be used (if different from all other component type instances).If a component can have multiple instances per
TransactionCoordinator, for example indexes, each must have a unique instance id.- Specified by:
getComponentIdin interfaceTransactionalComponent
-
begin
Start a transaction- Specified by:
beginin interfaceTransactionalComponent
-
promote
Promote a component in a transaction- Specified by:
promotein interfaceTransactionalComponent
-
commitPrepare
Commit a transaction (make durable): prepare - commit - cleanup- Specified by:
commitPreparein interfaceTransactionalComponent
-
commit
Description copied from interface:TransactionalComponentCommit a transaction (make durable). The transaction will commit and not abort. Other components may not have committed yet and recovery may occur still causing replay of the commit step.- Specified by:
commitin interfaceTransactionalComponent
-
commitEnd
Description copied from interface:TransactionalComponentSignal all commits on all components are done and replay from the journal will not happen. The component can clear up now.- Specified by:
commitEndin interfaceTransactionalComponent
-
abort
Description copied from interface:TransactionalComponentAbort a transaction (undo the effect of a transaction)- Specified by:
abortin interfaceTransactionalComponent
-
complete
Description copied from interface:TransactionalComponentFinalization - the coordinator will not mention the transaction again.- Specified by:
completein interfaceTransactionalComponent
-
shutdown
public final void shutdown()Description copied from interface:TransactionalComponentShutdown component, aborting any in-progress transactions. This operation is not guaranteed to be called.- Specified by:
shutdownin interfaceTransactionalComponent
-
detach
Description copied from interface:TransactionalComponentDetach this component from the transaction of the current thread and return some internal state that can be used in a future call ofTransactionalComponent.attach(SysTransState)After this call, the component is not in a transaction but the existing transaction still exists. The thread may start a new transaction; that transaction is completely independent of the detached transaction.
Returns
nullif the current thread not in a transaction. The component may return null to indicate it has no state. The return system state should be used in a call toTransactionalComponent.attach(SysTransState)and the transaction ended in the usual way.- Specified by:
detachin interfaceTransactionalComponent
-
attach
Description copied from interface:TransactionalComponentSet the current thread to be in the transaction. ThesystemStatemust be obtained from a call ofTransactionalComponent.detach(). This method can only be called once persystemState.- Specified by:
attachin interfaceTransactionalComponent
-
getComponentState
-
setComponentState
-