/** * Move to next bucket, return true while move to a on heap bucket, return false while move to a spilled bucket * or there is no more bucket. */ private boolean moveToNextBucket() { scanCount++; if (scanCount > totalBucketNumber - 1) { return false; } // move to next bucket, update all the current bucket status with new bucket information. final int bucketArrayPos = scanCount >> this.bucketsPerSegmentBits; final int currentBucketInSegmentOffset = (scanCount & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; MemorySegment currentBucket = this.buckets[bucketArrayPos]; final int partitionNumber = currentBucket.get(currentBucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); if (p.isInMemory()) { setBucket(currentBucket, p.overflowSegments, p, currentBucketInSegmentOffset); return true; } else { return false; } }
/** * Move to next bucket, return true while move to a on heap bucket, return false while move to a spilled bucket * or there is no more bucket. */ private boolean moveToNextBucket() { scanCount++; if (scanCount > totalBucketNumber - 1) { return false; } // move to next bucket, update all the current bucket status with new bucket information. final int bucketArrayPos = scanCount >> this.bucketsPerSegmentBits; final int currentBucketInSegmentOffset = (scanCount & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; MemorySegment currentBucket = this.buckets[bucketArrayPos]; final int partitionNumber = currentBucket.get(currentBucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); if (p.isInMemory()) { setBucket(currentBucket, p.overflowSegments, p, currentBucketInSegmentOffset); return true; } else { return false; } }
/** * Move to next bucket, return true while move to a on heap bucket, return false while move to a spilled bucket * or there is no more bucket. */ private boolean moveToNextBucket() { scanCount++; if (scanCount > totalBucketNumber - 1) { return false; } // move to next bucket, update all the current bucket status with new bucket information. final int bucketArrayPos = scanCount >> this.bucketsPerSegmentBits; final int currentBucketInSegmentOffset = (scanCount & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; MemorySegment currentBucket = this.buckets[bucketArrayPos]; final int partitionNumber = currentBucket.get(currentBucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); if (p.isInMemory()) { setBucket(currentBucket, p.overflowSegments, p, currentBucketInSegmentOffset); return true; } else { return false; } }
/** * Move to next bucket, return true while move to a on heap bucket, return false while move to a spilled bucket * or there is no more bucket. */ private boolean moveToNextBucket() { scanCount++; if (scanCount > totalBucketNumber - 1) { return false; } // move to next bucket, update all the current bucket status with new bucket information. final int bucketArrayPos = scanCount >> this.bucketsPerSegmentBits; final int currentBucketInSegmentOffset = (scanCount & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; MemorySegment currentBucket = this.buckets[bucketArrayPos]; final int partitionNumber = currentBucket.get(currentBucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); if (p.isInMemory()) { setBucket(currentBucket, p.overflowSegments, p, currentBucketInSegmentOffset); return true; } else { return false; } }
protected boolean processUnmatchedBuildIter() throws IOException { if (this.unmatchedBuildVisited) { return false; } this.probeMatchedPhase = false; UnmatchedBuildIterator<BT, PT> unmatchedBuildIter = new UnmatchedBuildIterator<>(this.buildSideSerializer, this.numBuckets, this.bucketsPerSegmentBits, this.bucketsPerSegmentMask, this.buckets, this.partitionsBeingBuilt, probedSet); this.unmatchedBuildIterator = unmatchedBuildIter; // There maybe none unmatched build element, so we add a verification here to make sure we do not return (null, null) to user. if (unmatchedBuildIter.next() == null) { this.unmatchedBuildVisited = true; return false; } unmatchedBuildIter.back(); // While visit the unmatched build elements, the probe element is null, and the unmatchedBuildIterator // would iterate all the unmatched build elements, so we return false during the second calling of this method. this.unmatchedBuildVisited = true; return true; }
protected boolean processUnmatchedBuildIter() throws IOException { if (this.unmatchedBuildVisited) { return false; } this.probeMatchedPhase = false; UnmatchedBuildIterator<BT, PT> unmatchedBuildIter = new UnmatchedBuildIterator<>(this.buildSideSerializer, this.numBuckets, this.bucketsPerSegmentBits, this.bucketsPerSegmentMask, this.buckets, this.partitionsBeingBuilt, probedSet); this.unmatchedBuildIterator = unmatchedBuildIter; // There maybe none unmatched build element, so we add a verification here to make sure we do not return (null, null) to user. if (unmatchedBuildIter.next() == null) { this.unmatchedBuildVisited = true; return false; } unmatchedBuildIter.back(); // While visit the unmatched build elements, the probe element is null, and the unmatchedBuildIterator // would iterate all the unmatched build elements, so we return false during the second calling of this method. this.unmatchedBuildVisited = true; return true; }
protected boolean processUnmatchedBuildIter() throws IOException { if (this.unmatchedBuildVisited) { return false; } this.probeMatchedPhase = false; UnmatchedBuildIterator<BT, PT> unmatchedBuildIter = new UnmatchedBuildIterator<>(this.buildSideSerializer, this.numBuckets, this.bucketsPerSegmentBits, this.bucketsPerSegmentMask, this.buckets, this.partitionsBeingBuilt, probedSet); this.unmatchedBuildIterator = unmatchedBuildIter; // There maybe none unmatched build element, so we add a verification here to make sure we do not return (null, null) to user. if (unmatchedBuildIter.next() == null) { this.unmatchedBuildVisited = true; return false; } unmatchedBuildIter.back(); // While visit the unmatched build elements, the probe element is null, and the unmatchedBuildIterator // would iterate all the unmatched build elements, so we return false during the second calling of this method. this.unmatchedBuildVisited = true; return true; }
protected boolean processUnmatchedBuildIter() throws IOException { if (this.unmatchedBuildVisited) { return false; } this.probeMatchedPhase = false; UnmatchedBuildIterator<BT, PT> unmatchedBuildIter = new UnmatchedBuildIterator<>(this.buildSideSerializer, this.numBuckets, this.bucketsPerSegmentBits, this.bucketsPerSegmentMask, this.buckets, this.partitionsBeingBuilt, probedSet); this.unmatchedBuildIterator = unmatchedBuildIter; // There maybe none unmatched build element, so we add a verification here to make sure we do not return (null, null) to user. if (unmatchedBuildIter.next() == null) { this.unmatchedBuildVisited = true; return false; } unmatchedBuildIter.back(); // While visit the unmatched build elements, the probe element is null, and the unmatchedBuildIterator // would iterate all the unmatched build elements, so we return false during the second calling of this method. this.unmatchedBuildVisited = true; return true; }
UnmatchedBuildIterator( TypeSerializer<BT> accessor, long totalBucketNumber, int bucketsPerSegmentBits, int bucketsPerSegmentMask, MemorySegment[] buckets, ArrayList<HashPartition<BT, PT>> partitionsBeingBuilt, BitSet probedSet) { this.accessor = accessor; this.totalBucketNumber = totalBucketNumber; this.bucketsPerSegmentBits = bucketsPerSegmentBits; this.bucketsPerSegmentMask = bucketsPerSegmentMask; this.buckets = buckets; this.partitionsBeingBuilt = partitionsBeingBuilt; this.probedSet = probedSet; init(); }
UnmatchedBuildIterator( TypeSerializer<BT> accessor, long totalBucketNumber, int bucketsPerSegmentBits, int bucketsPerSegmentMask, MemorySegment[] buckets, ArrayList<HashPartition<BT, PT>> partitionsBeingBuilt, BitSet probedSet) { this.accessor = accessor; this.totalBucketNumber = totalBucketNumber; this.bucketsPerSegmentBits = bucketsPerSegmentBits; this.bucketsPerSegmentMask = bucketsPerSegmentMask; this.buckets = buckets; this.partitionsBeingBuilt = partitionsBeingBuilt; this.probedSet = probedSet; init(); }
UnmatchedBuildIterator( TypeSerializer<BT> accessor, long totalBucketNumber, int bucketsPerSegmentBits, int bucketsPerSegmentMask, MemorySegment[] buckets, ArrayList<HashPartition<BT, PT>> partitionsBeingBuilt, BitSet probedSet) { this.accessor = accessor; this.totalBucketNumber = totalBucketNumber; this.bucketsPerSegmentBits = bucketsPerSegmentBits; this.bucketsPerSegmentMask = bucketsPerSegmentMask; this.buckets = buckets; this.partitionsBeingBuilt = partitionsBeingBuilt; this.probedSet = probedSet; init(); }
UnmatchedBuildIterator( TypeSerializer<BT> accessor, long totalBucketNumber, int bucketsPerSegmentBits, int bucketsPerSegmentMask, MemorySegment[] buckets, ArrayList<HashPartition<BT, PT>> partitionsBeingBuilt, BitSet probedSet) { this.accessor = accessor; this.totalBucketNumber = totalBucketNumber; this.bucketsPerSegmentBits = bucketsPerSegmentBits; this.bucketsPerSegmentMask = bucketsPerSegmentMask; this.buckets = buckets; this.partitionsBeingBuilt = partitionsBeingBuilt; this.probedSet = probedSet; init(); }
public BT next() { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next() { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next(BT reuse) { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(reuse); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next() { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next() { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next(BT reuse) { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(reuse); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next(BT reuse) { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(reuse); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }
public BT next(BT reuse) { // search unprobed record in bucket, while none found move to next bucket and search. while (true) { BT result = nextInBucket(reuse); if (result == null) { // return null while there are no more buckets. if (!moveToNextOnHeapBucket()) { return null; } } else { return result; } } }