use of com.palantir.atlasdb.timelock.AsyncTimelockService in project atlasdb by palantir.
the class AsyncTimeLockServicesCreator method createTimeLockServices.
@Override
public TimeLockServices createTimeLockServices(String client, Supplier<ManagedTimestampService> rawTimestampServiceSupplier, Supplier<LockService> rawLockServiceSupplier) {
log.info("Creating async timelock services for client {}", SafeArg.of("client", client));
AsyncOrLegacyTimelockService asyncOrLegacyTimelockService;
AsyncTimelockService asyncTimelockService = instrumentInLeadershipProxy(AsyncTimelockService.class, () -> AsyncTimeLockServicesCreator.createRawAsyncTimelockService(client, rawTimestampServiceSupplier), client);
asyncOrLegacyTimelockService = AsyncOrLegacyTimelockService.createFromAsyncTimelock(new AsyncTimelockResource(asyncTimelockService));
LockService lockService = instrumentInLeadershipProxy(LockService.class, asyncLockConfiguration.disableLegacySafetyChecksWarningPotentialDataCorruption() ? rawLockServiceSupplier : JavaSuppliers.compose(NonTransactionalLockService::new, rawLockServiceSupplier), client);
return TimeLockServices.create(asyncTimelockService, lockService, asyncOrLegacyTimelockService, asyncTimelockService);
}
Aggregations