throw new RuntimeException(String.format("Invalid rollup range: ", range.toString()));
}
boolean isBatch = locators.size() != 1;
final Map<Locator, ColumnList<Long>> columns = new HashMap<Locator, ColumnList<Long>>();
final RangeBuilder rangeBuilder = new RangeBuilder().setStart(range.getStart()).setEnd(range.getStop());
Timer.Context ctx = isBatch ? Instrumentation.getBatchReadTimerContext(CF) : Instrumentation.getReadTimerContext(CF);
try {
// We don't paginate this call. So we should make sure the number of reads is tolerable.
// TODO: Think about paginating this call.
OperationResult<Rows<Locator, Long>> query = keyspace
.prepareQuery(CF)
.getKeySlice(locators)
.withColumnRange(rangeBuilder.build())
.execute();
for (Row<Locator, Long> row : query.getResult()) {
columns.put(row.getKey(), row.getColumns());
}