/** * @param bucketSource An instance of {@link BucketSource}, providing the working set for * the iterator * @param progressToken A {@link ProgressToken} instance, allowing the progress of * finished or partially finished buckets to be tracked * * @see BucketSource * @see ProgressToken */ private VisitorIterator(ProgressToken progressToken, BucketSource bucketSource) { assert(progressToken.getDistributionBitCount() == bucketSource.getDistributionBitCount()) : "inconsistent distribution bit counts"; this.distributionBitCount = progressToken.getDistributionBitCount(); this.progressToken = progressToken; this.bucketSource = bucketSource; }
int delta = distributionBitCount - progressToken.getDistributionBitCount(); if (log.isLoggable(LogLevel.DEBUG)) { log.log(LogLevel.DEBUG, "Increasing distribution bits for full bucket " + "space range source from " + progressToken.getDistributionBitCount() + " to " + distributionBitCount); if (log.isLoggable(LogLevel.DEBUG)) { log.log(LogLevel.DEBUG, "Decreasing distribution bits for full bucket " + "space range source from " + progressToken.getDistributionBitCount() + " to " + distributionBitCount + " bits");
public ExplicitBucketSource(Set<BucketId> superbuckets, int distributionBitCount, ProgressToken progress) { this.distributionBitCount = progress.getDistributionBitCount(); this.totalBucketCount = superbuckets.size(); "current document selection"); this.distributionBitCount = progress.getDistributionBitCount();
assert(progressToken.getDistributionBitCount() == distributionBitCount);
this.distributionBitCount = progressToken.getDistributionBitCount(); if (progressToken.getTotalBucketCount() != (1L << progressToken.getDistributionBitCount())) { throw new IllegalArgumentException("Total bucket count in existing progress is not " + "consistent with that of the current document selection"); if (log.isLoggable(LogLevel.DEBUG)) { log.log(LogLevel.DEBUG, "Importing unfinished progress token with " + "bits: " + progressToken.getDistributionBitCount() + ", active: " + progressToken.getActiveBucketCount() + ", pending: " + progressToken.getPendingBucketCount() + correctInconsistentPending(progressToken.getDistributionBitCount());
assert(progressToken.getDistributionBitCount() == bucketSource.getDistributionBitCount()) : "inconsistent distribution bit counts for progress and source"; assert(hasNext());