private Pager(DataLimits pageLimits, int nowInSec) { this.counter = pageLimits.newCounter(nowInSec, true, command.selectsFullPartition(), enforceStrictLiveness); this.pageLimits = pageLimits; }
private Pager(DataLimits pageLimits, int nowInSec) { this.counter = pageLimits.newCounter(nowInSec, true, command.selectsFullPartition(), enforceStrictLiveness); this.pageLimits = pageLimits; }
public PartitionIterator filter(PartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData, boolean enforceStrictLiveness) { return this.newCounter(nowInSec, true, countPartitionsWithOnlyStaticData, enforceStrictLiveness).applyTo(iter); }
public PartitionIterator filter(PartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData, boolean enforceStrictLiveness) { return this.newCounter(nowInSec, true, countPartitionsWithOnlyStaticData, enforceStrictLiveness).applyTo(iter); }
public PartitionIterator filter(PartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData, boolean enforceStrictLiveness) { return this.newCounter(nowInSec, true, countPartitionsWithOnlyStaticData, enforceStrictLiveness).applyTo(iter); }
private Pager(DataLimits pageLimits, int nowInSec) { this.counter = pageLimits.newCounter(nowInSec, true, command.selectsFullPartition(), enforceStrictLiveness); this.pageLimits = pageLimits; }
private PartitionIterator sendNextRequests() { List<PartitionIterator> concurrentQueries = new ArrayList<>(concurrencyFactor); for (int i = 0; i < concurrencyFactor && ranges.hasNext(); i++) { concurrentQueries.add(query(ranges.next(), i == 0)); ++rangesQueried; } Tracing.trace("Submitted {} concurrent range requests", concurrentQueries.size()); // We want to count the results for the sake of updating the concurrency factor (see updateConcurrencyFactor) but we don't want to // enforce any particular limit at this point (this could break code than rely on postReconciliationProcessing), hence the DataLimits.NONE. counter = DataLimits.NONE.newCounter(command.nowInSec(), true, command.selectsFullPartition(), enforceStrictLiveness); return counter.applyTo(PartitionIterators.concat(concurrentQueries)); }
private PartitionIterator sendNextRequests() { List<PartitionIterator> concurrentQueries = new ArrayList<>(concurrencyFactor); for (int i = 0; i < concurrencyFactor && ranges.hasNext(); i++) { concurrentQueries.add(query(ranges.next(), i == 0)); ++rangesQueried; } Tracing.trace("Submitted {} concurrent range requests", concurrentQueries.size()); // We want to count the results for the sake of updating the concurrency factor (see updateConcurrencyFactor) but we don't want to // enforce any particular limit at this point (this could break code than rely on postReconciliationProcessing), hence the DataLimits.NONE. counter = DataLimits.NONE.newCounter(command.nowInSec(), true, command.selectsFullPartition(), enforceStrictLiveness); return counter.applyTo(PartitionIterators.concat(concurrentQueries)); }
private PartitionIterator sendNextRequests() { List<PartitionIterator> concurrentQueries = new ArrayList<>(concurrencyFactor); for (int i = 0; i < concurrencyFactor && ranges.hasNext(); i++) { concurrentQueries.add(query(ranges.next(), i == 0)); ++rangesQueried; } Tracing.trace("Submitted {} concurrent range requests", concurrentQueries.size()); // We want to count the results for the sake of updating the concurrency factor (see updateConcurrencyFactor) but we don't want to // enforce any particular limit at this point (this could break code than rely on postReconciliationProcessing), hence the DataLimits.NONE. counter = DataLimits.NONE.newCounter(command.nowInSec(), true, command.selectsFullPartition(), enforceStrictLiveness); return counter.applyTo(PartitionIterators.concat(concurrentQueries)); }
public UnfilteredPartitionIterator filter(UnfilteredPartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
public UnfilteredPartitionIterator filter(UnfilteredPartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
public UnfilteredPartitionIterator filter(UnfilteredPartitionIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
public UnfilteredRowIterator filter(UnfilteredRowIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
public UnfilteredRowIterator filter(UnfilteredRowIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
public UnfilteredRowIterator filter(UnfilteredRowIterator iter, int nowInSec, boolean countPartitionsWithOnlyStaticData) { return this.newCounter(nowInSec, false, countPartitionsWithOnlyStaticData, iter.metadata().enforceStrictLiveness()) .applyTo(iter); }
DataLimits.Counter counter = limits.newCounter(nowInSec, true, command.selectsFullPartition(), metadata.enforceStrictLiveness()); PartitionIterators.consume(counter.applyTo(iter)); count += counter.counted();
private UnfilteredPartitionIterator extendWithShortReadProtection(UnfilteredPartitionIterator partitions, InetAddress source, DataLimits.Counter mergedResultCounter) { DataLimits.Counter singleResultCounter = command.limits().newCounter(command.nowInSec(), false, command.selectsFullPartition(), enforceStrictLiveness).onlyCount(); ShortReadPartitionsProtection protection = new ShortReadPartitionsProtection(source, singleResultCounter, mergedResultCounter, queryStartNanoTime); /* * The order of extention and transformations is important here. Extending with more partitions has to happen * first due to the way BaseIterator.hasMoreContents() works: only transformations applied after extension will * be called on the first partition of the extended iterator. * * Additionally, we want singleResultCounter to be applied after SRPP, so that its applyToPartition() method will * be called last, after the extension done by SRRP.applyToPartition() call. That way we preserve the same order * when it comes to calling SRRP.moreContents() and applyToRow() callbacks. * * See ShortReadPartitionsProtection.applyToPartition() for more details. */ // extend with moreContents() only if it's a range read command with no partition key specified if (!command.isLimitedToOnePartition()) partitions = MorePartitions.extend(partitions, protection); // register SRPP.moreContents() partitions = Transformation.apply(partitions, protection); // register SRPP.applyToPartition() partitions = Transformation.apply(partitions, singleResultCounter); // register the per-source counter return partitions; }
private UnfilteredPartitionIterator extendWithShortReadProtection(UnfilteredPartitionIterator partitions, InetAddress source, DataLimits.Counter mergedResultCounter) { DataLimits.Counter singleResultCounter = command.limits().newCounter(command.nowInSec(), false, command.selectsFullPartition(), enforceStrictLiveness).onlyCount(); ShortReadPartitionsProtection protection = new ShortReadPartitionsProtection(source, singleResultCounter, mergedResultCounter, queryStartNanoTime); /* * The order of extention and transformations is important here. Extending with more partitions has to happen * first due to the way BaseIterator.hasMoreContents() works: only transformations applied after extension will * be called on the first partition of the extended iterator. * * Additionally, we want singleResultCounter to be applied after SRPP, so that its applyToPartition() method will * be called last, after the extension done by SRRP.applyToPartition() call. That way we preserve the same order * when it comes to calling SRRP.moreContents() and applyToRow() callbacks. * * See ShortReadPartitionsProtection.applyToPartition() for more details. */ // extend with moreContents() only if it's a range read command with no partition key specified if (!command.isLimitedToOnePartition()) partitions = MorePartitions.extend(partitions, protection); // register SRPP.moreContents() partitions = Transformation.apply(partitions, protection); // register SRPP.applyToPartition() partitions = Transformation.apply(partitions, singleResultCounter); // register the per-source counter return partitions; }
private UnfilteredPartitionIterator extendWithShortReadProtection(UnfilteredPartitionIterator partitions, InetAddress source, DataLimits.Counter mergedResultCounter) { DataLimits.Counter singleResultCounter = command.limits().newCounter(command.nowInSec(), false, command.selectsFullPartition(), enforceStrictLiveness).onlyCount(); ShortReadPartitionsProtection protection = new ShortReadPartitionsProtection(source, singleResultCounter, mergedResultCounter, queryStartNanoTime); /* * The order of extention and transformations is important here. Extending with more partitions has to happen * first due to the way BaseIterator.hasMoreContents() works: only transformations applied after extension will * be called on the first partition of the extended iterator. * * Additionally, we want singleResultCounter to be applied after SRPP, so that its applyToPartition() method will * be called last, after the extension done by SRRP.applyToPartition() call. That way we preserve the same order * when it comes to calling SRRP.moreContents() and applyToRow() callbacks. * * See ShortReadPartitionsProtection.applyToPartition() for more details. */ // extend with moreContents() only if it's a range read command with no partition key specified if (!command.isLimitedToOnePartition()) partitions = MorePartitions.extend(partitions, protection); // register SRPP.moreContents() partitions = Transformation.apply(partitions, protection); // register SRPP.applyToPartition() partitions = Transformation.apply(partitions, singleResultCounter); // register the per-source counter return partitions; }
DataLimits.Counter counter = limits.newCounter(nowInSec, true, command.selectsFullPartition(), metadata.enforceStrictLiveness()); PartitionIterators.consume(counter.applyTo(iter)); count += counter.counted();