use of com.palantir.lock.client.ProfilingTimelockService in project atlasdb by palantir.
the class DefaultLockAndTimestampServiceFactory method withRefreshingLockService.
private static LockAndTimestampServices withRefreshingLockService(LockAndTimestampServices lockAndTimestampServices) {
TimeLockClient timeLockClient = TimeLockClient.createDefault(lockAndTimestampServices.timelock());
ProfilingTimelockService profilingService = ProfilingTimelockService.create(timeLockClient);
return ImmutableLockAndTimestampServices.builder().from(lockAndTimestampServices).timestamp(new TimelockTimestampServiceAdapter(profilingService)).timelock(profilingService).lock(LockRefreshingLockService.create(lockAndTimestampServices.lock())).addResources(timeLockClient::close).addResources(profilingService::close).build();
}
Aggregations