Skip to content

Commit a9d6a58

Browse files
committed
Merge remote-tracking branch 'elastic/master' into geoshape-doc-values
2 parents 87c3e92 + bb62ebf commit a9d6a58

File tree

796 files changed

+12807
-5868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

796 files changed

+12807
-5868
lines changed

.ci/dockerOnLinuxExclusions

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ debian-8
88
opensuse-15-1
99
ol-7.7
1010
sles-12
11+
12+
# These OSes are deprecated and filtered starting with 8.0.0, but need to be excluded
13+
# for PR checks
14+
centos-6
15+
ol-6.10

.ci/matrix-build-javas.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.ci/matrix-java-exclusions.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.ci/packer_cache.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export JAVA8_HOME="${HOME}"/.java/java8
2222
export JAVA11_HOME="${HOME}"/.java/java11
2323
export JAVA12_HOME="${HOME}"/.java/openjdk12
2424
export JAVA13_HOME="${HOME}"/.java/openjdk13
25-
./gradlew --parallel clean --scan -Porg.elasticsearch.acceptScanTOS=true -s resolveAllDependencies
25+
./gradlew --parallel clean -s resolveAllDependencies
2626

buildSrc/src/main/java/org/elasticsearch/gradle/testfixtures/TestFixturesPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void apply(Project project) {
136136

137137
if (dockerComposeSupported() == false) {
138138
project.getLogger()
139-
.warn(
139+
.info(
140140
"Tests for {} require docker-compose at /usr/local/bin/docker-compose or /usr/bin/docker-compose "
141141
+ "but none could be found so these will be skipped",
142142
project.getPath()

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 8.0.0
2-
lucene = 8.5.0-snapshot-3333ce7da6d
2+
lucene = 8.5.0-snapshot-d62f6307658
33

44
bundled_jdk_vendor = adoptopenjdk
55
bundled_jdk = 13.0.2+8

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public List<RestHandler> getRestHandlers(Settings settings, RestController restC
5555
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
5656
Supplier<DiscoveryNodes> nodesInCluster) {
5757
return Arrays.asList(
58-
new RestNoopBulkAction(restController),
59-
new RestNoopSearchAction(restController));
58+
new RestNoopBulkAction(),
59+
new RestNoopSearchAction());
6060
}
6161
}

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,28 @@
3232
import org.elasticsearch.rest.BaseRestHandler;
3333
import org.elasticsearch.rest.BytesRestResponse;
3434
import org.elasticsearch.rest.RestChannel;
35-
import org.elasticsearch.rest.RestController;
3635
import org.elasticsearch.rest.RestRequest;
3736
import org.elasticsearch.rest.RestResponse;
3837
import org.elasticsearch.rest.action.RestBuilderListener;
3938

4039
import java.io.IOException;
40+
import java.util.List;
4141

42+
import static java.util.Arrays.asList;
43+
import static java.util.Collections.unmodifiableList;
4244
import static org.elasticsearch.rest.RestRequest.Method.POST;
4345
import static org.elasticsearch.rest.RestRequest.Method.PUT;
4446
import static org.elasticsearch.rest.RestStatus.OK;
4547

4648
public class RestNoopBulkAction extends BaseRestHandler {
4749

48-
public RestNoopBulkAction(RestController controller) {
49-
controller.registerHandler(POST, "/_noop_bulk", this);
50-
controller.registerHandler(PUT, "/_noop_bulk", this);
51-
controller.registerHandler(POST, "/{index}/_noop_bulk", this);
52-
controller.registerHandler(PUT, "/{index}/_noop_bulk", this);
50+
@Override
51+
public List<Route> routes() {
52+
return unmodifiableList(asList(
53+
new Route(POST, "/_noop_bulk"),
54+
new Route(PUT, "/_noop_bulk"),
55+
new Route(POST, "/{index}/_noop_bulk"),
56+
new Route(PUT, "/{index}/_noop_bulk")));
5357
}
5458

5559
@Override

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/RestNoopSearchAction.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,25 @@
2121
import org.elasticsearch.action.search.SearchRequest;
2222
import org.elasticsearch.client.node.NodeClient;
2323
import org.elasticsearch.rest.BaseRestHandler;
24-
import org.elasticsearch.rest.RestController;
2524
import org.elasticsearch.rest.RestRequest;
2625
import org.elasticsearch.rest.action.RestStatusToXContentListener;
2726

27+
import java.util.List;
28+
29+
import static java.util.Arrays.asList;
30+
import static java.util.Collections.unmodifiableList;
2831
import static org.elasticsearch.rest.RestRequest.Method.GET;
2932
import static org.elasticsearch.rest.RestRequest.Method.POST;
3033

3134
public class RestNoopSearchAction extends BaseRestHandler {
3235

33-
public RestNoopSearchAction(RestController controller) {
34-
controller.registerHandler(GET, "/_noop_search", this);
35-
controller.registerHandler(POST, "/_noop_search", this);
36-
controller.registerHandler(GET, "/{index}/_noop_search", this);
37-
controller.registerHandler(POST, "/{index}/_noop_search", this);
36+
@Override
37+
public List<Route> routes() {
38+
return unmodifiableList(asList(
39+
new Route(GET, "/_noop_search"),
40+
new Route(POST, "/_noop_search"),
41+
new Route(GET, "/{index}/_noop_search"),
42+
new Route(POST, "/{index}/_noop_search")));
3843
}
3944

4045
@Override

client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121

2222
import org.elasticsearch.action.get.GetRequest;
2323
import org.elasticsearch.client.Validatable;
24-
import org.elasticsearch.common.xcontent.ToXContentObject;
25-
import org.elasticsearch.common.xcontent.XContentBuilder;
2624
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
2725

28-
import java.io.IOException;
29-
30-
public final class GetSourceRequest implements Validatable, ToXContentObject {
26+
public final class GetSourceRequest implements Validatable {
3127
private String routing;
3228
private String preference;
3329

@@ -36,8 +32,8 @@ public final class GetSourceRequest implements Validatable, ToXContentObject {
3632

3733
private FetchSourceContext fetchSourceContext;
3834

39-
private String index;
40-
private String id;
35+
private final String index;
36+
private final String id;
4137

4238
public GetSourceRequest(String index, String id) {
4339
this.index = index;
@@ -101,11 +97,6 @@ public GetSourceRequest fetchSourceContext(FetchSourceContext context) {
10197
return this;
10298
}
10399

104-
@Override
105-
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
106-
return null;
107-
}
108-
109100
public String index() {
110101
return index;
111102
}

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Ensemble.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public String getName() {
103103
@Override
104104
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
105105
builder.startObject();
106-
if (featureNames != null) {
106+
if (featureNames != null && featureNames.isEmpty() == false) {
107107
builder.field(FEATURE_NAMES.getPreferredName(), featureNames);
108108
}
109109
if (models != null) {
@@ -157,7 +157,7 @@ public static Builder builder() {
157157
}
158158

159159
public static class Builder {
160-
private List<String> featureNames;
160+
private List<String> featureNames = Collections.emptyList();
161161
private List<TrainedModel> trainedModels;
162162
private OutputAggregator outputAggregator;
163163
private TargetType targetType;

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNode.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class TreeNode implements ToXContentObject {
4242
public static final ParseField NODE_INDEX = new ParseField("node_index");
4343
public static final ParseField SPLIT_GAIN = new ParseField("split_gain");
4444
public static final ParseField LEAF_VALUE = new ParseField("leaf_value");
45+
public static final ParseField NUMBER_SAMPLES = new ParseField("number_samples");
4546

4647

4748
private static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>(
@@ -61,6 +62,7 @@ public class TreeNode implements ToXContentObject {
6162
PARSER.declareInt(Builder::setNodeIndex, NODE_INDEX);
6263
PARSER.declareDouble(Builder::setSplitGain, SPLIT_GAIN);
6364
PARSER.declareDouble(Builder::setLeafValue, LEAF_VALUE);
65+
PARSER.declareLong(Builder::setNumberSamples, NUMBER_SAMPLES);
6466
}
6567

6668
public static Builder fromXContent(XContentParser parser) {
@@ -76,6 +78,7 @@ public static Builder fromXContent(XContentParser parser) {
7678
private final Boolean defaultLeft;
7779
private final Integer leftChild;
7880
private final Integer rightChild;
81+
private final Long numberSamples;
7982

8083

8184
TreeNode(Operator operator,
@@ -86,7 +89,8 @@ public static Builder fromXContent(XContentParser parser) {
8689
Double leafValue,
8790
Boolean defaultLeft,
8891
Integer leftChild,
89-
Integer rightChild) {
92+
Integer rightChild,
93+
Long numberSamples) {
9094
this.operator = operator;
9195
this.threshold = threshold;
9296
this.splitFeature = splitFeature;
@@ -96,6 +100,7 @@ public static Builder fromXContent(XContentParser parser) {
96100
this.defaultLeft = defaultLeft;
97101
this.leftChild = leftChild;
98102
this.rightChild = rightChild;
103+
this.numberSamples = numberSamples;
99104
}
100105

101106
public Operator getOperator() {
@@ -134,6 +139,10 @@ public Integer getRightChild() {
134139
return rightChild;
135140
}
136141

142+
public Long getNumberSamples() {
143+
return numberSamples;
144+
}
145+
137146
@Override
138147
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
139148
builder.startObject();
@@ -146,6 +155,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
146155
addOptionalField(builder, DEFAULT_LEFT, defaultLeft );
147156
addOptionalField(builder, LEFT_CHILD, leftChild);
148157
addOptionalField(builder, RIGHT_CHILD, rightChild);
158+
addOptionalField(builder, NUMBER_SAMPLES, numberSamples);
149159
builder.endObject();
150160
return builder;
151161
}
@@ -169,7 +179,8 @@ public boolean equals(Object o) {
169179
&& Objects.equals(leafValue, that.leafValue)
170180
&& Objects.equals(defaultLeft, that.defaultLeft)
171181
&& Objects.equals(leftChild, that.leftChild)
172-
&& Objects.equals(rightChild, that.rightChild);
182+
&& Objects.equals(rightChild, that.rightChild)
183+
&& Objects.equals(numberSamples, that.numberSamples);
173184
}
174185

175186
@Override
@@ -182,7 +193,8 @@ public int hashCode() {
182193
leafValue,
183194
defaultLeft,
184195
leftChild,
185-
rightChild);
196+
rightChild,
197+
numberSamples);
186198
}
187199

188200
@Override
@@ -204,6 +216,7 @@ public static class Builder {
204216
private Boolean defaultLeft;
205217
private Integer leftChild;
206218
private Integer rightChild;
219+
private Long numberSamples;
207220

208221
public Builder(int nodeIndex) {
209222
this.nodeIndex = nodeIndex;
@@ -265,6 +278,11 @@ public Integer getRightChild() {
265278
return rightChild;
266279
}
267280

281+
public Builder setNumberSamples(Long numberSamples) {
282+
this.numberSamples = numberSamples;
283+
return this;
284+
}
285+
268286
public TreeNode build() {
269287
return new TreeNode(operator,
270288
threshold,
@@ -274,7 +292,8 @@ public TreeNode build() {
274292
leafValue,
275293
defaultLeft,
276294
leftChild,
277-
rightChild);
295+
rightChild,
296+
numberSamples);
278297
}
279298
}
280299
}

client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ public static class ClusterPrivilegeName {
318318
public static final String MANAGE_OIDC = "manage_oidc";
319319
public static final String MANAGE_TOKEN = "manage_token";
320320
public static final String MANAGE_PIPELINE = "manage_pipeline";
321+
public static final String MANAGE_AUTOSCALING = "manage_autoscaling";
321322
public static final String MANAGE_CCR = "manage_ccr";
322323
public static final String READ_CCR = "read_ccr";
323324
public static final String MANAGE_ILM = "manage_ilm";
@@ -326,8 +327,8 @@ public static class ClusterPrivilegeName {
326327
public static final String[] ALL_ARRAY = new String[] { NONE, ALL, MONITOR, MONITOR_TRANSFORM_DEPRECATED, MONITOR_TRANSFORM,
327328
MONITOR_ML, MONITOR_WATCHER, MONITOR_ROLLUP, MANAGE, MANAGE_TRANSFORM_DEPRECATED, MANAGE_TRANSFORM,
328329
MANAGE_ML, MANAGE_WATCHER, MANAGE_ROLLUP, MANAGE_INDEX_TEMPLATES, MANAGE_INGEST_PIPELINES, TRANSPORT_CLIENT,
329-
MANAGE_SECURITY, MANAGE_SAML, MANAGE_OIDC, MANAGE_TOKEN, MANAGE_PIPELINE, MANAGE_CCR, READ_CCR, MANAGE_ILM, READ_ILM,
330-
MANAGE_ENRICH };
330+
MANAGE_SECURITY, MANAGE_SAML, MANAGE_OIDC, MANAGE_TOKEN, MANAGE_PIPELINE, MANAGE_AUTOSCALING, MANAGE_CCR, READ_CCR,
331+
MANAGE_ILM, READ_ILM, MANAGE_ENRICH };
331332
}
332333

333334
/**

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/EnsembleTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static Ensemble createRandom(TargetType targetType) {
8686
.toArray() :
8787
null;
8888

89-
return new Ensemble(featureNames,
89+
return new Ensemble(randomBoolean() ? featureNames : Collections.emptyList(),
9090
models,
9191
outputAggregator,
9292
targetType,

client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNodeTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static TreeNode createRandomLeafNode(double internalValue) {
4949
return TreeNode.builder(randomInt(100))
5050
.setDefaultLeft(randomBoolean() ? null : randomBoolean())
5151
.setLeafValue(internalValue)
52+
.setNumberSamples(randomNonNegativeLong())
5253
.build();
5354
}
5455

@@ -63,6 +64,7 @@ public static TreeNode.Builder createRandom(int nodeIndex,
6364
.setDefaultLeft(randomBoolean() ? null : randomBoolean())
6465
.setLeftChild(left)
6566
.setRightChild(right)
67+
.setNumberSamples(randomBoolean() ? null : randomNonNegativeLong())
6668
.setThreshold(threshold)
6769
.setOperator(operator)
6870
.setSplitFeature(featureIndex)

distribution/archives/build.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ task createPluginsDir(type: EmptyDirTask) {
4444
dir = "${pluginsDir}"
4545
dirMode = 0755
4646
}
47+
ext.jvmOptionsDir = new File(buildDir, 'jvm-options-hack/jvm.options.d')
48+
task createJvmOptionsDir(type: EmptyDirTask) {
49+
dir = "${jvmOptionsDir}"
50+
dirMode = 0750
51+
}
4752

4853
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, boolean oss, boolean jdk) {
4954
return copySpec {
@@ -55,6 +60,10 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
5560
dirMode 0750
5661
fileMode 0660
5762
with configFiles(distributionType, oss, jdk)
63+
from {
64+
dirMode 0750
65+
jvmOptionsDir.getParent()
66+
}
5867
}
5968
into('bin') {
6069
with binFiles(distributionType, oss, jdk)
@@ -94,7 +103,7 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
94103

95104
// common config across all zip/tar
96105
tasks.withType(AbstractArchiveTask) {
97-
dependsOn createLogsDir, createPluginsDir
106+
dependsOn createLogsDir, createPluginsDir, createJvmOptionsDir
98107
String subdir = it.name.substring('build'.size()).replaceAll(/[A-Z]/) { '-' + it.toLowerCase() }.substring(1)
99108
destinationDir = file("${subdir}/build/distributions")
100109
baseName = "elasticsearch${subdir.contains('oss') ? '-oss' : ''}"

distribution/docker/src/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ ${source_elasticsearch}
3030
RUN tar zxf /opt/${elasticsearch} --strip-components=1
3131
RUN grep ES_DISTRIBUTION_TYPE=tar /usr/share/elasticsearch/bin/elasticsearch-env \
3232
&& sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' /usr/share/elasticsearch/bin/elasticsearch-env
33-
RUN mkdir -p config data logs
34-
RUN chmod 0775 config data logs
33+
RUN mkdir -p config config/jvm.options.d data logs
34+
RUN chmod 0775 config config/jvm.options.d data logs
3535
COPY config/elasticsearch.yml config/log4j2.properties config/
3636
RUN chmod 0660 config/elasticsearch.yml config/log4j2.properties
3737

0 commit comments

Comments
 (0)