Interface IMultiVersionIntegerArray
- All Superinterfaces:
IDroppableComponent,IMultiVersion,IMultiVersionOperations,ITransactionalMultiVersion
- All Known Implementing Classes:
MultiVersionIntegerArray
- Author:
- ActiveViam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionCommits the pending transient state at the specified epoch.destroy()Frees all resources held by this data structure.voiddrop()Notifies the component that it has been definitively dropped.Retrieves the latest (i.e.Returns the current transaction.
The result is nevernullcontrary toITransactionalMultiVersion.getTransaction().Returns the current transaction.booleanReturns whether this array is transient.voidSets the discardprocedure.Methods inherited from interface com.qfs.multiversion.ITransactionalMultiVersion
rollback
-
Method Details
-
getMostRecentVersion
ISquashableIntegerArrayVersion getMostRecentVersion()Description copied from interface:IMultiVersionRetrieves the latest (i.e. current) version of the object.- Specified by:
getMostRecentVersionin interfaceIMultiVersion- Returns:
- the latest version of the object
-
commit
Description copied from interface:IMultiVersionOperationsCommits the pending transient state at the specified epoch.This automatically creates a new transient, writable state.
Thread-safety: unless specific otherwise by the implementing class, it is not thread-safe to call
IMultiVersionOperations.commit(IEpoch)andIMultiVersionOperations.rollback()concurrently.- Specified by:
commitin interfaceIMultiVersionOperations- Parameters:
epoch- the epoch associated with this commit- Returns:
- the version that prevails after this commit (possibly an untouched current version if the commit had absolutely no impact on the state)
-
getTransaction
IIntegerArrayTransaction getTransaction()Description copied from interface:ITransactionalMultiVersionReturns the current transaction.- Specified by:
getTransactionin interfaceITransactionalMultiVersion- Returns:
- the current transaction or
nullwhen there is no transaction - See Also:
-
getOrCreateTransaction
IIntegerArrayTransaction getOrCreateTransaction()Description copied from interface:ITransactionalMultiVersionReturns the current transaction.
The result is nevernullcontrary toITransactionalMultiVersion.getTransaction().THIS METHOD SHOULD BE CALLED ONLY IF
IMultiVersionOperations.commit(IEpoch)(orITransactionalMultiVersion.rollback()) IS GUARANTEED TO BE CALLED otherwise this could cause a memory leak if the transaction holds a version (because the multiversion will keep the transaction).- Specified by:
getOrCreateTransactionin interfaceITransactionalMultiVersion- Returns:
- the current transaction
- See Also:
-
destroy
Runnable destroy()Frees all resources held by this data structure.- Returns:
- the
Runnableto run to actually destroy the data structure
-
isTransient
boolean isTransient()Returns whether this array is transient.- Returns:
trueif this array is transient,falseotherwise
-
drop
void drop()Notifies the component that it has been definitively dropped.No more roll back is possible.
The component should nullify the references it does not need anymore (example: latest, transaction) to avoid memory leak.
-
setDiscardProcedure
Sets the discardprocedure.The procedure will be invoked whenever the garbage stored in a
versionof thisarrayiscollected.- Parameters:
procedure- the discard procedure
-