Interface IEpoch

All Superinterfaces:
Cloneable, Comparable<IEpoch>, IClone<IEpoch>
All Known Implementing Classes:
Epoch

public interface IEpoch extends IClone<IEpoch>, Comparable<IEpoch>
Represents an epoch.

Epochs represent instant of the system timeline at which the state of the application changed. When transaction is committed on the datastore for instance, the new version of the datastore exists at a new epoch.

An epoch is identified by its epoch id, a unique number monotonously incremented each time a new epoch is created by the application.

Author:
ActiveViam
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<String>
    The set of the default branches.
    static final long
    The id of the initial epoch (zero).
    static final String
    The name of the default branch.
    static final long
    The epoch before the INITIAL_EPOCH_ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the branch of the epoch.
    long
    Gets the id of the epoch.
    Gets the (optional) name of this epoch.
    long
    Gets the time when the epoch was created.
    boolean
    Checks whether or not the epoch is "shadow".
    static long[]
    parseVersionsRanges(String epochsRangesStr)
    Parses a String representing epoch ranges, and returns an explicit array of epochs corresponding to the given ranges.
    void
    Sets the name of this epoch.
    default String
    Returns a concise description of this epoch, including shadow flag, branch and epoch id.

    Methods inherited from interface java.lang.Comparable

    compareTo

    Methods inherited from interface com.quartetfs.fwk.IClone

    clone
  • Field Details

  • Method Details

    • getName

      String getName()
      Gets the (optional) name of this epoch.

      The datastore multiversion engine does not give a name to the version it creates, but administration tools like for instance snapshot facilities may give a name to epochs.

      Returns:
      the name of the epoch (if it was given a name) or null
    • setName

      void setName(String name)
      Sets the name of this epoch.

      Remember that usually the epoch manager creates only one epoch per version of the system, and that epoch is shared by all the multi-version components in the application, so the name change will be visible by all components in the application.

      Parameters:
      name - the name of this epoch
    • getId

      long getId()
      Gets the id of the epoch.
      Returns:
      the id
    • getTimestamp

      long getTimestamp()
      Gets the time when the epoch was created.
      Returns:
      the time when the epoch was created
    • getBranch

      String getBranch()
      Gets the branch of the epoch.

      A branch is a succession of epochs. Branches allows the system to have several timelines.

      Returns:
      the branch
    • isShadow

      boolean isShadow()
      Checks whether or not the epoch is "shadow".

      A shadow epoch is an epoch created to be the inverse projection of one or many epochs. It is used to switch between branches.

      Queries do not need to see shadow epochs.

      Returns:
      true if the epoch is "shadow", false otherwise
    • toHumanString

      default String toHumanString()
      Returns a concise description of this epoch, including shadow flag, branch and epoch id.

      Format: <branch>:<epoch id>. This wrapped into "*..*" if the epoch is shadow.

      Returns:
      the description
    • parseVersionsRanges

      static long[] parseVersionsRanges(String epochsRangesStr)
      Parses a String representing epoch ranges, and returns an explicit array of epochs corresponding to the given ranges.
      Parameters:
      epochsRangesStr - the list of ranges of epochs, for example: 0,1,2,3 or 0-12 or 0-3,12-15
      Returns:
      the expanded array of epochs