Skip to content

Commit 00f6480

Browse files
committed
Merge branch 'master' into auto-follow-license
* master: (30 commits) Include fallback settings when checking dependencies (elastic#33522) [DOCS] Fixing formatting issues in breaking changes CRUD: Disable wait for refresh tests with delete Test: Fix test name (elastic#33510) HLRC: split ingest request converters (elastic#33435) Logging: Configure the node name when we have it (elastic#32983) HLRC: split xpack request converters (elastic#33444) HLRC: split watcher request converters (elastic#33442) HLRC: add enable and disable user API support (elastic#33481) [DOCS] Fixes formatting error TEST: Ensure merge triggered in _source retention test (elastic#33487) [ML] Add a file structure determination endpoint (elastic#33471) HLRC: ML Forecast Job (elastic#33506) HLRC: split migration request converters (elastic#33436) HLRC: split snapshot request converters (elastic#33439) Make Watcher validation message copy/pasteable Removes redundant test method in SQL tests (elastic#33498) HLRC: ML Post Data (elastic#33443) Pass Directory instead of DirectoryService to Store (elastic#33466) Collapse package structure for metrics aggs (elastic#33463) ...
2 parents 2aeeae7 + 9a404f3 commit 00f6480

File tree

415 files changed

+5472
-3240
lines changed

Some content is hidden

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

415 files changed

+5472
-3240
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,13 @@ class ClusterFormationTasks {
337337
if (node.nodeVersion.major >= 7) {
338338
esConfig['indices.breaker.total.use_real_memory'] = false
339339
}
340-
esConfig.putAll(node.config.settings)
340+
for (Map.Entry<String, Object> setting : node.config.settings) {
341+
if (setting.value == null) {
342+
esConfig.remove(setting.key)
343+
} else {
344+
esConfig.put(setting.key, setting.value)
345+
}
346+
}
341347

342348
Task writeConfig = project.tasks.create(name: name, type: DefaultTask, dependsOn: setup)
343349
writeConfig.doFirst {

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,7 @@
360360
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsAggregator.java" checks="LineLength" />
361361
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsAggregatorFactory.java" checks="LineLength" />
362362
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]support[/\\]IncludeExclude.java" checks="LineLength" />
363-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]cardinality[/\\]CardinalityAggregator.java" checks="LineLength" />
364-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]cardinality[/\\]HyperLogLogPlusPlus.java" checks="LineLength" />
365-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]geobounds[/\\]GeoBoundsAggregator.java" checks="LineLength" />
366-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]geocentroid[/\\]InternalGeoCentroid.java" checks="LineLength" />
367-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]tdigest[/\\]TDigestPercentileRanksAggregator.java" checks="LineLength" />
368-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]tdigest[/\\]TDigestPercentilesAggregator.java" checks="LineLength" />
369-
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]scripted[/\\]ScriptedMetricAggregator.java" checks="LineLength" />
363+
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]HyperLogLogPlusPlus.java" checks="LineLength" />
370364
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]AggregationPath.java" checks="LineLength" />
371365
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]dfs[/\\]AggregatedDfs.java" checks="LineLength" />
372366
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]dfs[/\\]DfsSearchResult.java" checks="LineLength" />
@@ -641,8 +635,6 @@
641635
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]TermsDocCountErrorIT.java" checks="LineLength" />
642636
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]TermsShardMinDocCountIT.java" checks="LineLength" />
643637
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]nested[/\\]NestedAggregatorTests.java" checks="LineLength" />
644-
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]AbstractGeoTestCase.java" checks="LineLength" />
645-
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]TopHitsIT.java" checks="LineLength" />
646638
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]ExtendedStatsBucketIT.java" checks="LineLength" />
647639
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]moving[/\\]avg[/\\]MovAvgIT.java" checks="LineLength" />
648640
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]serialdiff[/\\]SerialDiffIT.java" checks="LineLength" />

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class GraphClient {
4343
*/
4444
public final GraphExploreResponse explore(GraphExploreRequest graphExploreRequest,
4545
RequestOptions options) throws IOException {
46-
return restHighLevelClient.performRequestAndParseEntity(graphExploreRequest, RequestConverters::xPackGraphExplore,
46+
return restHighLevelClient.performRequestAndParseEntity(graphExploreRequest, GraphRequestConverters::explore,
4747
options, GraphExploreResponse::fromXContext, emptySet());
4848
}
4949

@@ -56,7 +56,7 @@ public final GraphExploreResponse explore(GraphExploreRequest graphExploreReques
5656
public final void exploreAsync(GraphExploreRequest graphExploreRequest,
5757
RequestOptions options,
5858
ActionListener<GraphExploreResponse> listener) {
59-
restHighLevelClient.performRequestAsyncAndParseEntity(graphExploreRequest, RequestConverters::xPackGraphExplore,
59+
restHighLevelClient.performRequestAsyncAndParseEntity(graphExploreRequest, GraphRequestConverters::explore,
6060
options, GraphExploreResponse::fromXContext, listener, emptySet());
6161
}
6262

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.elasticsearch.client;
21+
22+
import org.apache.http.client.methods.HttpGet;
23+
import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest;
24+
25+
import java.io.IOException;
26+
27+
public class GraphRequestConverters {
28+
29+
static Request explore(GraphExploreRequest exploreRequest) throws IOException {
30+
String endpoint = RequestConverters.endpoint(exploreRequest.indices(), exploreRequest.types(), "_xpack/graph/_explore");
31+
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
32+
request.setEntity(RequestConverters.createEntity(exploreRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
33+
return request;
34+
}
35+
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public final class IngestClient {
5555
* @throws IOException in case there is a problem sending the request or parsing back the response
5656
*/
5757
public AcknowledgedResponse putPipeline(PutPipelineRequest request, RequestOptions options) throws IOException {
58-
return restHighLevelClient.performRequestAndParseEntity( request, RequestConverters::putPipeline, options,
58+
return restHighLevelClient.performRequestAndParseEntity( request, IngestRequestConverters::putPipeline, options,
5959
AcknowledgedResponse::fromXContent, emptySet());
6060
}
6161

@@ -68,7 +68,7 @@ public AcknowledgedResponse putPipeline(PutPipelineRequest request, RequestOptio
6868
* @param listener the listener to be notified upon request completion
6969
*/
7070
public void putPipelineAsync(PutPipelineRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
71-
restHighLevelClient.performRequestAsyncAndParseEntity( request, RequestConverters::putPipeline, options,
71+
restHighLevelClient.performRequestAsyncAndParseEntity( request, IngestRequestConverters::putPipeline, options,
7272
AcknowledgedResponse::fromXContent, listener, emptySet());
7373
}
7474

@@ -82,7 +82,7 @@ public void putPipelineAsync(PutPipelineRequest request, RequestOptions options,
8282
* @throws IOException in case there is a problem sending the request or parsing back the response
8383
*/
8484
public GetPipelineResponse getPipeline(GetPipelineRequest request, RequestOptions options) throws IOException {
85-
return restHighLevelClient.performRequestAndParseEntity( request, RequestConverters::getPipeline, options,
85+
return restHighLevelClient.performRequestAndParseEntity( request, IngestRequestConverters::getPipeline, options,
8686
GetPipelineResponse::fromXContent, emptySet());
8787
}
8888

@@ -95,7 +95,7 @@ public GetPipelineResponse getPipeline(GetPipelineRequest request, RequestOption
9595
* @param listener the listener to be notified upon request completion
9696
*/
9797
public void getPipelineAsync(GetPipelineRequest request, RequestOptions options, ActionListener<GetPipelineResponse> listener) {
98-
restHighLevelClient.performRequestAsyncAndParseEntity( request, RequestConverters::getPipeline, options,
98+
restHighLevelClient.performRequestAsyncAndParseEntity( request, IngestRequestConverters::getPipeline, options,
9999
GetPipelineResponse::fromXContent, listener, emptySet());
100100
}
101101

@@ -110,7 +110,7 @@ public void getPipelineAsync(GetPipelineRequest request, RequestOptions options,
110110
* @throws IOException in case there is a problem sending the request or parsing back the response
111111
*/
112112
public AcknowledgedResponse deletePipeline(DeletePipelineRequest request, RequestOptions options) throws IOException {
113-
return restHighLevelClient.performRequestAndParseEntity( request, RequestConverters::deletePipeline, options,
113+
return restHighLevelClient.performRequestAndParseEntity( request, IngestRequestConverters::deletePipeline, options,
114114
AcknowledgedResponse::fromXContent, emptySet());
115115
}
116116

@@ -124,7 +124,7 @@ public AcknowledgedResponse deletePipeline(DeletePipelineRequest request, Reques
124124
* @param listener the listener to be notified upon request completion
125125
*/
126126
public void deletePipelineAsync(DeletePipelineRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
127-
restHighLevelClient.performRequestAsyncAndParseEntity( request, RequestConverters::deletePipeline, options,
127+
restHighLevelClient.performRequestAsyncAndParseEntity( request, IngestRequestConverters::deletePipeline, options,
128128
AcknowledgedResponse::fromXContent, listener, emptySet());
129129
}
130130

@@ -140,7 +140,7 @@ public void deletePipelineAsync(DeletePipelineRequest request, RequestOptions op
140140
* @throws IOException in case there is a problem sending the request or parsing back the response
141141
*/
142142
public SimulatePipelineResponse simulate(SimulatePipelineRequest request, RequestOptions options) throws IOException {
143-
return restHighLevelClient.performRequestAndParseEntity( request, RequestConverters::simulatePipeline, options,
143+
return restHighLevelClient.performRequestAndParseEntity( request, IngestRequestConverters::simulatePipeline, options,
144144
SimulatePipelineResponse::fromXContent, emptySet());
145145
}
146146

@@ -157,7 +157,7 @@ public SimulatePipelineResponse simulate(SimulatePipelineRequest request, Reques
157157
public void simulateAsync(SimulatePipelineRequest request,
158158
RequestOptions options,
159159
ActionListener<SimulatePipelineResponse> listener) {
160-
restHighLevelClient.performRequestAsyncAndParseEntity( request, RequestConverters::simulatePipeline, options,
160+
restHighLevelClient.performRequestAsyncAndParseEntity( request, IngestRequestConverters::simulatePipeline, options,
161161
SimulatePipelineResponse::fromXContent, listener, emptySet());
162162
}
163163
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.elasticsearch.client;
21+
22+
import org.apache.http.client.methods.HttpDelete;
23+
import org.apache.http.client.methods.HttpGet;
24+
import org.apache.http.client.methods.HttpPost;
25+
import org.apache.http.client.methods.HttpPut;
26+
import org.elasticsearch.action.ingest.DeletePipelineRequest;
27+
import org.elasticsearch.action.ingest.GetPipelineRequest;
28+
import org.elasticsearch.action.ingest.PutPipelineRequest;
29+
import org.elasticsearch.action.ingest.SimulatePipelineRequest;
30+
31+
import java.io.IOException;
32+
33+
public class IngestRequestConverters {
34+
35+
static Request getPipeline(GetPipelineRequest getPipelineRequest) {
36+
String endpoint = new RequestConverters.EndpointBuilder()
37+
.addPathPartAsIs("_ingest/pipeline")
38+
.addCommaSeparatedPathParts(getPipelineRequest.getIds())
39+
.build();
40+
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
41+
42+
RequestConverters.Params parameters = new RequestConverters.Params(request);
43+
parameters.withMasterTimeout(getPipelineRequest.masterNodeTimeout());
44+
return request;
45+
}
46+
47+
static Request putPipeline(PutPipelineRequest putPipelineRequest) throws IOException {
48+
String endpoint = new RequestConverters.EndpointBuilder()
49+
.addPathPartAsIs("_ingest/pipeline")
50+
.addPathPart(putPipelineRequest.getId())
51+
.build();
52+
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
53+
54+
RequestConverters.Params parameters = new RequestConverters.Params(request);
55+
parameters.withTimeout(putPipelineRequest.timeout());
56+
parameters.withMasterTimeout(putPipelineRequest.masterNodeTimeout());
57+
58+
request.setEntity(RequestConverters.createEntity(putPipelineRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
59+
return request;
60+
}
61+
62+
static Request deletePipeline(DeletePipelineRequest deletePipelineRequest) {
63+
String endpoint = new RequestConverters.EndpointBuilder()
64+
.addPathPartAsIs("_ingest/pipeline")
65+
.addPathPart(deletePipelineRequest.getId())
66+
.build();
67+
Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
68+
69+
RequestConverters.Params parameters = new RequestConverters.Params(request);
70+
parameters.withTimeout(deletePipelineRequest.timeout());
71+
parameters.withMasterTimeout(deletePipelineRequest.masterNodeTimeout());
72+
73+
return request;
74+
}
75+
76+
static Request simulatePipeline(SimulatePipelineRequest simulatePipelineRequest) throws IOException {
77+
RequestConverters.EndpointBuilder builder = new RequestConverters.EndpointBuilder().addPathPartAsIs("_ingest/pipeline");
78+
if (simulatePipelineRequest.getId() != null && !simulatePipelineRequest.getId().isEmpty()) {
79+
builder.addPathPart(simulatePipelineRequest.getId());
80+
}
81+
builder.addPathPartAsIs("_simulate");
82+
String endpoint = builder.build();
83+
Request request = new Request(HttpPost.METHOD_NAME, endpoint);
84+
RequestConverters.Params params = new RequestConverters.Params(request);
85+
params.putParam("verbose", Boolean.toString(simulatePipelineRequest.isVerbose()));
86+
request.setEntity(RequestConverters.createEntity(simulatePipelineRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
87+
return request;
88+
}
89+
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public final class LicenseClient {
6565
* @throws IOException in case there is a problem sending the request or parsing back the response
6666
*/
6767
public PutLicenseResponse putLicense(PutLicenseRequest request, RequestOptions options) throws IOException {
68-
return restHighLevelClient.performRequestAndParseEntity(request, RequestConverters::putLicense, options,
68+
return restHighLevelClient.performRequestAndParseEntity(request, LicenseRequestConverters::putLicense, options,
6969
PutLicenseResponse::fromXContent, emptySet());
7070
}
7171

@@ -75,7 +75,7 @@ public PutLicenseResponse putLicense(PutLicenseRequest request, RequestOptions o
7575
* @param listener the listener to be notified upon request completion
7676
*/
7777
public void putLicenseAsync(PutLicenseRequest request, RequestOptions options, ActionListener<PutLicenseResponse> listener) {
78-
restHighLevelClient.performRequestAsyncAndParseEntity(request, RequestConverters::putLicense, options,
78+
restHighLevelClient.performRequestAsyncAndParseEntity(request, LicenseRequestConverters::putLicense, options,
7979
PutLicenseResponse::fromXContent, listener, emptySet());
8080
}
8181

@@ -86,7 +86,7 @@ public void putLicenseAsync(PutLicenseRequest request, RequestOptions options, A
8686
* @throws IOException in case there is a problem sending the request or parsing back the response
8787
*/
8888
public GetLicenseResponse getLicense(GetLicenseRequest request, RequestOptions options) throws IOException {
89-
return restHighLevelClient.performRequest(request, RequestConverters::getLicense, options,
89+
return restHighLevelClient.performRequest(request, LicenseRequestConverters::getLicense, options,
9090
response -> new GetLicenseResponse(convertResponseToJson(response)), emptySet());
9191
}
9292

@@ -96,7 +96,7 @@ public GetLicenseResponse getLicense(GetLicenseRequest request, RequestOptions o
9696
* @param listener the listener to be notified upon request completion
9797
*/
9898
public void getLicenseAsync(GetLicenseRequest request, RequestOptions options, ActionListener<GetLicenseResponse> listener) {
99-
restHighLevelClient.performRequestAsync(request, RequestConverters::getLicense, options,
99+
restHighLevelClient.performRequestAsync(request, LicenseRequestConverters::getLicense, options,
100100
response -> new GetLicenseResponse(convertResponseToJson(response)), listener, emptySet());
101101
}
102102

@@ -107,7 +107,7 @@ public void getLicenseAsync(GetLicenseRequest request, RequestOptions options, A
107107
* @throws IOException in case there is a problem sending the request or parsing back the response
108108
*/
109109
public AcknowledgedResponse deleteLicense(DeleteLicenseRequest request, RequestOptions options) throws IOException {
110-
return restHighLevelClient.performRequestAndParseEntity(request, RequestConverters::deleteLicense, options,
110+
return restHighLevelClient.performRequestAndParseEntity(request, LicenseRequestConverters::deleteLicense, options,
111111
AcknowledgedResponse::fromXContent, emptySet());
112112
}
113113

@@ -117,7 +117,7 @@ public AcknowledgedResponse deleteLicense(DeleteLicenseRequest request, RequestO
117117
* @param listener the listener to be notified upon request completion
118118
*/
119119
public void deleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
120-
restHighLevelClient.performRequestAsyncAndParseEntity(request, RequestConverters::deleteLicense, options,
120+
restHighLevelClient.performRequestAsyncAndParseEntity(request, LicenseRequestConverters::deleteLicense, options,
121121
AcknowledgedResponse::fromXContent, listener, emptySet());
122122
}
123123

0 commit comments

Comments
 (0)