Search in sources :

Example 6 with TableCellVal

use of com.palantir.atlasdb.api.TableCellVal 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);
}
Also used : TableCell(com.palantir.atlasdb.api.TableCell) TransactionToken(com.palantir.atlasdb.api.TransactionToken) TableCellVal(com.palantir.atlasdb.api.TableCellVal) Cell(com.palantir.atlasdb.keyvalue.api.Cell) TableCell(com.palantir.atlasdb.api.TableCell) Test(org.junit.Test)

Example 7 with TableCellVal

use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.

the class AtlasConsoleServiceImpl method put.

@Override
public void put(TransactionToken token, String data) throws IOException {
    TableCellVal cells = fromJson(data, TableCellVal.class);
    service.put(token, cells);
}
Also used : TableCellVal(com.palantir.atlasdb.api.TableCellVal)

Example 8 with TableCellVal

use of com.palantir.atlasdb.api.TableCellVal in project atlasdb by palantir.

the class AtlasConsoleServiceTest method testPut.

@Test
public void testPut() throws IOException {
    final TableCellVal input = context.mock(TableCellVal.class);
    context.checking(fromJson(input, TableCellVal.class));
    context.checking(new Expectations() {

        {
            oneOf(delegate).put(token, input);
        }
    });
    service.put(token, QUERY);
    context.assertIsSatisfied();
}
Also used : Expectations(org.jmock.Expectations) TableCellVal(com.palantir.atlasdb.api.TableCellVal) Test(org.junit.Test)

Example 9 with TableCellVal

use of com.palantir.atlasdb.api.TableCellVal 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());
}
Also used : TableCell(com.palantir.atlasdb.api.TableCell) TransactionToken(com.palantir.atlasdb.api.TransactionToken) TableCellVal(com.palantir.atlasdb.api.TableCellVal) Test(org.junit.Test)

Example 10 with TableCellVal

use of com.palantir.atlasdb.api.TableCellVal 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);
}
Also used : TransactionToken(com.palantir.atlasdb.api.TransactionToken) TableCellVal(com.palantir.atlasdb.api.TableCellVal)

Aggregations

TableCellVal (com.palantir.atlasdb.api.TableCellVal)12 TransactionToken (com.palantir.atlasdb.api.TransactionToken)7 Test (org.junit.Test)7 TableCell (com.palantir.atlasdb.api.TableCell)5 Cell (com.palantir.atlasdb.keyvalue.api.Cell)3 Expectations (org.jmock.Expectations)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 RangeToken (com.palantir.atlasdb.api.RangeToken)1 TableRange (com.palantir.atlasdb.api.TableRange)1 TableMetadata (com.palantir.atlasdb.table.description.TableMetadata)1