Search in sources :

Example 11 with TableCellVal

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

Example 12 with TableCellVal

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

the class TableCellValDeserializer method deserialize.

@Override
public TableCellVal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
    JsonNode node = jp.readValueAsTree();
    String tableName = node.get("table").textValue();
    TableMetadata metadata = metadataCache.getMetadata(tableName);
    Map<Cell, byte[]> values = AtlasDeserializers.deserializeCellVals(metadata, node.get("data"));
    return new TableCellVal(tableName, values);
}
Also used : TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) TableCellVal(com.palantir.atlasdb.api.TableCellVal) JsonNode(com.fasterxml.jackson.databind.JsonNode) Cell(com.palantir.atlasdb.keyvalue.api.Cell)

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