use of com.palantir.atlasdb.timelock.TimeLockServices in project atlasdb by palantir.
the class NamespacedConsensus method achieveConsensusForNamespace.
/**
* Gets a fresh timestamp for namespace from {@link TimestampService#getFreshTimestamp()} and fast forwards
* the timestamp by 1 million for the given namespace.
*
* @param namespace namespace for which consensus has to be achieved
*/
public static void achieveConsensusForNamespace(TimelockNamespaces timelockNamespaces, String namespace) {
TimeLockServices timeLockServices = timelockNamespaces.get(namespace);
long timestamp = timeLockServices.getTimelockService().getFreshTimestamp() + 1000000L;
timeLockServices.getTimestampManagementService().fastForwardTimestamp(timestamp);
}
Aggregations