if(batchListener != null)
batchListener.beforeFetchingNextBatch();
loadBatchIfNeeded();
if(cachedLastCols != null && cachedLastCols.hasNext()) {
Column<byte[]> col = cachedLastCols.next();
IndexColumn indexedCol = CursorColumnSlice.convertToIndexCol(col);
return new Holder<IndexColumn>(indexedCol);
}
while(true) {
if(!theOneBatch.hasNext())
return null;
Future<OperationResult<ColumnList<byte[]>>> future = theOneBatch.next();
OperationResult<ColumnList<byte[]>> results = get(future);
ColumnList<byte[]> columnList = results.getResult();
cachedLastCols = columnList.iterator();
if(cachedLastCols.hasNext()) {
Column<byte[]> col = cachedLastCols.next();
IndexColumn indexCol = CursorColumnSlice.convertToIndexCol(col);
if(batchListener != null)
batchListener.afterFetchingNextBatch(columnList.size());
return new Holder<IndexColumn>(indexCol);
}