Search in sources :

Example 1 with AsyncOrLegacyTimelockService

use of com.palantir.atlasdb.timelock.util.AsyncOrLegacyTimelockService 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);
}
Also used : AsyncTimelockResource(com.palantir.atlasdb.timelock.AsyncTimelockResource) NonTransactionalLockService(com.palantir.atlasdb.timelock.lock.NonTransactionalLockService) NonTransactionalLockService(com.palantir.atlasdb.timelock.lock.NonTransactionalLockService) LockService(com.palantir.lock.LockService) AsyncLockService(com.palantir.atlasdb.timelock.lock.AsyncLockService) AsyncOrLegacyTimelockService(com.palantir.atlasdb.timelock.util.AsyncOrLegacyTimelockService) AsyncTimelockService(com.palantir.atlasdb.timelock.AsyncTimelockService)

Aggregations

AsyncTimelockResource (com.palantir.atlasdb.timelock.AsyncTimelockResource)1 AsyncTimelockService (com.palantir.atlasdb.timelock.AsyncTimelockService)1 AsyncLockService (com.palantir.atlasdb.timelock.lock.AsyncLockService)1 NonTransactionalLockService (com.palantir.atlasdb.timelock.lock.NonTransactionalLockService)1 AsyncOrLegacyTimelockService (com.palantir.atlasdb.timelock.util.AsyncOrLegacyTimelockService)1 LockService (com.palantir.lock.LockService)1