summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range
diff options
context:
space:
mode:
authorSimon Willnauer <simon.willnauer@elasticsearch.com>2016-07-14 13:21:10 +0200
committerGitHub <noreply@github.com>2016-07-14 13:21:10 +0200
commit5616251f22be3824e44f634de83934e7157a8f29 (patch)
tree6ff03fc673ee79227ab3f9cb6ea3e79ae5d34508 /core/src/main/java/org/elasticsearch/search/aggregations/bucket/range
parent4156a4bebb5a811604216196090524f6c989eecd (diff)
Remove `node.mode` and `node.local` settings (#19428)
Today `node.mode` and `node.local` serve almost the same purpose, they are a shortcut for `discovery.type` and `transport.type`. If `node.local: true` or `node.mode: local` is set elasticsearch will start in _local_ mode which means only nodes within the same JVM are discovered and a non-network based transport is used. The _local_ mode it only really used in tests or if nodes are embedded. For both, embedding and tests explicit configuration via `discovery.type` and `transport.type` should be preferred. This change removes all the usage of these settings and by-default doesn't configure a default transport implemenation since netty is now a module. Yet, to make the user expericence flawless, plugins or modules can set a `http.type.default` and `transport.type.default`. Plugins set this via `PluginService#additionalSettings()` which enforces _set-once_ which prevents node startup if set multiple times. This means that our distributions will just startup with netty transport since it's packaged as a module unless `transport.type` or `http.transport.type` is explicitly set. This change also found a bunch of bugs since several NamedWriteables were not registered if a transport client is used. Now that we don't rely on the `node.mode` leniency which is inherited instead of using explicit settings, `TransportClient` uses `AssertingLocalTransport` which detects these problems since it serializes all messages. Closes #16234
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/aggregations/bucket/range')
-rw-r--r--core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java
index 072165e1b8..e7e7533088 100644
--- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java
+++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java
@@ -199,7 +199,7 @@ public class InternalRange<B extends InternalRange.Bucket, R extends InternalRan
@SuppressWarnings("unchecked")
public R create(String name, List<B> ranges, DocValueFormat formatter, boolean keyed, List<PipelineAggregator> pipelineAggregators,
Map<String, Object> metaData) {
- return (R) new InternalRange<>(name, ranges, formatter, keyed, pipelineAggregators, metaData);
+ return (R) new InternalRange<B, R>(name, ranges, formatter, keyed, pipelineAggregators, metaData);
}
@SuppressWarnings("unchecked")
@@ -210,7 +210,7 @@ public class InternalRange<B extends InternalRange.Bucket, R extends InternalRan
@SuppressWarnings("unchecked")
public R create(List<B> ranges, R prototype) {
- return (R) new InternalRange<>(prototype.name, ranges, prototype.format, prototype.keyed, prototype.pipelineAggregators(),
+ return (R) new InternalRange<B, R>(prototype.name, ranges, prototype.format, prototype.keyed, prototype.pipelineAggregators(),
prototype.metaData);
}
@@ -295,7 +295,7 @@ public class InternalRange<B extends InternalRange.Bucket, R extends InternalRan
public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
List<Bucket>[] rangeList = new List[ranges.size()];
for (int i = 0; i < rangeList.length; ++i) {
- rangeList[i] = new ArrayList<Bucket>();
+ rangeList[i] = new ArrayList<>();
}
for (InternalAggregation aggregation : aggregations) {
InternalRange<B, R> ranges = (InternalRange<B, R>) aggregation;