Ejemplo n.º 1
0
  public boolean equivalent(QuantileDigest other) {
    rescaleToCommonLandmark(this, other);

    return (totalNodeCount == other.totalNodeCount
        && nonZeroNodeCount == other.nonZeroNodeCount
        && min == other.min
        && max == other.max
        && weightedCount == other.weightedCount
        && Objects.equal(root, other.root));
  }
Ejemplo n.º 2
0
  public void merge(QuantileDigest other) {
    rescaleToCommonLandmark(this, other);

    // 2. merge other into this (don't modify other)
    root = merge(root, other.root);

    max = Math.max(max, other.max);
    min = Math.min(min, other.min);

    // 3. compress to remove unnecessary nodes
    compress();
  }