Skip to content

Commit

Permalink
Revert "Adds tests for cardinality and filter aggregations (#23826)"
Browse files Browse the repository at this point in the history
This reverts commit 058869e.
  • Loading branch information
colings86 committed Apr 3, 2017
1 parent 058869e commit cad4fcd
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 360 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
* Hyperloglog++ counter, implemented based on pseudo code from
Expand Down Expand Up @@ -423,32 +420,6 @@ public void close() {
Releasables.close(runLens, hashSet.sizes);
}

private Set<Object> getComparableData(long bucket) {
Set<Object> values = new HashSet<>();
if (algorithm.get(bucket) == LINEAR_COUNTING) {
try (IntArray hashSetValues = hashSet.values(bucket)) {
for (long i = 0; i < hashSetValues.size(); i++) {
values.add(hashSetValues.get(i));
}
}
} else {
for (long i = 0; i < runLens.size(); i++) {
values.add(runLens.get((bucket << p) + i));
}
}
return values;
}

public int hashCode(long bucket) {
return Objects.hash(p, algorithm.get(bucket), getComparableData(bucket));
}

public boolean equals(long bucket, HyperLogLogPlusPlus other) {
return Objects.equals(p, other.p) &&
Objects.equals(algorithm.get(bucket), other.algorithm.get(bucket)) &&
Objects.equals(getComparableData(bucket), getComparableData(bucket));
}

/**
* We are actually using HyperLogLog's runLens array but interpreting it as a hash set
* for linear counting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,4 @@ public XContentBuilder doXContentBody(XContentBuilder builder, Params params) th
return builder;
}

@Override
protected int doHashCode() {
return counts.hashCode(0);
}

@Override
protected boolean doEquals(Object obj) {
InternalCardinality other = (InternalCardinality) obj;
return counts.equals(0, other.counts);
}

HyperLogLogPlusPlus getState() {
return counts;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit cad4fcd

Please sign in to comment.