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
  • Field Details

  • Method Details

    • releaseHistory

      void releaseHistory(String id)
      Removes an IEpochHistory from the existing list of histories stored by the epoch manager.
      Parameters:
      id - the component whose history should be removed
      See Also:
    • releaseEpochs

      void releaseEpochs(String branch, long from, long to) throws IllegalArgumentException
      Releases a range of epochs.
      Parameters:
      branch - the branch of the versions to release
      from - the lower bound of the range, included in the deletion
      to - the upper bound of the range, also included in the deletion
      Throws:
      IllegalArgumentException - if trying to release the latest epoch (i.e. when to >= currentEpoch, with currentEpoch = #getCurrentEpoch())
      See Also:
    • getBranches

      Set<String> getBranches()
      Gets the names of the branches.
      Returns:
      the names of the branches
    • releaseBranch

      void releaseBranch(String branch)
      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 their ids.
    • 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 histories
      forComponent - the multiversion whose versions are managed by the new version history
      historyLifecycle - 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

      void forceDiscardEpochs(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 the predicate returns true.

      This call will also perform a normal discard().

      Parameters:
      predicate - the predicate that will select the epoch to discard