@Override public PartitionIterator fetchPageInternal(int pageSize, ReadExecutionController executionController) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, executionController, System.nanoTime()); return new AggregationPartitionIterator(pageSize, executionController, System.nanoTime()); }
public final RowIterator next() { if (!hasNext()) throw new NoSuchElementException(); RowIterator iterator = new GroupByRowIterator(next); lastPartitionKey = iterator.partitionKey().getKey(); next = null; return iterator; }
/** * Loads the next <code>RowIterator</code> to be returned. */ private void fetchNextRowIterator() { if (partitionIterator == null) { initialMaxRemaining = subPager.maxRemaining(); partitionIterator = fetchSubPage(pageSize); } while (!partitionIterator.hasNext()) { partitionIterator.close(); int counted = initialMaxRemaining - subPager.maxRemaining(); if (isDone(pageSize, counted) || subPager.isExhausted()) { endOfData = true; closed = true; return; } subPager = updatePagerLimit(subPager, limits, lastPartitionKey, lastClustering); partitionIterator = fetchSubPage(computeSubPageSize(pageSize, counted)); } next = partitionIterator.next(); }
/** * Loads the next <code>RowIterator</code> to be returned. */ private void fetchNextRowIterator() { if (partitionIterator == null) { initialMaxRemaining = subPager.maxRemaining(); partitionIterator = fetchSubPage(pageSize); } while (!partitionIterator.hasNext()) { partitionIterator.close(); int counted = initialMaxRemaining - subPager.maxRemaining(); if (isDone(pageSize, counted) || subPager.isExhausted()) { endOfData = true; closed = true; return; } subPager = updatePagerLimit(subPager, limits, lastPartitionKey, lastClustering); partitionIterator = fetchSubPage(computeSubPageSize(pageSize, counted)); } next = partitionIterator.next(); }
/** * Loads the next <code>RowIterator</code> to be returned. */ private void fetchNextRowIterator() { if (partitionIterator == null) { initialMaxRemaining = subPager.maxRemaining(); partitionIterator = fetchSubPage(pageSize); } while (!partitionIterator.hasNext()) { partitionIterator.close(); int counted = initialMaxRemaining - subPager.maxRemaining(); if (isDone(pageSize, counted) || subPager.isExhausted()) { endOfData = true; closed = true; return; } subPager = updatePagerLimit(subPager, limits, lastPartitionKey, lastClustering); partitionIterator = fetchSubPage(computeSubPageSize(pageSize, counted)); } next = partitionIterator.next(); }
public boolean hasNext() { if (rowIterator.hasNext()) return true; DecoratedKey partitionKey = rowIterator.partitionKey(); rowIterator.close(); // Fetch the next RowIterator GroupByPartitionIterator.this.hasNext(); // if the previous page was ending within the partition the // next RowIterator is the continuation of this one if (next != null && partitionKey.equals(next.partitionKey())) { rowIterator = next; next = null; return rowIterator.hasNext(); } closed = true; return false; }
public boolean hasNext() { if (rowIterator.hasNext()) return true; DecoratedKey partitionKey = rowIterator.partitionKey(); rowIterator.close(); // Fetch the next RowIterator GroupByPartitionIterator.this.hasNext(); // if the previous page was ending within the partition the // next RowIterator is the continuation of this one if (next != null && partitionKey.equals(next.partitionKey())) { rowIterator = next; next = null; return rowIterator.hasNext(); } closed = true; return false; }
public boolean hasNext() { if (rowIterator.hasNext()) return true; DecoratedKey partitionKey = rowIterator.partitionKey(); rowIterator.close(); // Fetch the next RowIterator GroupByPartitionIterator.this.hasNext(); // if the previous page was ending within the partition the // next RowIterator is the continuation of this one if (next != null && partitionKey.equals(next.partitionKey())) { rowIterator = next; next = null; return rowIterator.hasNext(); } closed = true; return false; }
public final boolean hasNext() { if (endOfData) return false; if (next != null) return true; fetchNextRowIterator(); return next != null; }
private GroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, ReadExecutionController executionController, long queryStartNanoTime) { this.pageSize = handlePagingOff(pageSize); this.consistency = consistency; this.clientState = clientState; this.executionController = executionController; this.queryStartNanoTime = queryStartNanoTime; }
@Override public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); return new AggregationPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); }
private GroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, ReadExecutionController executionController, long queryStartNanoTime) { this.pageSize = handlePagingOff(pageSize); this.consistency = consistency; this.clientState = clientState; this.executionController = executionController; this.queryStartNanoTime = queryStartNanoTime; }
@Override public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); return new AggregationPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); }
private GroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, ReadExecutionController executionController, long queryStartNanoTime) { this.pageSize = handlePagingOff(pageSize); this.consistency = consistency; this.clientState = clientState; this.executionController = executionController; this.queryStartNanoTime = queryStartNanoTime; }
@Override public PartitionIterator fetchPageInternal(int pageSize, ReadExecutionController executionController) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, executionController, System.nanoTime()); return new AggregationPartitionIterator(pageSize, executionController, System.nanoTime()); }
@Override public PartitionIterator fetchPageInternal(int pageSize, ReadExecutionController executionController) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, executionController, System.nanoTime()); return new AggregationPartitionIterator(pageSize, executionController, System.nanoTime()); }
public final RowIterator next() { if (!hasNext()) throw new NoSuchElementException(); RowIterator iterator = new GroupByRowIterator(next); lastPartitionKey = iterator.partitionKey().getKey(); next = null; return iterator; }
@Override public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) { if (limits.isGroupByLimit()) return new GroupByPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); return new AggregationPartitionIterator(pageSize, consistency, clientState, queryStartNanoTime); }
public final boolean hasNext() { if (endOfData) return false; if (next != null) return true; fetchNextRowIterator(); return next != null; }
public final RowIterator next() { if (!hasNext()) throw new NoSuchElementException(); RowIterator iterator = new GroupByRowIterator(next); lastPartitionKey = iterator.partitionKey().getKey(); next = null; return iterator; }