use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult in project atlasdb by palantir.
the class SchemaApiTestImpl method getRangeSecondColumnOnlyFirstTwoResults.
@Override
protected Map<String, StringValue> getRangeSecondColumnOnlyFirstTwoResults(Transaction transaction, String startRowKey, String endRowKey) {
SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
ColumnSelection secondColSelection = SchemaApiTestTable.getColumnSelection(SchemaApiTestTable.SchemaApiTestNamedColumn.COLUMN2);
RangeRequest rangeRequest = RangeRequest.builder().startRowInclusive(SchemaApiTestRow.of(startRowKey).persistToBytes()).endRowExclusive(SchemaApiTestRow.of(endRowKey).persistToBytes()).retainColumns(secondColSelection).batchHint(2).build();
BatchingVisitableView<SchemaApiTestRowResult> rangeRequestResult = table.getRange(rangeRequest);
return BatchingVisitables.take(rangeRequestResult, 2).stream().collect(Collectors.toMap(entry -> entry.getRowName().getComponent1(), SchemaApiTestTable.SchemaApiTestRowResult::getColumn2));
}
use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult in project atlasdb by palantir.
the class SchemaApiTestImpl method getSingleRowFirstColumn.
@Override
protected Long getSingleRowFirstColumn(Transaction transaction, String rowKey) {
SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
ColumnSelection firstColSelection = SchemaApiTestTable.getColumnSelection(SchemaApiTestTable.SchemaApiTestNamedColumn.COLUMN1);
Optional<SchemaApiTestRowResult> result = table.getRow(SchemaApiTestRow.of(rowKey), firstColSelection);
return result.get().getColumn1();
}
use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult in project atlasdb by palantir.
the class SchemaApiTestImpl method getRangeSecondColumn.
@Override
protected Map<String, StringValue> getRangeSecondColumn(Transaction transaction, String startRowKey, String endRowKey) {
SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
ColumnSelection secondColSelection = SchemaApiTestTable.getColumnSelection(SchemaApiTestTable.SchemaApiTestNamedColumn.COLUMN2);
RangeRequest rangeRequest = RangeRequest.builder().startRowInclusive(SchemaApiTestRow.of(startRowKey).persistToBytes()).endRowExclusive(SchemaApiTestRow.of(endRowKey).persistToBytes()).retainColumns(secondColSelection).build();
BatchingVisitableView<SchemaApiTestRowResult> rangeRequestResult = table.getRange(rangeRequest);
return rangeRequestResult.immutableCopy().stream().collect(Collectors.toMap(entry -> entry.getRowName().getComponent1(), SchemaApiTestTable.SchemaApiTestRowResult::getColumn2));
}
use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable.SchemaApiTestRowResult 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));
}
Aggregations