c-dickens commented on code in PR #582:
URL: https://github.com/apache/datasketches-java/pull/582#discussion_r1679616809


##########
src/main/java/org/apache/datasketches/filters/quotientfilter/QuotientFilter.java:
##########
@@ -632,4 +636,27 @@ public void computeStatistics() {
     avgClusterLength_ = sumClusterLengths / numClusters_;
   }
 
-}
+  public void merge(final QuotientFilter other) {
+    if (lgQ_ + numFingerprintBits_ != other.lgQ_ + other.numFingerprintBits_) {
+      throw new SketchesArgumentException("incompatible sketches in merge");
+    }
+    long i = 0;
+    if (!other.isSlotEmpty(i)) { i = other.findClusterStart(i); }
+
+    final Queue<Long> fifo = new LinkedList<Long>();
+    long count = 0;
+    while (count < other.numEntries_) {
+      if (!other.isSlotEmpty(i)) {
+        if (other.isOccupied(i)) { fifo.add(i); }
+        final long quotient = fifo.element();
+        final long fingerprint = other.getFingerprint(i);
+        final long hash = quotient << other.getFingerprintLength() | 
fingerprint;
+        System.out.println("q=" + quotient + ", fp=" + fingerprint + ", hash=" 
+ hash);

Review Comment:
   Should this print statement be removed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to