Skip to content

Commit b33be9e

Browse files
committed
Merge remote-tracking branch 'elastic/7.x' into 7x-geoshape-doc-values
2 parents 9712836 + 8fb9bed commit b33be9e

File tree

19 files changed

+73
-54
lines changed

19 files changed

+73
-54
lines changed

benchmarks/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ dependencies {
4141
runtime 'org.apache.commons:commons-math3:3.2'
4242
}
4343

44-
compileJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked,-processing"
4544
// enable the JMH's BenchmarkProcessor to generate the final benchmark classes
4645
// needs to be added separately otherwise Gradle will quote it and javac will fail
4746
compileJava.options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generators.BenchmarkProcessor"])

client/client-benchmark-noop-api-plugin/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ assemble.enabled = false
3333
dependencyLicenses.enabled = false
3434
dependenciesInfo.enabled = false
3535

36-
compileJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
37-
3836
// no unit tests
3937
test.enabled = false
4038
integTest.enabled = false

docs/reference/ingest/apis/enrich/get-enrich-policy.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ GET /_enrich/policy/my-policy
5050
[[get-enrich-policy-api-request]]
5151
==== {api-request-title}
5252

53-
`GET /_enrich/policy/<enrich-policy>`
53+
`GET /_enrich/policy/<name>`
5454

5555
`GET /_enrich/policy`
5656

@@ -66,7 +66,7 @@ include::put-enrich-policy.asciidoc[tag=enrich-policy-api-prereqs]
6666
[[get-enrich-policy-api-path-params]]
6767
==== {api-path-parms-title}
6868

69-
`<enrich-policy>`::
69+
`<name>`::
7070
+
7171
--
7272
(Optional, string)

docs/reference/modules/threadpool.asciidoc

+14-11
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ There are several thread pools, but the important ones include:
2020
`1000`.
2121

2222
[[search-throttled]]`search_throttled`::
23-
For count/search/suggest/get operations on `search_throttled indices`.
24-
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
23+
For count/search/suggest/get operations on `search_throttled indices`.
24+
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
2525
queue_size of `100`.
2626

2727
`get`::
@@ -30,7 +30,7 @@ There are several thread pools, but the important ones include:
3030
queue_size of `1000`.
3131

3232
`analyze`::
33-
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
33+
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
3434
size of `16`.
3535

3636
`write`::
@@ -51,8 +51,8 @@ There are several thread pools, but the important ones include:
5151
keep-alive of `5m` and a max of `min(10, (# of available processors)/2)`.
5252

5353
`listener`::
54-
Mainly for java client executing of action when listener threaded is set to
55-
`true`. Thread pool type is `scaling` with a default max of
54+
Mainly for java client executing of action when listener threaded is set to
55+
`true`. Thread pool type is `scaling` with a default max of
5656
`min(10, (# of available processors)/2)`.
5757

5858
`fetch_shard_started`::
@@ -125,6 +125,9 @@ thread_pool:
125125

126126
experimental[]
127127

128+
deprecated[7.7.0,The experimental `fixed_auto_queue_size` thread pool type is
129+
deprecated and will be removed in 8.0.]
130+
128131
The `fixed_auto_queue_size` thread pool holds a fixed size of threads to handle
129132
the requests with a bounded queue for pending requests that have no threads to
130133
service them. It's similar to the `fixed` threadpool, however, the `queue_size`
@@ -202,13 +205,13 @@ processors: 2
202205
There are a few use-cases for explicitly overriding the `processors`
203206
setting:
204207

205-
. If you are running multiple instances of {es} on the same host but want {es}
206-
to size its thread pools as if it only has a fraction of the CPU, you should
207-
override the `processors` setting to the desired fraction, for example, if
208+
. If you are running multiple instances of {es} on the same host but want {es}
209+
to size its thread pools as if it only has a fraction of the CPU, you should
210+
override the `processors` setting to the desired fraction, for example, if
208211
you're running two instances of {es} on a 16-core machine, set `processors` to 8.
209-
Note that this is an expert-level use case and there's a lot more involved
210-
than just setting the `processors` setting as there are other considerations
211-
like changing the number of garbage collector threads, pinning processes to
212+
Note that this is an expert-level use case and there's a lot more involved
213+
than just setting the `processors` setting as there are other considerations
214+
like changing the number of garbage collector threads, pinning processes to
212215
cores, and so on.
213216
. Sometimes the number of processors is wrongly detected and in such
214217
cases explicitly setting the `processors` setting will workaround such

modules/transport-netty4/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ esplugin {
3333
hasClientJar = true
3434
}
3535

36-
compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
37-
3836
dependencies {
3937
// network stack
4038
compile "io.netty:netty-buffer:${versions.netty}"

modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpClient.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ public Collection<FullHttpResponse> get(SocketAddress remoteAddress, String... u
102102
return sendRequests(remoteAddress, requests);
103103
}
104104

105-
@SafeVarargs // Safe not because it doesn't do anything with the type parameters but because it won't leak them into other methods.
106-
public final Collection<FullHttpResponse> post(SocketAddress remoteAddress, Tuple<String, CharSequence>... urisAndBodies)
105+
public final Collection<FullHttpResponse> post(SocketAddress remoteAddress, List<Tuple<String, CharSequence>> urisAndBodies)
107106
throws InterruptedException {
108107
return processRequestsWithBody(HttpMethod.POST, remoteAddress, urisAndBodies);
109108
}
@@ -114,15 +113,14 @@ public final FullHttpResponse post(SocketAddress remoteAddress, FullHttpRequest
114113
return responses.iterator().next();
115114
}
116115

117-
@SafeVarargs // Safe not because it doesn't do anything with the type parameters but because it won't leak them into other methods.
118-
public final Collection<FullHttpResponse> put(SocketAddress remoteAddress, Tuple<String, CharSequence>... urisAndBodies)
116+
public final Collection<FullHttpResponse> put(SocketAddress remoteAddress, List<Tuple<String, CharSequence>> urisAndBodies)
119117
throws InterruptedException {
120118
return processRequestsWithBody(HttpMethod.PUT, remoteAddress, urisAndBodies);
121119
}
122120

123-
private Collection<FullHttpResponse> processRequestsWithBody(HttpMethod method, SocketAddress remoteAddress, Tuple<String,
124-
CharSequence>... urisAndBodies) throws InterruptedException {
125-
Collection<HttpRequest> requests = new ArrayList<>(urisAndBodies.length);
121+
private Collection<FullHttpResponse> processRequestsWithBody(HttpMethod method, SocketAddress remoteAddress, List<Tuple<String,
122+
CharSequence>> urisAndBodies) throws InterruptedException {
123+
Collection<HttpRequest> requests = new ArrayList<>(urisAndBodies.size());
126124
for (Tuple<String, CharSequence> uriAndBody : urisAndBodies) {
127125
ByteBuf content = Unpooled.copiedBuffer(uriAndBody.v2(), StandardCharsets.UTF_8);
128126
HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, method, uriAndBody.v1(), content);

modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpRequestSizeLimitIT.java

+14-16
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
import org.elasticsearch.test.ESIntegTestCase.Scope;
3434
import io.netty.handler.codec.http.HttpResponseStatus;
3535

36+
import java.util.ArrayList;
3637
import java.util.Collection;
38+
import java.util.List;
3739

3840
import static org.hamcrest.Matchers.equalTo;
3941
import static org.hamcrest.Matchers.greaterThan;
@@ -77,25 +79,23 @@ public void testLimitsInFlightRequests() throws Exception {
7779
bulkRequest.append(System.lineSeparator());
7880
}
7981

80-
@SuppressWarnings("unchecked")
81-
Tuple<String, CharSequence>[] requests = new Tuple[150];
82-
for (int i = 0; i < requests.length; i++) {
83-
requests[i] = Tuple.tuple("/index/type/_bulk", bulkRequest);
82+
List<Tuple<String, CharSequence>> requests = new ArrayList<>();
83+
for (int i = 0; i < 150; i++) {
84+
requests.add(Tuple.tuple("/index/type/_bulk", bulkRequest));
8485
}
8586

8687
HttpServerTransport httpServerTransport = internalCluster().getInstance(HttpServerTransport.class);
87-
TransportAddress transportAddress = (TransportAddress) randomFrom(httpServerTransport.boundAddress
88-
().boundAddresses());
88+
TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses());
8989

9090
try (Netty4HttpClient nettyHttpClient = new Netty4HttpClient()) {
91-
Collection<FullHttpResponse> singleResponse = nettyHttpClient.post(transportAddress.address(), requests[0]);
91+
Collection<FullHttpResponse> singleResponse = nettyHttpClient.post(transportAddress.address(), requests.subList(0, 1));
9292
try {
9393
assertThat(singleResponse, hasSize(1));
9494
assertAtLeastOnceExpectedStatus(singleResponse, HttpResponseStatus.OK);
9595

9696
Collection<FullHttpResponse> multipleResponses = nettyHttpClient.post(transportAddress.address(), requests);
9797
try {
98-
assertThat(multipleResponses, hasSize(requests.length));
98+
assertThat(multipleResponses, hasSize(requests.size()));
9999
assertAtLeastOnceExpectedStatus(multipleResponses, HttpResponseStatus.TOO_MANY_REQUESTS);
100100
} finally {
101101
multipleResponses.forEach(ReferenceCounted::release);
@@ -109,21 +109,19 @@ public void testLimitsInFlightRequests() throws Exception {
109109
public void testDoesNotLimitExcludedRequests() throws Exception {
110110
ensureGreen();
111111

112-
@SuppressWarnings("unchecked")
113-
Tuple<String, CharSequence>[] requestUris = new Tuple[1500];
114-
for (int i = 0; i < requestUris.length; i++) {
115-
requestUris[i] = Tuple.tuple("/_cluster/settings",
116-
"{ \"transient\": {\"search.default_search_timeout\": \"40s\" } }");
112+
List<Tuple<String, CharSequence>> requestUris = new ArrayList<>();
113+
for (int i = 0; i < 1500; i++) {
114+
requestUris.add(Tuple.tuple("/_cluster/settings",
115+
"{ \"transient\": {\"search.default_search_timeout\": \"40s\" } }"));
117116
}
118117

119118
HttpServerTransport httpServerTransport = internalCluster().getInstance(HttpServerTransport.class);
120-
TransportAddress transportAddress = (TransportAddress) randomFrom(httpServerTransport.boundAddress
121-
().boundAddresses());
119+
TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses());
122120

123121
try (Netty4HttpClient nettyHttpClient = new Netty4HttpClient()) {
124122
Collection<FullHttpResponse> responses = nettyHttpClient.put(transportAddress.address(), requestUris);
125123
try {
126-
assertThat(responses, hasSize(requestUris.length));
124+
assertThat(responses, hasSize(requestUris.size()));
127125
assertAllInExpectedStatus(responses, HttpResponseStatus.OK);
128126
} finally {
129127
responses.forEach(ReferenceCounted::release);

modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/Netty4TransportMultiPortIntegrationIT.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.elasticsearch.transport.Netty4Plugin;
3838

3939
import java.net.InetAddress;
40+
import java.util.Arrays;
4041
import java.util.Locale;
4142

4243
import static org.hamcrest.Matchers.allOf;
@@ -76,7 +77,7 @@ public void testThatTransportClientCanConnect() throws Exception {
7677
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString())
7778
.build();
7879
// we have to test all the ports that the data node might be bound to
79-
try (TransportClient transportClient = new MockTransportClient(settings, Netty4Plugin.class)) {
80+
try (TransportClient transportClient = new MockTransportClient(settings, Arrays.asList(Netty4Plugin.class))) {
8081
for (int i = 0; i <= 10; i++) {
8182
transportClient.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), randomPort + i));
8283
}

modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/Netty4TransportPublishAddressIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void testDifferentPorts() throws Exception {
7676
assertThat(boundTransportAddress.boundAddresses().length, greaterThan(1));
7777
for (TransportAddress boundAddress : boundTransportAddress.boundAddresses()) {
7878
assertThat(boundAddress, instanceOf(TransportAddress.class));
79-
TransportAddress inetBoundAddress = (TransportAddress) boundAddress;
79+
TransportAddress inetBoundAddress = boundAddress;
8080
if (inetBoundAddress.address().getAddress() instanceof Inet4Address) {
8181
// IPv4 address is preferred publish address for _local_
8282
assertThat(inetBoundAddress.getPort(), equalTo(boundTransportAddress.publishAddress().getPort()));

rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
]
4242
},
4343
"params":{
44+
"analyzer": {
45+
"type" : "string",
46+
"description" : "The analyzer to use for the query string"
47+
},
4448
"analyze_wildcard": {
4549
"type" : "boolean",
4650
"description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)"

rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
"type" : "boolean",
7171
"description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
7272
"default" : false
73+
},
74+
"ccs_minimize_roundtrips": {
75+
"type" : "boolean",
76+
"description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
77+
"default" : "true"
7378
}
7479
},
7580
"body":{

rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json

+5
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
"type":"boolean",
110110
"description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
111111
"default":false
112+
},
113+
"ccs_minimize_roundtrips": {
114+
"type" : "boolean",
115+
"description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
116+
"default" : "true"
112117
}
113118
},
114119
"body":{

server/src/main/java/org/elasticsearch/threadpool/AutoQueueAdjustingExecutorBuilder.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ public final class AutoQueueAdjustingExecutorBuilder extends ExecutorBuilder<Aut
6767
final String frameSizeKey = settingsKey(prefix, "auto_queue_frame_size");
6868
final String targetedResponseTimeKey = settingsKey(prefix, "target_response_time");
6969
this.targetedResponseTimeSetting = Setting.timeSetting(targetedResponseTimeKey, TimeValue.timeValueSeconds(1),
70-
TimeValue.timeValueMillis(10), Setting.Property.NodeScope);
70+
TimeValue.timeValueMillis(10), Setting.Property.NodeScope, Setting.Property.Deprecated);
7171
this.queueSizeSetting = Setting.intSetting(queueSizeKey, initialQueueSize, Setting.Property.NodeScope);
7272
// These temp settings are used to validate the min and max settings below
73-
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope);
74-
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope);
73+
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope,
74+
Setting.Property.Deprecated);
75+
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope,
76+
Setting.Property.Deprecated);
7577

7678
this.minQueueSizeSetting = new Setting<>(
7779
minSizeKey,
@@ -126,8 +128,9 @@ public Iterator<Setting<?>> settings() {
126128
}
127129

128130
},
129-
Setting.Property.NodeScope);
130-
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope);
131+
Setting.Property.NodeScope, Setting.Property.Deprecated);
132+
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope, Setting.Property.Deprecated,
133+
Setting.Property.Deprecated);
131134
}
132135

133136
@Override

server/src/test/java/org/elasticsearch/threadpool/AutoQueueAdjustingExecutorBuilderTests.java

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public void testValidatingMinMaxSettings() {
7878
} catch (IllegalArgumentException e) {
7979
assertEquals(e.getMessage(), "Failed to parse value [100] for setting [thread_pool.test.min_queue_size] must be <= 99");
8080
}
81+
82+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.max_queue_size"});
8183
}
8284

8385
public void testSetLowerSettings() {
@@ -89,6 +91,8 @@ public void testSetLowerSettings() {
8991
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
9092
assertEquals(10, s.maxQueueSize);
9193
assertEquals(10, s.minQueueSize);
94+
95+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
9296
}
9397

9498
public void testSetHigherSettings() {
@@ -100,6 +104,8 @@ public void testSetHigherSettings() {
100104
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
101105
assertEquals(3000, s.maxQueueSize);
102106
assertEquals(2000, s.minQueueSize);
107+
108+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
103109
}
104110

105111
}

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.get_policy.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"methods": [ "GET" ],
1212
"parts": {
1313
"name": {
14-
"type" : "string",
15-
"description" : "The name of the enrich policy"
14+
"type" : "list",
15+
"description" : "A comma-separated list of enrich policy names"
1616
}
1717
}
1818
},

x-pack/plugin/src/test/resources/rest-api-spec/test/analytics/top_metrics.yml

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112

113113
---
114114
"sort by scaled float field":
115+
- skip:
116+
version: "all"
117+
reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/52418"
115118
- do:
116119
indices.create:
117120
index: test

x-pack/qa/rolling-upgrade/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ dependencies {
1010
testCompile project(':client:rest-high-level')
1111
}
1212

13-
compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
14-
1513
forbiddenPatterns {
1614
exclude '**/system_key'
1715
}

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java

+2
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ private void assertRefreshTokenInvalidated(String refreshToken) throws IOExcepti
361361
}
362362
}
363363

364+
@SuppressWarnings("unchecked")
364365
private Map<Version, RestClient> getRestClientByVersion() throws IOException {
365366
Response response = client().performRequest(new Request("GET", "_nodes"));
366367
assertOK(response);
@@ -404,6 +405,7 @@ private void storeTokens(RestClient client, int idx, String accessToken, String
404405
assertOK(indexResponse1);
405406
}
406407

408+
@SuppressWarnings("unchecked")
407409
private Map<String, Object> retrieveStoredTokens(RestClient client, int tokenIdx) throws IOException {
408410
Request getRequest = new Request("GET", "token_backwards_compatibility_it/_doc/old_cluster_token" + tokenIdx);
409411
Response getResponse = client().performRequest(getRequest);

x-pack/qa/third-party/active-directory/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ processTestResources {
1313
from(project(xpackModule('security')).sourceSets.test.resources.srcDirs)
1414
}
1515

16-
compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
17-
1816
// we have to repeat these patterns because the security test resources are effectively in the src of this p
1917
forbiddenPatterns {
2018
exclude '**/*.key'

0 commit comments

Comments
 (0)