use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable in project atlasdb by palantir.
the class SchemaApiTestImpl method deleteFirstColumn.
@Override
protected void deleteFirstColumn(Transaction transaction, String rowKey) {
SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
table.deleteColumn1(SchemaApiTestRow.of(rowKey));
}
use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable in project atlasdb by palantir.
the class SchemaApiTestImpl method deleteWholeRow.
@Override
protected void deleteWholeRow(Transaction transaction, String rowKey) {
SchemaApiTestTable table = tableFactory.getSchemaApiTestTable(transaction);
table.delete(SchemaApiTestRow.of(rowKey));
}
use of com.palantir.atlasdb.table.description.generated.SchemaApiTestTable 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 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 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));
}
Aggregations