use of com.palantir.atlasdb.keyvalue.cassandra.paging.RowGetter in project atlasdb by palantir.
the class CassandraKeyValueServiceImpl method getRangeWithPageCreator.
private <T> ClosableIterator<RowResult<T>> getRangeWithPageCreator(TableReference tableRef, RangeRequest rangeRequest, long startTs, ConsistencyLevel consistency, Supplier<ResultsExtractor<T>> resultsExtractor) {
SlicePredicate predicate;
if (rangeRequest.getColumnNames().size() == 1) {
byte[] colName = rangeRequest.getColumnNames().iterator().next();
predicate = SlicePredicates.latestVersionForColumn(colName, startTs);
} else {
// TODO(nziebart): optimize fetching multiple columns by performing a parallel range request for
// each column. note that if no columns are specified, it's a special case that means all columns
predicate = SlicePredicates.create(Range.ALL, Limit.NO_LIMIT);
}
RowGetter rowGetter = new RowGetter(clientPool, queryRunner, consistency, tableRef);
ColumnGetter columnGetter = new ThriftColumnGetter();
return getRangeWithPageCreator(rowGetter, predicate, columnGetter, rangeRequest, resultsExtractor, startTs);
}
Aggregations