Search in sources :

Example 1 with CheckAndSetExceptionMapper

use of com.palantir.atlasdb.persistentlock.CheckAndSetExceptionMapper in project atlasdb by palantir.

the class TransactionManagers method createAndRegisterPersistentLockService.

private static PersistentLockService createAndRegisterPersistentLockService(KeyValueService kvs, Consumer<Object> env, boolean initializeAsync) {
    if (!kvs.supportsCheckAndSet()) {
        return new NoOpPersistentLockService();
    }
    PersistentLockService pls = KvsBackedPersistentLockService.create(kvs, initializeAsync);
    env.accept(pls);
    env.accept(new CheckAndSetExceptionMapper());
    return pls;
}
Also used : CheckAndSetExceptionMapper(com.palantir.atlasdb.persistentlock.CheckAndSetExceptionMapper) NoOpPersistentLockService(com.palantir.atlasdb.persistentlock.NoOpPersistentLockService) KvsBackedPersistentLockService(com.palantir.atlasdb.persistentlock.KvsBackedPersistentLockService) PersistentLockService(com.palantir.atlasdb.persistentlock.PersistentLockService) NoOpPersistentLockService(com.palantir.atlasdb.persistentlock.NoOpPersistentLockService)

Aggregations

CheckAndSetExceptionMapper (com.palantir.atlasdb.persistentlock.CheckAndSetExceptionMapper)1 KvsBackedPersistentLockService (com.palantir.atlasdb.persistentlock.KvsBackedPersistentLockService)1 NoOpPersistentLockService (com.palantir.atlasdb.persistentlock.NoOpPersistentLockService)1 PersistentLockService (com.palantir.atlasdb.persistentlock.PersistentLockService)1