Interface IEpoch
- All Superinterfaces:
Cloneable,Comparable<IEpoch>,IClone<IEpoch>
- All Known Implementing Classes:
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
FieldsModifier and TypeFieldDescriptionThe set of the default branches.static final longThe id of the initial epoch (zero).static final StringThe name of the default branch.static final longThe epoch before theINITIAL_EPOCH_ID. -
Method Summary
Modifier and TypeMethodDescriptionGets the branch of the epoch.longgetId()Gets the id of the epoch.getName()Gets the (optional) name of this epoch.longGets the time when the epoch was created.booleanisShadow()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.voidSets the name of this epoch.default StringReturns a concise description of this epoch, including shadow flag, branch and epoch id.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
INITIAL_EPOCH_ID
static final long INITIAL_EPOCH_IDThe id of the initial epoch (zero).- See Also:
-
NULL_EPOCH_ID
static final long NULL_EPOCH_IDThe epoch before theINITIAL_EPOCH_ID.- See Also:
-
MASTER_BRANCH_NAME
The name of the default branch. -
DEFAULT_BRANCHES
The set of the default branches.- See Also:
-
-
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
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:
trueif the epoch is "shadow",falseotherwise
-
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
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,3or0-12or0-3,12-15- Returns:
- the expanded array of epochs
-