|
@@ -18,7 +18,6 @@
|
|
|
*/
|
|
|
package org.elasticsearch.search.aggregations.bucket.histogram;
|
|
|
|
|
|
-import com.google.common.primitives.Longs;
|
|
|
import org.elasticsearch.common.xcontent.ToXContent;
|
|
|
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
|
|
|
|
|
@@ -72,23 +71,23 @@ public interface Histogram extends MultiBucketsAggregation {
|
|
|
public static final Order KEY_ASC = new InternalOrder((byte) 1, "_key", true, new Comparator<InternalHistogram.Bucket>() {
|
|
|
@Override
|
|
|
public int compare(InternalHistogram.Bucket b1, InternalHistogram.Bucket b2) {
|
|
|
- return Longs.compare(b1.key, b2.key);
|
|
|
+ return Long.compare(b1.key, b2.key);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
public static final Order KEY_DESC = new InternalOrder((byte) 2, "_key", false, new Comparator<InternalHistogram.Bucket>() {
|
|
|
@Override
|
|
|
public int compare(InternalHistogram.Bucket b1, InternalHistogram.Bucket b2) {
|
|
|
- return -Longs.compare(b1.key, b2.key);
|
|
|
+ return -Long.compare(b1.key, b2.key);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
public static final Order COUNT_ASC = new InternalOrder((byte) 3, "_count", true, new Comparator<InternalHistogram.Bucket>() {
|
|
|
@Override
|
|
|
public int compare(InternalHistogram.Bucket b1, InternalHistogram.Bucket b2) {
|
|
|
- int cmp = Longs.compare(b1.getDocCount(), b2.getDocCount());
|
|
|
+ int cmp = Long.compare(b1.getDocCount(), b2.getDocCount());
|
|
|
if (cmp == 0) {
|
|
|
- cmp = Longs.compare(b1.key, b2.key);
|
|
|
+ cmp = Long.compare(b1.key, b2.key);
|
|
|
}
|
|
|
return cmp;
|
|
|
}
|
|
@@ -98,9 +97,9 @@ public interface Histogram extends MultiBucketsAggregation {
|
|
|
public static final Order COUNT_DESC = new InternalOrder((byte) 4, "_count", false, new Comparator<InternalHistogram.Bucket>() {
|
|
|
@Override
|
|
|
public int compare(InternalHistogram.Bucket b1, InternalHistogram.Bucket b2) {
|
|
|
- int cmp = -Longs.compare(b1.getDocCount(), b2.getDocCount());
|
|
|
+ int cmp = -Long.compare(b1.getDocCount(), b2.getDocCount());
|
|
|
if (cmp == 0) {
|
|
|
- cmp = Longs.compare(b1.key, b2.key);
|
|
|
+ cmp = Long.compare(b1.key, b2.key);
|
|
|
}
|
|
|
return cmp;
|
|
|
}
|