mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-18 10:54:54 +00:00
Rename InternalFilters.Bucket to InternalFilters.InternalBucket to avoid name collision
This commit is contained in:
parent
beec7ca9db
commit
690fb2cd3f
@ -112,16 +112,16 @@ public class FiltersAggregator extends BucketsAggregator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InternalAggregation buildAggregation(long owningBucketOrdinal) throws IOException {
|
public InternalAggregation buildAggregation(long owningBucketOrdinal) throws IOException {
|
||||||
List<InternalFilters.Bucket> buckets = new ArrayList<>(filters.length);
|
List<InternalFilters.InternalBucket> buckets = new ArrayList<>(filters.length);
|
||||||
for (int i = 0; i < keys.length; i++) {
|
for (int i = 0; i < keys.length; i++) {
|
||||||
long bucketOrd = bucketOrd(owningBucketOrdinal, i);
|
long bucketOrd = bucketOrd(owningBucketOrdinal, i);
|
||||||
InternalFilters.Bucket bucket = new InternalFilters.Bucket(keys[i], bucketDocCount(bucketOrd), bucketAggregations(bucketOrd), keyed);
|
InternalFilters.InternalBucket bucket = new InternalFilters.InternalBucket(keys[i], bucketDocCount(bucketOrd), bucketAggregations(bucketOrd), keyed);
|
||||||
buckets.add(bucket);
|
buckets.add(bucket);
|
||||||
}
|
}
|
||||||
// other bucket
|
// other bucket
|
||||||
if (showOtherBucket) {
|
if (showOtherBucket) {
|
||||||
long bucketOrd = bucketOrd(owningBucketOrdinal, keys.length);
|
long bucketOrd = bucketOrd(owningBucketOrdinal, keys.length);
|
||||||
InternalFilters.Bucket bucket = new InternalFilters.Bucket(otherBucketKey, bucketDocCount(bucketOrd),
|
InternalFilters.InternalBucket bucket = new InternalFilters.InternalBucket(otherBucketKey, bucketDocCount(bucketOrd),
|
||||||
bucketAggregations(bucketOrd), keyed);
|
bucketAggregations(bucketOrd), keyed);
|
||||||
buckets.add(bucket);
|
buckets.add(bucket);
|
||||||
}
|
}
|
||||||
@ -131,9 +131,9 @@ public class FiltersAggregator extends BucketsAggregator {
|
|||||||
@Override
|
@Override
|
||||||
public InternalAggregation buildEmptyAggregation() {
|
public InternalAggregation buildEmptyAggregation() {
|
||||||
InternalAggregations subAggs = buildEmptySubAggregations();
|
InternalAggregations subAggs = buildEmptySubAggregations();
|
||||||
List<InternalFilters.Bucket> buckets = new ArrayList<>(filters.length);
|
List<InternalFilters.InternalBucket> buckets = new ArrayList<>(filters.length);
|
||||||
for (int i = 0; i < keys.length; i++) {
|
for (int i = 0; i < keys.length; i++) {
|
||||||
InternalFilters.Bucket bucket = new InternalFilters.Bucket(keys[i], 0, subAggs, keyed);
|
InternalFilters.InternalBucket bucket = new InternalFilters.InternalBucket(keys[i], 0, subAggs, keyed);
|
||||||
buckets.add(bucket);
|
buckets.add(bucket);
|
||||||
}
|
}
|
||||||
return new InternalFilters(name, buckets, keyed, pipelineAggregators(), metaData());
|
return new InternalFilters(name, buckets, keyed, pipelineAggregators(), metaData());
|
||||||
|
@ -40,7 +40,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InternalFilters extends InternalMultiBucketAggregation<InternalFilters, InternalFilters.Bucket> implements Filters {
|
public class InternalFilters extends InternalMultiBucketAggregation<InternalFilters, InternalFilters.InternalBucket> implements Filters {
|
||||||
|
|
||||||
public final static Type TYPE = new Type("filters");
|
public final static Type TYPE = new Type("filters");
|
||||||
|
|
||||||
@ -53,16 +53,16 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private final static BucketStreams.Stream<Bucket> BUCKET_STREAM = new BucketStreams.Stream<Bucket>() {
|
private final static BucketStreams.Stream<InternalBucket> BUCKET_STREAM = new BucketStreams.Stream<InternalBucket>() {
|
||||||
@Override
|
@Override
|
||||||
public Bucket readResult(StreamInput in, BucketStreamContext context) throws IOException {
|
public InternalBucket readResult(StreamInput in, BucketStreamContext context) throws IOException {
|
||||||
Bucket filters = new Bucket(context.keyed());
|
InternalBucket filters = new InternalBucket(context.keyed());
|
||||||
filters.readFrom(in);
|
filters.readFrom(in);
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BucketStreamContext getBucketStreamContext(Bucket bucket) {
|
public BucketStreamContext getBucketStreamContext(InternalBucket bucket) {
|
||||||
BucketStreamContext context = new BucketStreamContext();
|
BucketStreamContext context = new BucketStreamContext();
|
||||||
context.keyed(bucket.keyed);
|
context.keyed(bucket.keyed);
|
||||||
return context;
|
return context;
|
||||||
@ -74,19 +74,19 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
BucketStreams.registerStream(BUCKET_STREAM, TYPE.stream());
|
BucketStreams.registerStream(BUCKET_STREAM, TYPE.stream());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Bucket extends InternalBucket implements Filters.Bucket {
|
public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements Filters.Bucket {
|
||||||
|
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
private String key;
|
private String key;
|
||||||
private long docCount;
|
private long docCount;
|
||||||
InternalAggregations aggregations;
|
InternalAggregations aggregations;
|
||||||
|
|
||||||
private Bucket(boolean keyed) {
|
private InternalBucket(boolean keyed) {
|
||||||
// for serialization
|
// for serialization
|
||||||
this.keyed = keyed;
|
this.keyed = keyed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bucket(String key, long docCount, InternalAggregations aggregations, boolean keyed) {
|
public InternalBucket(String key, long docCount, InternalAggregations aggregations, boolean keyed) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.docCount = docCount;
|
this.docCount = docCount;
|
||||||
this.aggregations = aggregations;
|
this.aggregations = aggregations;
|
||||||
@ -113,12 +113,12 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
return aggregations;
|
return aggregations;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bucket reduce(List<Bucket> buckets, ReduceContext context) {
|
InternalBucket reduce(List<InternalBucket> buckets, ReduceContext context) {
|
||||||
Bucket reduced = null;
|
InternalBucket reduced = null;
|
||||||
List<InternalAggregations> aggregationsList = new ArrayList<>(buckets.size());
|
List<InternalAggregations> aggregationsList = new ArrayList<>(buckets.size());
|
||||||
for (Bucket bucket : buckets) {
|
for (InternalBucket bucket : buckets) {
|
||||||
if (reduced == null) {
|
if (reduced == null) {
|
||||||
reduced = new Bucket(bucket.key, bucket.docCount, bucket.aggregations, bucket.keyed);
|
reduced = new InternalBucket(bucket.key, bucket.docCount, bucket.aggregations, bucket.keyed);
|
||||||
} else {
|
} else {
|
||||||
reduced.docCount += bucket.docCount;
|
reduced.docCount += bucket.docCount;
|
||||||
}
|
}
|
||||||
@ -156,13 +156,13 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Bucket> buckets;
|
private List<InternalBucket> buckets;
|
||||||
private Map<String, Bucket> bucketMap;
|
private Map<String, InternalBucket> bucketMap;
|
||||||
private boolean keyed;
|
private boolean keyed;
|
||||||
|
|
||||||
public InternalFilters() {} // for serialization
|
public InternalFilters() {} // for serialization
|
||||||
|
|
||||||
public InternalFilters(String name, List<Bucket> buckets, boolean keyed, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
|
public InternalFilters(String name, List<InternalBucket> buckets, boolean keyed, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
|
||||||
super(name, pipelineAggregators, metaData);
|
super(name, pipelineAggregators, metaData);
|
||||||
this.buckets = buckets;
|
this.buckets = buckets;
|
||||||
this.keyed = keyed;
|
this.keyed = keyed;
|
||||||
@ -174,25 +174,25 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InternalFilters create(List<Bucket> buckets) {
|
public InternalFilters create(List<InternalBucket> buckets) {
|
||||||
return new InternalFilters(this.name, buckets, this.keyed, this.pipelineAggregators(), this.metaData);
|
return new InternalFilters(this.name, buckets, this.keyed, this.pipelineAggregators(), this.metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bucket createBucket(InternalAggregations aggregations, Bucket prototype) {
|
public InternalBucket createBucket(InternalAggregations aggregations, InternalBucket prototype) {
|
||||||
return new Bucket(prototype.key, prototype.docCount, aggregations, prototype.keyed);
|
return new InternalBucket(prototype.key, prototype.docCount, aggregations, prototype.keyed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Bucket> getBuckets() {
|
public List<InternalBucket> getBuckets() {
|
||||||
return buckets;
|
return buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bucket getBucketByKey(String key) {
|
public InternalBucket getBucketByKey(String key) {
|
||||||
if (bucketMap == null) {
|
if (bucketMap == null) {
|
||||||
bucketMap = new HashMap<>(buckets.size());
|
bucketMap = new HashMap<>(buckets.size());
|
||||||
for (Bucket bucket : buckets) {
|
for (InternalBucket bucket : buckets) {
|
||||||
bucketMap.put(bucket.getKey(), bucket);
|
bucketMap.put(bucket.getKey(), bucket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -201,26 +201,26 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
|
public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
|
||||||
List<List<Bucket>> bucketsList = null;
|
List<List<InternalBucket>> bucketsList = null;
|
||||||
for (InternalAggregation aggregation : aggregations) {
|
for (InternalAggregation aggregation : aggregations) {
|
||||||
InternalFilters filters = (InternalFilters) aggregation;
|
InternalFilters filters = (InternalFilters) aggregation;
|
||||||
if (bucketsList == null) {
|
if (bucketsList == null) {
|
||||||
bucketsList = new ArrayList<>(filters.buckets.size());
|
bucketsList = new ArrayList<>(filters.buckets.size());
|
||||||
for (Bucket bucket : filters.buckets) {
|
for (InternalBucket bucket : filters.buckets) {
|
||||||
List<Bucket> sameRangeList = new ArrayList<>(aggregations.size());
|
List<InternalBucket> sameRangeList = new ArrayList<>(aggregations.size());
|
||||||
sameRangeList.add(bucket);
|
sameRangeList.add(bucket);
|
||||||
bucketsList.add(sameRangeList);
|
bucketsList.add(sameRangeList);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Bucket bucket : filters.buckets) {
|
for (InternalBucket bucket : filters.buckets) {
|
||||||
bucketsList.get(i++).add(bucket);
|
bucketsList.get(i++).add(bucket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalFilters reduced = new InternalFilters(name, new ArrayList<Bucket>(bucketsList.size()), keyed, pipelineAggregators(), getMetaData());
|
InternalFilters reduced = new InternalFilters(name, new ArrayList<InternalBucket>(bucketsList.size()), keyed, pipelineAggregators(), getMetaData());
|
||||||
for (List<Bucket> sameRangeList : bucketsList) {
|
for (List<InternalBucket> sameRangeList : bucketsList) {
|
||||||
reduced.buckets.add((sameRangeList.get(0)).reduce(sameRangeList, reduceContext));
|
reduced.buckets.add((sameRangeList.get(0)).reduce(sameRangeList, reduceContext));
|
||||||
}
|
}
|
||||||
return reduced;
|
return reduced;
|
||||||
@ -230,9 +230,9 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
protected void doReadFrom(StreamInput in) throws IOException {
|
protected void doReadFrom(StreamInput in) throws IOException {
|
||||||
keyed = in.readBoolean();
|
keyed = in.readBoolean();
|
||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
List<Bucket> buckets = new ArrayList<>(size);
|
List<InternalBucket> buckets = new ArrayList<>(size);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
Bucket bucket = new Bucket(keyed);
|
InternalBucket bucket = new InternalBucket(keyed);
|
||||||
bucket.readFrom(in);
|
bucket.readFrom(in);
|
||||||
buckets.add(bucket);
|
buckets.add(bucket);
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
protected void doWriteTo(StreamOutput out) throws IOException {
|
protected void doWriteTo(StreamOutput out) throws IOException {
|
||||||
out.writeBoolean(keyed);
|
out.writeBoolean(keyed);
|
||||||
out.writeVInt(buckets.size());
|
out.writeVInt(buckets.size());
|
||||||
for (Bucket bucket : buckets) {
|
for (InternalBucket bucket : buckets) {
|
||||||
bucket.writeTo(out);
|
bucket.writeTo(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ public class InternalFilters extends InternalMultiBucketAggregation<InternalFilt
|
|||||||
} else {
|
} else {
|
||||||
builder.startArray(CommonFields.BUCKETS);
|
builder.startArray(CommonFields.BUCKETS);
|
||||||
}
|
}
|
||||||
for (Bucket bucket : buckets) {
|
for (InternalBucket bucket : buckets) {
|
||||||
bucket.toXContent(builder, params);
|
bucket.toXContent(builder, params);
|
||||||
}
|
}
|
||||||
if (keyed) {
|
if (keyed) {
|
||||||
|
@ -124,7 +124,7 @@ public class DerivativePipelineAggregator extends PipelineAggregator {
|
|||||||
} else if (key instanceof Number) {
|
} else if (key instanceof Number) {
|
||||||
return ((Number) key).longValue();
|
return ((Number) key).longValue();
|
||||||
} else {
|
} else {
|
||||||
throw new AggregationExecutionException("Bucket keys must be either a Number or a DateTime for aggregation " + name()
|
throw new AggregationExecutionException("InternalBucket keys must be either a Number or a DateTime for aggregation " + name()
|
||||||
+ ". Found bucket with key " + key);
|
+ ". Found bucket with key " + key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class InternalProfileCollector implements Collector {
|
|||||||
/**
|
/**
|
||||||
* Creates a human-friendly representation of the Collector name.
|
* Creates a human-friendly representation of the Collector name.
|
||||||
*
|
*
|
||||||
* Bucket Collectors use the aggregation name in their toString() method,
|
* InternalBucket Collectors use the aggregation name in their toString() method,
|
||||||
* which makes the profiled output a bit nicer.
|
* which makes the profiled output a bit nicer.
|
||||||
*
|
*
|
||||||
* @param c The Collector to derive a name from
|
* @param c The Collector to derive a name from
|
||||||
|
@ -1243,7 +1243,7 @@ public class DateHistogramIT extends ESIntegTestCase {
|
|||||||
for (int i = 0; i < buckets.size(); i++) {
|
for (int i = 0; i < buckets.size(); i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
assertThat(bucket, notNullValue());
|
assertThat(bucket, notNullValue());
|
||||||
assertThat("Bucket " + i + " had wrong key", (DateTime) bucket.getKey(), equalTo(new DateTime(timeZoneStartToday.getMillis() + (i * 60 * 60 * 1000), DateTimeZone.UTC)));
|
assertThat("InternalBucket " + i + " had wrong key", (DateTime) bucket.getKey(), equalTo(new DateTime(timeZoneStartToday.getMillis() + (i * 60 * 60 * 1000), DateTimeZone.UTC)));
|
||||||
if (i == 0 || i == 12) {
|
if (i == 0 || i == 12) {
|
||||||
assertThat(bucket.getDocCount(), equalTo(1l));
|
assertThat(bucket.getDocCount(), equalTo(1l));
|
||||||
} else {
|
} else {
|
||||||
|
@ -238,7 +238,7 @@ public class GeoBoundsIT extends AbstractGeoTestCase {
|
|||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
Bucket bucket = buckets.get(i);
|
Bucket bucket = buckets.get(i);
|
||||||
assertThat(bucket, notNullValue());
|
assertThat(bucket, notNullValue());
|
||||||
assertThat("Bucket " + bucket.getKey() + " has wrong number of documents", bucket.getDocCount(), equalTo(1l));
|
assertThat("InternalBucket " + bucket.getKey() + " has wrong number of documents", bucket.getDocCount(), equalTo(1l));
|
||||||
GeoBounds geoBounds = bucket.getAggregations().get(aggName);
|
GeoBounds geoBounds = bucket.getAggregations().get(aggName);
|
||||||
assertThat(geoBounds, notNullValue());
|
assertThat(geoBounds, notNullValue());
|
||||||
assertThat(geoBounds.getName(), equalTo(aggName));
|
assertThat(geoBounds.getName(), equalTo(aggName));
|
||||||
|
@ -185,7 +185,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < numValueBuckets; ++i) {
|
for (int i = 0; i < numValueBuckets; ++i) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i * interval, valueCounts[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i * interval, valueCounts[i]);
|
||||||
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
assertThat(docCountDeriv, notNullValue());
|
assertThat(docCountDeriv, notNullValue());
|
||||||
@ -224,7 +224,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < numValueBuckets; ++i) {
|
for (int i = 0; i < numValueBuckets; ++i) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i * interval, valueCounts[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i * interval, valueCounts[i]);
|
||||||
Derivative docCountDeriv = bucket.getAggregations().get("deriv");
|
Derivative docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
assertThat(docCountDeriv, notNullValue());
|
assertThat(docCountDeriv, notNullValue());
|
||||||
@ -267,7 +267,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
// overwritten
|
// overwritten
|
||||||
for (int i = 0; i < numValueBuckets; ++i) {
|
for (int i = 0; i < numValueBuckets; ++i) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i * interval, valueCounts[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i * interval, valueCounts[i]);
|
||||||
Sum sum = bucket.getAggregations().get("sum");
|
Sum sum = bucket.getAggregations().get("sum");
|
||||||
assertThat(sum, notNullValue());
|
assertThat(sum, notNullValue());
|
||||||
long expectedSum = valueCounts[i] * (i * interval);
|
long expectedSum = valueCounts[i] * (i * interval);
|
||||||
@ -312,7 +312,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
// overwritten
|
// overwritten
|
||||||
for (int i = 0; i < numValueBuckets; ++i) {
|
for (int i = 0; i < numValueBuckets; ++i) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i * interval, valueCounts[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i * interval, valueCounts[i]);
|
||||||
Stats stats = bucket.getAggregations().get("stats");
|
Stats stats = bucket.getAggregations().get("stats");
|
||||||
assertThat(stats, notNullValue());
|
assertThat(stats, notNullValue());
|
||||||
long expectedSum = valueCounts[i] * (i * interval);
|
long expectedSum = valueCounts[i] * (i * interval);
|
||||||
@ -366,7 +366,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < numValueBuckets; ++i) {
|
for (int i = 0; i < numValueBuckets; ++i) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i * interval, valueCounts[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i * interval, valueCounts[i]);
|
||||||
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
assertThat(docCountDeriv, notNullValue());
|
assertThat(docCountDeriv, notNullValue());
|
||||||
@ -395,7 +395,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < valueCounts_empty.length; i++) {
|
for (int i = 0; i < valueCounts_empty.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i, valueCounts_empty[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i, valueCounts_empty[i]);
|
||||||
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (firstDerivValueCounts_empty[i] == null) {
|
if (firstDerivValueCounts_empty[i] == null) {
|
||||||
assertThat(docCountDeriv, nullValue());
|
assertThat(docCountDeriv, nullValue());
|
||||||
@ -425,7 +425,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < valueCounts_empty_rnd.length; i++) {
|
for (int i = 0; i < valueCounts_empty_rnd.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i, valueCounts_empty_rnd[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i, valueCounts_empty_rnd[i]);
|
||||||
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (firstDerivValueCounts_empty_rnd[i] == null) {
|
if (firstDerivValueCounts_empty_rnd[i] == null) {
|
||||||
assertThat(docCountDeriv, nullValue());
|
assertThat(docCountDeriv, nullValue());
|
||||||
@ -454,7 +454,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
for (int i = 0; i < valueCounts_empty.length; i++) {
|
for (int i = 0; i < valueCounts_empty.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i + ": ", bucket, i, valueCounts_empty[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i + ": ", bucket, i, valueCounts_empty[i]);
|
||||||
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
SimpleValue docCountDeriv = bucket.getAggregations().get("deriv");
|
||||||
if (firstDerivValueCounts_empty[i] == null) {
|
if (firstDerivValueCounts_empty[i] == null) {
|
||||||
assertThat(docCountDeriv, nullValue());
|
assertThat(docCountDeriv, nullValue());
|
||||||
@ -484,7 +484,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
double lastSumValue = Double.NaN;
|
double lastSumValue = Double.NaN;
|
||||||
for (int i = 0; i < valueCounts_empty.length; i++) {
|
for (int i = 0; i < valueCounts_empty.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i, valueCounts_empty[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i, valueCounts_empty[i]);
|
||||||
Sum sum = bucket.getAggregations().get("sum");
|
Sum sum = bucket.getAggregations().get("sum");
|
||||||
double thisSumValue = sum.value();
|
double thisSumValue = sum.value();
|
||||||
if (bucket.getDocCount() == 0) {
|
if (bucket.getDocCount() == 0) {
|
||||||
@ -526,7 +526,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
double lastSumValue = Double.NaN;
|
double lastSumValue = Double.NaN;
|
||||||
for (int i = 0; i < valueCounts_empty.length; i++) {
|
for (int i = 0; i < valueCounts_empty.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i, valueCounts_empty[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i, valueCounts_empty[i]);
|
||||||
Sum sum = bucket.getAggregations().get("sum");
|
Sum sum = bucket.getAggregations().get("sum");
|
||||||
double thisSumValue = sum.value();
|
double thisSumValue = sum.value();
|
||||||
if (bucket.getDocCount() == 0) {
|
if (bucket.getDocCount() == 0) {
|
||||||
@ -565,7 +565,7 @@ public class DerivativeIT extends ESIntegTestCase {
|
|||||||
double lastSumValue = Double.NaN;
|
double lastSumValue = Double.NaN;
|
||||||
for (int i = 0; i < valueCounts_empty_rnd.length; i++) {
|
for (int i = 0; i < valueCounts_empty_rnd.length; i++) {
|
||||||
Histogram.Bucket bucket = buckets.get(i);
|
Histogram.Bucket bucket = buckets.get(i);
|
||||||
checkBucketKeyAndDocCount("Bucket " + i, bucket, i, valueCounts_empty_rnd[i]);
|
checkBucketKeyAndDocCount("InternalBucket " + i, bucket, i, valueCounts_empty_rnd[i]);
|
||||||
Sum sum = bucket.getAggregations().get("sum");
|
Sum sum = bucket.getAggregations().get("sum");
|
||||||
double thisSumValue = sum.value();
|
double thisSumValue = sum.value();
|
||||||
if (bucket.getDocCount() == 0) {
|
if (bucket.getDocCount() == 0) {
|
||||||
|
@ -85,7 +85,7 @@ public class S3Repository extends BlobStoreRepository {
|
|||||||
|
|
||||||
String region = repositorySettings.settings().get("region", settings.get(REPOSITORY_S3.REGION));
|
String region = repositorySettings.settings().get("region", settings.get(REPOSITORY_S3.REGION));
|
||||||
if (region == null) {
|
if (region == null) {
|
||||||
// Bucket setting is not set - use global region setting
|
// InternalBucket setting is not set - use global region setting
|
||||||
String regionSetting = settings.get(CLOUD_AWS.REGION);
|
String regionSetting = settings.get(CLOUD_AWS.REGION);
|
||||||
if (regionSetting != null) {
|
if (regionSetting != null) {
|
||||||
regionSetting = regionSetting.toLowerCase(Locale.ENGLISH);
|
regionSetting = regionSetting.toLowerCase(Locale.ENGLISH);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user