Interface IEpochManagementPolicy
- All Known Implementing Classes:
ADefaultEpochPolicy,KeepAllEpochPolicy,KeepLastEpochPolicy
histories of all components.- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether or not adiscardtask should be executed asynchronously after each commit.booleanTells whether or not thediscardshould be triggered by the garbage collection of the version objects.default intReturns the maximum number of threads that can perform compression work.default IThreadPoolSelectorReturns the maximum number of threads that can perform compression work.longGets time interval (in ms) between two invocations ofinvoke(com.qfs.multiversion.IEpochManager).voidinvoke(IEpochManager epochManager) Executesperiodictasks.voidonCommit(IEpoch epoch, IEpochHistory history) Executed after each commit on a component.
-
Method Details
-
onCommit
Executed after each commit on a component.This method can be called in parallel with different histories (for different components), and in parallel with
invoke(IEpochManager).- Parameters:
epoch- the epoch of the commithistory- the epoch history of the component
-
invoke
Executesperiodictasks.In this method, epochs can be
released,markedorunmarked.This method can be called in parallel with
onCommit.- Parameters:
epochManager- the epoch manager of global application
-
getInvokeInterval
long getInvokeInterval()Gets time interval (in ms) between two invocations ofinvoke(com.qfs.multiversion.IEpochManager).- Returns:
- time (in ms) between
invokecalls, ifnegative, no periodical invocation will be used
-
discardAtCommit
boolean discardAtCommit()Tells whether or not adiscardtask should be executed asynchronously after each commit. The task does not block the commit.Default to
false.- Returns:
trueifdiscardshould be called asynchronously after each commit,falseotherwise
-
discardTriggeredByGc
boolean discardTriggeredByGc()Tells whether or not thediscardshould be triggered by the garbage collection of the version objects.Default to
true.- Returns:
trueifdiscardshould be called when some versions objects are found to be garbage collected,falseotherwise
-
getCompressionThreadCount
default int getCompressionThreadCount()Returns the maximum number of threads that can perform compression work.Increasing this limit means that the compaction will run faster, at the cost of using more threads, potentially blocking transactions.
Note that it is possible to add a dynamic limit here, for example by checking
ForkJoinPool.getActiveThreadCount().This limit is per
IVersionHistory. So there can be this many threads compacting the datastore and this many threads for each of the cubes. To avoid that, you can overridegetCompressionThreadPool()to run the compression in a different thread pool altogether.- Returns:
- the maximum number of threads that can perform compression work
-
getCompressionThreadPool
Returns the maximum number of threads that can perform compression work.- Returns:
- the maximum number of threads that can perform compression work
-