Search in sources :

Example 1 with RowGetter

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);
}
Also used : RowGetter(com.palantir.atlasdb.keyvalue.cassandra.paging.RowGetter) ColumnGetter(com.palantir.atlasdb.keyvalue.cassandra.paging.ColumnGetter) ThriftColumnGetter(com.palantir.atlasdb.keyvalue.cassandra.paging.ThriftColumnGetter) SlicePredicate(org.apache.cassandra.thrift.SlicePredicate) ThriftColumnGetter(com.palantir.atlasdb.keyvalue.cassandra.paging.ThriftColumnGetter)

Aggregations

ColumnGetter (com.palantir.atlasdb.keyvalue.cassandra.paging.ColumnGetter)1 RowGetter (com.palantir.atlasdb.keyvalue.cassandra.paging.RowGetter)1 ThriftColumnGetter (com.palantir.atlasdb.keyvalue.cassandra.paging.ThriftColumnGetter)1 SlicePredicate (org.apache.cassandra.thrift.SlicePredicate)1