|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.versioning.VectorClockUtils
public class VectorClockUtils
Constructor Summary | |
---|---|
VectorClockUtils()
|
Method Summary | |
---|---|
static Occurred |
compare(VectorClock v1,
VectorClock v2)
Compare two VectorClocks, the outcomes will be one of the following: -- Clock 1 is BEFORE clock 2, if there exists an nodeId such that c1(nodeId) <= c2(nodeId) and there does not exist another nodeId such that c1(nodeId) > c2(nodeId). |
static VectorClock |
makeClock(java.util.Set<java.lang.Integer> serverIds,
long clockValue,
long timestamp)
Generates a vector clock with the provided values |
static VectorClock |
makeClockWithCurrentTime(java.util.Set<java.lang.Integer> serverIds)
Generates a vector clock with the provided nodes and current time stamp This clock can be used to overwrite the existing value avoiding obsolete version exceptions in most cases, except If the existing Vector Clock was generated in custom way. |
static java.util.List<Versioned<byte[]>> |
resolveVersions(java.util.List<Versioned<byte[]>> values)
Given a set of versions, constructs a resolved list of versions based on the compare function above |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VectorClockUtils()
Method Detail |
---|
public static Occurred compare(VectorClock v1, VectorClock v2)
v1
- The first VectorClockv2
- The second VectorClockpublic static java.util.List<Versioned<byte[]>> resolveVersions(java.util.List<Versioned<byte[]>> values)
values
-
public static VectorClock makeClock(java.util.Set<java.lang.Integer> serverIds, long clockValue, long timestamp)
serverIds
- servers in the clockclockValue
- value of the clock for each server entrytimestamp
- ts value to be set for the clock
public static VectorClock makeClockWithCurrentTime(java.util.Set<java.lang.Integer> serverIds)
serverIds
- servers in the clock
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |