use of com.palantir.atlasdb.api.TableCell in project atlasdb by palantir.
the class TransactionRemotingTest method testGetCellsSome.
@Test
public void testGetCellsSome() {
setupFooStatus1("sweep.priority");
TransactionToken txId = service.startTransaction();
Map<Cell, byte[]> contents = getSweepPriorityTableContents("foo");
TableCellVal goodCells = service.getCells(txId, new TableCell("sweep.priority", contents.keySet()));
Assert.assertEquals(contents.keySet(), goodCells.getResults().keySet());
Assert.assertArrayEquals(Iterables.getOnlyElement(contents.values()), Iterables.getOnlyElement(goodCells.getResults().values()));
service.commit(txId);
}
use of com.palantir.atlasdb.api.TableCell in project atlasdb by palantir.
the class TransactionRemotingTest method testRaw2.
@Test
public void testRaw2() throws JsonProcessingException {
String tableName = "ns.my_table";
service.createTable(tableName);
TransactionToken txId = service.startTransaction();
Cell rawCell = Cell.create(new byte[] { 0, 1, 2 }, new byte[] { 3, 4, 5 });
TableCellVal putArg = new TableCellVal(tableName, ImmutableMap.of(rawCell, new byte[] { 40, 0 }));
service.put(txId, putArg);
TableCell tableCell = new TableCell(tableName, ImmutableList.of(rawCell));
service.getCells(txId, tableCell);
}
use of com.palantir.atlasdb.api.TableCell in project atlasdb by palantir.
the class AtlasConsoleServiceImpl method delete.
@Override
public void delete(TransactionToken token, String data) throws IOException {
TableCell cells = fromJson(data, TableCell.class);
service.delete(token, cells);
}
use of com.palantir.atlasdb.api.TableCell 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.TableCell 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());
}
Aggregations