@Beta public class VectorClock<T extends io.atomix.utils.Identifier> extends Object implements Clock<VectorTimestamp<T>>
| Constructor and Description |
|---|
VectorClock(T localIdentifier) |
VectorClock(VectorTimestamp<T> localTimestamp) |
VectorClock(VectorTimestamp<T> localTimestamp,
Collection<VectorTimestamp<T>> vector) |
| Modifier and Type | Method and Description |
|---|---|
LogicalTimestamp |
getLocalTimestamp()
Returns the local logical timestamp.
|
VectorTimestamp<T> |
getTime()
Returns the current time of the clock.
|
LogicalTimestamp |
getTimestamp(T identifier)
Returns the logical timestamp for the given identifier.
|
Collection<VectorTimestamp<T>> |
getTimestamps()
Returns a collection of identifier-timestamp pairs.
|
String |
toString() |
void |
update(VectorClock<T> clock)
Updates the vector clock.
|
void |
update(VectorTimestamp<T> timestamp)
Updates the given timestamp.
|
public VectorClock(T localIdentifier)
public VectorClock(VectorTimestamp<T> localTimestamp)
public VectorClock(VectorTimestamp<T> localTimestamp, Collection<VectorTimestamp<T>> vector)
public VectorTimestamp<T> getTime()
ClockgetTime in interface Clock<VectorTimestamp<T extends io.atomix.utils.Identifier>>public LogicalTimestamp getLocalTimestamp()
public LogicalTimestamp getTimestamp(T identifier)
identifier - the identifier for which to return the timestamppublic Collection<VectorTimestamp<T>> getTimestamps()
public void update(VectorTimestamp<T> timestamp)
timestamp - the timestamp to updatepublic void update(VectorClock<T> clock)
clock - the vector clock with which to update this clockCopyright © 2013–2019. All rights reserved.