Class MultiPartitionPager<T extends SinglePartitionReadQuery>

  • All Implemented Interfaces:
    QueryPager

    public class MultiPartitionPager<T extends SinglePartitionReadQuery>
    extends java.lang.Object
    implements QueryPager
    Pager over a list of SinglePartitionReadQuery. Note that this is not easy to make efficient. Indeed, we need to page the first query fully before returning results from the next one, but if the result returned by each query is small (compared to pageSize), paging the queries one at a time under-performs compared to parallelizing. On the other, if we parallelize and each query raised pageSize results, we'll end up with queries.size() * pageSize results in memory, which defeats the purpose of paging. For now, we keep it simple (somewhat) and just do one query at a time. Provided that we make sure to not create a pager unless we need to, this is probably fine. Though if we later want to get fancy, we could use the cfs meanPartitionSize to decide if parallelizing some of the query might be worth it while being confident we don't blow out memory.