Search in sources :

Example 1 with ProfilingTimelockService

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();
}
Also used : TimeLockClient(com.palantir.lock.client.TimeLockClient) TimelockTimestampServiceAdapter(com.palantir.atlasdb.transaction.impl.TimelockTimestampServiceAdapter) ProfilingTimelockService(com.palantir.lock.client.ProfilingTimelockService)

Aggregations

TimelockTimestampServiceAdapter (com.palantir.atlasdb.transaction.impl.TimelockTimestampServiceAdapter)1 ProfilingTimelockService (com.palantir.lock.client.ProfilingTimelockService)1 TimeLockClient (com.palantir.lock.client.TimeLockClient)1