use of com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection in project atlasdb by palantir.
the class InMemoryKeyValueService method getRowsColumnRange.
@Override
public Map<byte[], RowColumnRangeIterator> getRowsColumnRange(TableReference tableRef, Iterable<byte[]> rows, BatchColumnRangeSelection batchColumnRangeSelection, long timestamp) {
Map<byte[], RowColumnRangeIterator> result = Maps.newHashMap();
ConcurrentSkipListMap<Key, byte[]> table = getTableMap(tableRef).entries;
ColumnRangeSelection columnRangeSelection = new ColumnRangeSelection(batchColumnRangeSelection.getStartCol(), batchColumnRangeSelection.getEndCol());
for (byte[] row : rows) {
result.put(row, getColumnRangeForSingleRow(table, row, columnRangeSelection, timestamp));
}
return result;
}
use of com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection in project atlasdb by palantir.
the class OneNodeDownGetTest method canGetRowsColumnRange.
@Test
public void canGetRowsColumnRange() {
BatchColumnRangeSelection rangeSelection = BatchColumnRangeSelection.create(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY, 1);
Map<byte[], RowColumnRangeIterator> rowsColumnRange = OneNodeDownTestSuite.kvs.getRowsColumnRange(OneNodeDownTestSuite.TEST_TABLE, ImmutableList.of(OneNodeDownTestSuite.FIRST_ROW), rangeSelection, Long.MAX_VALUE);
assertEquals(1, rowsColumnRange.size());
byte[] rowName = rowsColumnRange.entrySet().iterator().next().getKey();
assertTrue(Arrays.equals(OneNodeDownTestSuite.FIRST_ROW, rowName));
RowColumnRangeIterator it = rowsColumnRange.get(rowName);
assertThat(it).containsExactlyElementsOf(expectedRow.entrySet());
}
Aggregations