return newDatabaseVersionHeader;
}
public static VectorClock createVectorClock(String vectorClockString) throws Exception {
String[] vectorClockElements = vectorClockString.split(",");
VectorClock vectorClock = new VectorClock();
for (String vectorClockElement : vectorClockElements) {
if ("".equals(vectorClockElement.trim())) {
continue;
}
Matcher vectorClockElementMatcher = vectorClockElementPattern.matcher(vectorClockElement);
if (!vectorClockElementMatcher.matches()) {
throw new Exception("Invalid vector clock element string: "+vectorClockElement);
}
String vectorClockMachineName = vectorClockElementMatcher.group(1);
long vectorClockTime = Long.parseLong(vectorClockElementMatcher.group(2));
vectorClock.setClock(vectorClockMachineName, vectorClockTime);
}
return vectorClock;
}