use of com.palantir.atlasdb.api.TransactionToken in project atlasdb by palantir.
the class TransactionRemotingTest method testGetCellsNone.
@Test
public void testGetCellsNone() {
setupFooStatus1("sweep.priority");
TransactionToken txId = service.startTransaction();
TableCellVal badCells = service.getCells(txId, new TableCell("sweep.priority", ImmutableList.of(Cell.create(new byte[1], SweepPriorityTable.SweepPriorityNamedColumn.CELLS_EXAMINED.getShortName()))));
Assert.assertTrue(badCells.getResults().isEmpty());
}
use of com.palantir.atlasdb.api.TransactionToken in project atlasdb by palantir.
the class TransactionRemotingTest method testDelete.
@Test
public void testDelete() {
setupFooStatus1("sweep.priority");
Map<Cell, byte[]> contents = getSweepPriorityTableContents("foo");
TransactionToken token = TransactionToken.autoCommit();
service.delete(token, new TableCell("sweep.priority", contents.keySet()));
RangeToken range = service.getRange(token, new TableRange("sweep.priority", new byte[0], new byte[0], ImmutableList.<byte[]>of(), 10));
Assert.assertTrue(Iterables.isEmpty(range.getResults().getResults()));
Assert.assertNull(range.getNextRange());
}
use of com.palantir.atlasdb.api.TransactionToken in project atlasdb by palantir.
the class TransactionRemotingTest method setupFooStatus1.
private void setupFooStatus1(String table) {
TransactionToken txId = service.startTransaction();
service.put(txId, new TableCellVal(table, getSweepPriorityTableContents("foo")));
service.commit(txId);
}
use of com.palantir.atlasdb.api.TransactionToken in project atlasdb by palantir.
the class TransactionRemotingTest method setupMultipleValues.
private void setupMultipleValues() {
TransactionToken txId = service.startTransaction();
service.put(txId, new TableCellVal("sweep.priority", getSweepPriorityTableContents("foo")));
service.put(txId, new TableCellVal("sweep.priority", getSweepPriorityTableContents("bar")));
service.put(txId, new TableCellVal("sweep.priority", getSweepPriorityTableContents("baz")));
service.commit(txId);
}
use of com.palantir.atlasdb.api.TransactionToken in project atlasdb by palantir.
the class AtlasDbServiceImpl method abort.
@Override
public void abort(TransactionToken token) {
RawTransaction tx = transactions.getIfPresent(token);
if (tx != null) {
txManager.finishRunTaskWithLockThrowOnConflict(tx, (TxTask) transaction -> {
transaction.abort();
return null;
});
transactions.invalidate(token);
}
}
Aggregations