Package com.qfs.multiversion
Interface IEpochManager
- All Known Subinterfaces:
IAdvancedEpochManager
- All Known Implementing Classes:
AEpochManager,DistributedEpochManager,EpochManager
public interface IEpochManager
User interface for versions management of all components.
- Author:
- ActiveViam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHandler containing callbacks for the different events triggered during a version's lifecycle. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<V extends ISquashableVersion<V>>
IVersionHistory<V>createVersionHistory(boolean root, IHasId forComponent, IEpochManager.IVersionLifecycleHandler<V> historyLifecycle) Creates a version history that works accordingly to the epoch management policy of this epoch manager.voiddiscard()Cleans up resources that are only reachable by versions that do not exist anymore.voidforceDiscardEpochs(Predicate<IHistoryNode> predicate) Iterates over all the released epochs in each history of this epoch manager and forces the discard of the epochs for which thepredicatereturnstrue.Gets the names of the branches.Map<String,? extends IEpochHistory> Gets the underlying histories indexed by theirids.Gets the root history.voidreleaseBranch(String branch) Releases all the epochs of the given branch.voidreleaseEpochs(String branch, long from, long to) Releases a range of epochs.voidreleaseHistory(String id) Removes anIEpochHistoryfrom the existing list of histories stored by theepoch manager.
-
Field Details
-
IDENTIFIER
Statistic identifier.- See Also:
-
-
Method Details
-
releaseHistory
Removes anIEpochHistoryfrom the existing list of histories stored by theepoch manager.- Parameters:
id- the component whose history should be removed- See Also:
-
releaseEpochs
Releases a range of epochs.- Parameters:
branch- the branch of the versions to releasefrom- the lower bound of the range, included in the deletionto- the upper bound of the range, also included in the deletion- Throws:
IllegalArgumentException- if trying to release the latest epoch (i.e. whento >= currentEpoch, with currentEpoch =#getCurrentEpoch())- See Also:
-
getBranches
Gets the names of the branches.- Returns:
- the names of the branches
-
releaseBranch
Releases all the epochs of the given branch.- Parameters:
branch- any branch but the main- See Also:
-
getRootHistory
IEpochHistory getRootHistory()Gets the root history. The root history is the single history whose versions are followed by other histories.- Returns:
- the root history
-
getHistories
Map<String,? extends IEpochHistory> getHistories()Gets the underlying histories indexed by theirids. -
createVersionHistory
<V extends ISquashableVersion<V>> IVersionHistory<V> createVersionHistory(boolean root, IHasId forComponent, IEpochManager.IVersionLifecycleHandler<V> historyLifecycle) Creates a version history that works accordingly to the epoch management policy of this epoch manager.- Type Parameters:
V- the type of versions stored in this history- Parameters:
root- indicates if this history is the root version history among all histories created by this creator, the root history is the single history whose versions are followed by other historiesforComponent- the multiversion whose versions are managed by the new version historyhistoryLifecycle- lifecycle callbacks for this version history- Returns:
- version history
-
discard
void discard()Cleans up resources that are only reachable by versions that do not exist anymore. -
forceDiscardEpochs
Iterates over all the released epochs in each history of this epoch manager and forces the discard of the epochs for which thepredicatereturnstrue.This call will also perform a normal
discard().- Parameters:
predicate- the predicate that will select the epoch to discard
-