use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.
the class TracingKeyValueServiceTest method checkAndSet.
@Test
public void checkAndSet() throws Exception {
CheckAndSetRequest request = CheckAndSetRequest.singleCell(TABLE_REF, CELL, ROW_NAME, ROW_NAME);
kvs.checkAndSet(request);
checkSpan("atlasdb-kvs.checkAndSet({table})");
verify(delegate).checkAndSet(request);
verifyNoMoreInteractions(delegate);
}
use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.
the class LockStoreImpl method acquireBackupLock.
@Override
public LockEntry acquireBackupLock(String reason) throws CheckAndSetException {
LockEntry lockEntry = generateUniqueBackupLockEntry(reason);
CheckAndSetRequest request = CheckAndSetRequest.singleCell(AtlasDbConstants.PERSISTED_LOCKS_TABLE, lockEntry.cell(), LOCK_OPEN.value(), lockEntry.value());
keyValueService.checkAndSet(request);
log.info("Successfully acquired the persistent lock: {}", SafeArg.of("lockEntry", lockEntry));
return lockEntry;
}
use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.
the class LockStoreImpl method releaseLock.
@Override
public void releaseLock(LockEntry lockEntry) throws CheckAndSetException {
CheckAndSetRequest request = CheckAndSetRequest.singleCell(AtlasDbConstants.PERSISTED_LOCKS_TABLE, lockEntry.cell(), lockEntry.value(), LOCK_OPEN.value());
keyValueService.checkAndSet(request);
log.info("Successfully released the persistent lock: {}", SafeArg.of("lockEntry", lockEntry));
}
use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.
the class AbstractKeyValueServiceTest method testCheckAndSetFromOtherValue.
@Test
public void testCheckAndSetFromOtherValue() {
Assume.assumeTrue(checkAndSetSupported());
CheckAndSetRequest request = CheckAndSetRequest.newCell(TEST_TABLE, TEST_CELL, value00);
keyValueService.checkAndSet(request);
CheckAndSetRequest secondRequest = CheckAndSetRequest.singleCell(TEST_TABLE, TEST_CELL, value00, value01);
keyValueService.checkAndSet(secondRequest);
verifyCheckAndSet(TEST_CELL, value01);
}
use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.
the class AbstractKeyValueServiceTest method testCheckAndSetFromEmpty.
@Test
public void testCheckAndSetFromEmpty() {
Assume.assumeTrue(checkAndSetSupported());
CheckAndSetRequest request = CheckAndSetRequest.newCell(TEST_TABLE, TEST_CELL, value00);
keyValueService.checkAndSet(request);
verifyCheckAndSet(TEST_CELL, value00);
}
Aggregations