Search in sources :

Example 6 with SchemaApiTestTable

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable in project atlasdb by palantir.

the class SchemaApiTestImpl method getMultipleRowsFirstColumn.

@Override
protected Map<String, Long> getMultipleRowsFirstColumn(Transaction transaction, List<String> rowKeys) {
    SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
    ColumnSelection firstColSelection = SchemaApiTestTable.getColumnSelection(SchemaApiTestTable.SchemaApiTestNamedColumn.COLUMN1);
    List<SchemaApiTestRowResult> result = table.getRows(rowKeys.stream().map(SchemaApiTestRow::of).collect(Collectors.toList()), firstColSelection);
    return result.stream().collect(Collectors.toMap(entry -> entry.getRowName().getComponent1(), SchemaApiTestTable.SchemaApiTestRowResult::getColumn1));
}
Also used : StringValue(com.palantir.atlasdb.table.description.test.StringValue) EncodingUtils(com.palantir.atlasdb.ptobject.EncodingUtils) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) HashComponentsTestTable(com.palantir.atlasdb.table.description.generated.HashComponentsTestTable) ApiTestTableFactory(com.palantir.atlasdb.table.description.generated.ApiTestTableFactory) Test(org.junit.Test) Hashing(com.google.common.hash.Hashing) Collectors(java.util.stream.Collectors) PtBytes(com.palantir.atlasdb.encoding.PtBytes) ColumnSelection(com.palantir.atlasdb.keyvalue.api.ColumnSelection) RangeRequest(com.palantir.atlasdb.keyvalue.api.RangeRequest) SchemaApiTestRow(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRow) List(java.util.List) Transaction(com.palantir.atlasdb.transaction.api.Transaction) Map(java.util.Map) SchemaApiTestRowResult(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult) BatchingVisitableView(com.palantir.common.base.BatchingVisitableView) Optional(java.util.Optional) SchemaApiTestTable(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable) BatchingVisitables(com.palantir.common.base.BatchingVisitables) ColumnSelection(com.palantir.atlasdb.keyvalue.api.ColumnSelection) SchemaApiTestRow(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRow) SchemaApiTestTable(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable) SchemaApiTestRowResult(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult)

Example 7 with SchemaApiTestTable

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable in project atlasdb by palantir.

the class SchemaApiTestImpl method putSingleRowFirstColumn.

@Override
protected void putSingleRowFirstColumn(Transaction transaction, String rowKey, long value) {
    SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
    table.putColumn1(SchemaApiTestRow.of(rowKey), value);
}
Also used : SchemaApiTestTable(com.palantir.atlasdb.table.description.generated.SchemaApiTestTable)

Aggregations

SchemaApiTestTable (com.palantir.atlasdb.table.description.generated.SchemaApiTestTable)7 ColumnSelection (com.palantir.atlasdb.keyvalue.api.ColumnSelection)4 SchemaApiTestRowResult (com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult)4 Hashing (com.google.common.hash.Hashing)3 PtBytes (com.palantir.atlasdb.encoding.PtBytes)3 RangeRequest (com.palantir.atlasdb.keyvalue.api.RangeRequest)3 EncodingUtils (com.palantir.atlasdb.ptobject.EncodingUtils)3 ApiTestTableFactory (com.palantir.atlasdb.table.description.generated.ApiTestTableFactory)3 HashComponentsTestTable (com.palantir.atlasdb.table.description.generated.HashComponentsTestTable)3 SchemaApiTestRow (com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRow)3 StringValue (com.palantir.atlasdb.table.description.test.StringValue)3 Transaction (com.palantir.atlasdb.transaction.api.Transaction)3 BatchingVisitableView (com.palantir.common.base.BatchingVisitableView)3 BatchingVisitables (com.palantir.common.base.BatchingVisitables)3 List (java.util.List)3 Map (java.util.Map)3 Optional (java.util.Optional)3 Collectors (java.util.stream.Collectors)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 Test (org.junit.Test)3