use of com.palantir.lock.v2.LockImmutableTimestampRequest in project atlasdb by palantir.
the class TimestampDecoratingTimelockServiceTest method methodsNotOnTimestampServiceRoutedToDelegateService.
@Test
public void methodsNotOnTimestampServiceRoutedToDelegateService() {
decoratingService.currentTimeMillis();
verify(delegate).currentTimeMillis();
LockImmutableTimestampRequest immutableTimestampRequest = LockImmutableTimestampRequest.create();
decoratingService.lockImmutableTimestamp(immutableTimestampRequest);
verify(delegate).lockImmutableTimestamp(eq(immutableTimestampRequest));
}
use of com.palantir.lock.v2.LockImmutableTimestampRequest in project atlasdb by palantir.
the class TimeLockClient method lockImmutableTimestamp.
@Override
public LockImmutableTimestampResponse lockImmutableTimestamp(LockImmutableTimestampRequest request) {
LockImmutableTimestampResponse response = executeOnTimeLock(() -> delegate.lockImmutableTimestamp(request));
lockRefresher.registerLock(response.getLock());
return response;
}
use of com.palantir.lock.v2.LockImmutableTimestampRequest in project atlasdb by palantir.
the class AsyncTimelockServiceImpl method lockImmutableTimestamp.
@Override
public LockImmutableTimestampResponse lockImmutableTimestamp(LockImmutableTimestampRequest request) {
long timestamp = timestampService.getFreshTimestamp();
// this will always return synchronously
LockToken token = lockService.lockImmutableTimestamp(request.getRequestId(), timestamp).get();
long immutableTs = lockService.getImmutableTimestamp().orElse(timestamp);
return LockImmutableTimestampResponse.of(immutableTs, token);
}
Aggregations