@Test public void testEqualityWithReference() { try { TypePairComparator<T, R> comparator = getComparator(true); Tuple2<T[], R[]> data = getSortedData(); for (int x = 0; x < data.f0.length; x++) { comparator.setReference(data.f0[x]); assertTrue(comparator.equalToReference(data.f1[x])); } } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); fail("Exception in test: " + e.getMessage()); } }
pairComparator.setReference(left); for (IN2 right : matchingHashes) { if (pairComparator.equalToReference(right)) {
protected void testGreatSmallAscDescWithReference(boolean ascending) { try { Tuple2<T[], R[]> data = getSortedData(); TypePairComparator<T, R> comparator = getComparator(ascending); //compares every element in high with every element in low for (int x = 0; x < data.f0.length - 1; x++) { for (int y = x + 1; y < data.f1.length; y++) { comparator.setReference(data.f0[x]); if (ascending) { assertTrue(comparator.compareToReference(data.f1[y]) > 0); } else { assertTrue(comparator.compareToReference(data.f1[y]) < 0); } } } } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); fail("Exception in test: " + e.getMessage()); } }
this.pairComparator.setReference(iterator1.getValues().getCurrent()); firstEmpty = false;
public HashBucketIterator<BT, PT> getMatchesFor(PT record) throws IOException { final TypeComparator<PT> probeAccessors = this.probeSideComparator; final int hash = hash(probeAccessors.hash(record), this.currentRecursionDepth); final int posHashCode = hash % this.numBuckets; // get the bucket for the given hash code final int bucketArrayPos = posHashCode >> this.bucketsPerSegmentBits; final int bucketInSegmentOffset = (posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; final MemorySegment bucket = this.buckets[bucketArrayPos]; // get the basic characteristics of the bucket final int partitionNumber = bucket.get(bucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); // for an in-memory partition, process set the return iterators, else spill the probe records if (p.isInMemory()) { this.recordComparator.setReference(record); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return this.bucketIterator; } else { throw new IllegalStateException("Method is not applicable to partially spilled hash tables."); } }
public HashBucketIterator<BT, PT> getMatchesFor(PT record) throws IOException { final TypeComparator<PT> probeAccessors = this.probeSideComparator; final int hash = hash(probeAccessors.hash(record), this.currentRecursionDepth); final int posHashCode = hash % this.numBuckets; // get the bucket for the given hash code final int bucketArrayPos = posHashCode >> this.bucketsPerSegmentBits; final int bucketInSegmentOffset = (posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; final MemorySegment bucket = this.buckets[bucketArrayPos]; // get the basic characteristics of the bucket final int partitionNumber = bucket.get(bucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); // for an in-memory partition, process set the return iterators, else spill the probe records if (p.isInMemory()) { this.recordComparator.setReference(record); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return this.bucketIterator; } else { throw new IllegalStateException("Method is not applicable to partially spilled hash tables."); } }
public HashBucketIterator<BT, PT> getMatchesFor(PT record) throws IOException { final TypeComparator<PT> probeAccessors = this.probeSideComparator; final int hash = hash(probeAccessors.hash(record), this.currentRecursionDepth); final int posHashCode = hash % this.numBuckets; // get the bucket for the given hash code final int bucketArrayPos = posHashCode >> this.bucketsPerSegmentBits; final int bucketInSegmentOffset = (posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; final MemorySegment bucket = this.buckets[bucketArrayPos]; // get the basic characteristics of the bucket final int partitionNumber = bucket.get(bucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); // for an in-memory partition, process set the return iterators, else spill the probe records if (p.isInMemory()) { this.recordComparator.setReference(record); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return this.bucketIterator; } else { throw new IllegalStateException("Method is not applicable to partially spilled hash tables."); } }
public HashBucketIterator<BT, PT> getMatchesFor(PT record) throws IOException { final TypeComparator<PT> probeAccessors = this.probeSideComparator; final int hash = hash(probeAccessors.hash(record), this.currentRecursionDepth); final int posHashCode = hash % this.numBuckets; // get the bucket for the given hash code final int bucketArrayPos = posHashCode >> this.bucketsPerSegmentBits; final int bucketInSegmentOffset = (posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS; final MemorySegment bucket = this.buckets[bucketArrayPos]; // get the basic characteristics of the bucket final int partitionNumber = bucket.get(bucketInSegmentOffset + HEADER_PARTITION_OFFSET); final HashPartition<BT, PT> p = this.partitionsBeingBuilt.get(partitionNumber); // for an in-memory partition, process set the return iterators, else spill the probe records if (p.isInMemory()) { this.recordComparator.setReference(record); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return this.bucketIterator; } else { throw new IllegalStateException("Method is not applicable to partially spilled hash tables."); } }
pairComparator.setReference(left); for (IN2 right : matchingHashes) { if (pairComparator.equalToReference(right)) {
} else { if (this.iterator1.nextKey()) { this.comp.setReference(this.iterator1.getCurrent()); firstEmpty = false;
} else { if (this.iterator1.nextKey()) { this.comp.setReference(this.iterator1.getCurrent()); firstEmpty = false;
this.pairComparator.setReference(iterator1.getValues().getCurrent()); firstEmpty = false;
comparator.setReference(this.iterator1.getCurrent()); T2 current2 = this.iterator2.getCurrent(); return false; comparator.setReference(this.iterator1.getCurrent());
this.recordComparator.setReference(next); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return true;
this.recordComparator.setReference(next); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return true;
comparator.setReference(this.iterator1.getCurrent()); T2 current2 = this.iterator2.getCurrent(); return false; comparator.setReference(this.iterator1.getCurrent());
comparator.setReference(this.iterator1.getCurrent()); T2 current2 = this.iterator2.getCurrent(); return false; comparator.setReference(this.iterator1.getCurrent());
this.recordComparator.setReference(next); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return true;
comparator.setReference(this.iterator1.getCurrent()); T2 current2 = this.iterator2.getCurrent(); return false; comparator.setReference(this.iterator1.getCurrent());
this.recordComparator.setReference(next); this.bucketIterator.set(bucket, p.overflowSegments, p, hash, bucketInSegmentOffset); return true;