public Holder<IndexColumn> nextImpl() {
if(batchListener != null)
batchListener.beforeFetchingNextBatch();
loadBatchIfNeeded();
if(cachedLastCols != null && cachedLastCols.hasNext()) {
IndexColumn indexedCol = cachedLastCols.next();
return new Holder<IndexColumn>(indexedCol);
}
while(true) {
if(!theOneBatch.hasNext())
return null;
Future<ResultSet> future = theOneBatch.next();
ResultSet results = get(future);
cachedLastCols = new ArrayList<IndexColumn>().listIterator();
if(!results.isExhausted()) {
com.datastax.driver.core.Row row = results.one();
IndexColumn indexCol = Cql3Util.convertToIndexCol(row, indTable);
cachedLastCols.add(indexCol);
if(batchListener != null)
batchListener.afterFetchingNextBatch(10);
return new Holder<IndexColumn>(indexCol);
}