Skip to content

Commit 83d692c

Browse files
committed
Merge branch 'master' into aarch64
* master: (129 commits) Add doc note regarding explicit publish host Fix typo in name of test Add additional test for sequence-number recovery WrapperQueryBuilder should also rewrite the parsed query. Remove dead code and stale Javadoc Update defaults in documentation (#25483) [DOCS] Add docs-dir to Painless (#25482) Add concurrent deprecation logger test [DOCS] Update shared attributes for Elasticsearch (#25479) Use LRU set to reduce repeat deprecation messages Add NioTransport threads to thread name checks (#25477) Add shortcut for AbstractQueryBuilder.parseInnerQueryBuilder to QueryShardContext Prevent channel enqueue after selector close (#25478) Fix Java 9 compilation issue Remove unregistered `transport.netty.*` settings (#25476) Handle ping correctly in NioTransport (#25462) Tests: Remove platform specific assertion in NioSocketChannelTests Remove QueryParseContext from parsing QueryBuilders (#25448) Promote replica on the highest version node (#25277) test: added not null assertion ...
2 parents 075c1b8 + 1b60247 commit 83d692c

File tree

596 files changed

+15995
-5860
lines changed

Some content is hidden

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

596 files changed

+15995
-5860
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
127127
*/
128128
Set<String> unconvertedCandidates = new HashSet<>()
129129

130+
/**
131+
* The last non-TESTRESPONSE snippet.
132+
*/
133+
Snippet previousTest
134+
130135
/**
131136
* Called each time a snippet is encountered. Tracks the snippets and
132137
* calls buildTest to actually build the test.
@@ -142,6 +147,7 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
142147
}
143148
if (snippet.testSetup) {
144149
setup(snippet)
150+
previousTest = snippet
145151
return
146152
}
147153
if (snippet.testResponse) {
@@ -150,6 +156,7 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
150156
}
151157
if (snippet.test || snippet.console) {
152158
test(snippet)
159+
previousTest = snippet
153160
return
154161
}
155162
// Must be an unmarked snippet....
@@ -158,7 +165,18 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
158165
private void test(Snippet test) {
159166
setupCurrent(test)
160167

161-
if (false == test.continued) {
168+
if (test.continued) {
169+
/* Catch some difficult to debug errors with // TEST[continued]
170+
* and throw a helpful error message. */
171+
if (previousTest == null || previousTest.path != test.path) {
172+
throw new InvalidUserDataException("// TEST[continued] " +
173+
"cannot be on first snippet in a file: $test")
174+
}
175+
if (previousTest != null && previousTest.testSetup) {
176+
throw new InvalidUserDataException("// TEST[continued] " +
177+
"cannot immediately follow // TESTSETUP: $test")
178+
}
179+
} else {
162180
current.println('---')
163181
current.println("\"line_$test.start\":")
164182
/* The Elasticsearch test runner doesn't support the warnings

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.elasticsearch.gradle.test
2020

2121
import org.apache.tools.ant.taskdefs.condition.Os
22+
import org.elasticsearch.gradle.Version
2223
import org.gradle.api.InvalidUserDataException
2324
import org.gradle.api.Project
2425

@@ -143,7 +144,7 @@ class NodeInfo {
143144
args.add("${esScript}")
144145
}
145146

146-
env = [ 'JAVA_HOME' : project.javaHome ]
147+
env = ['JAVA_HOME': project.javaHome]
147148
args.addAll("-E", "node.portsfile=true")
148149
String collectedSystemProperties = config.systemProperties.collect { key, value -> "-D${key}=${value}" }.join(" ")
149150
String esJavaOpts = config.jvmArgs.isEmpty() ? collectedSystemProperties : collectedSystemProperties + " " + config.jvmArgs
@@ -158,7 +159,11 @@ class NodeInfo {
158159
}
159160
}
160161
env.put('ES_JVM_OPTIONS', new File(confDir, 'jvm.options'))
161-
args.addAll("-E", "path.conf=${confDir}")
162+
if (Version.fromString(nodeVersion).major == 5) {
163+
args.addAll("-E", "path.conf=${confDir}")
164+
} else {
165+
args.addAll("--path.conf", "${confDir}")
166+
}
162167
if (!System.properties.containsKey("tests.es.path.data")) {
163168
args.addAll("-E", "path.data=${-> dataDir.toString()}")
164169
}

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<!-- JNA requires the no-argument constructor on JNAKernel32Library.SizeT to be public-->
1414
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]bootstrap[/\\]JNAKernel32Library.java" checks="RedundantModifier" />
1515

16+
<!-- the constructors on some local classes in these tests must be public-->
17+
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]plugins[/\\]PluginsServiceTests.java" checks="RedundantModifier" />
18+
1619
<!-- Hopefully temporary suppression of LineLength on files that don't pass it. We should remove these when we the
1720
files start to pass. -->
1821
<suppress files="client[/\\]rest[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]HeapBufferedAsyncResponseConsumerTests.java" checks="LineLength" />
@@ -267,7 +270,6 @@
267270
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]CustomAnalyzerProvider.java" checks="LineLength" />
268271
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]ShingleTokenFilterFactory.java" checks="LineLength" />
269272
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]StemmerOverrideTokenFilterFactory.java" checks="LineLength" />
270-
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]compound[/\\]HyphenationCompoundWordTokenFilterFactory.java" checks="LineLength" />
271273
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]cache[/\\]bitset[/\\]BitsetFilterCache.java" checks="LineLength" />
272274
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]codec[/\\]PerFieldMappingPostingFormatCodec.java" checks="LineLength" />
273275
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]engine[/\\]ElasticsearchConcurrentMergeScheduler.java" checks="LineLength" />

buildSrc/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# When updating elasticsearch, please update 'rest' version in core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
22
elasticsearch = 6.0.0-alpha3
3-
lucene = 7.0.0-snapshot-92b1783
3+
lucene = 7.0.0-snapshot-ad2cb77
44

55
# optional dependencies
66
spatial4j = 0.6
@@ -25,7 +25,7 @@ commonscodec = 1.10
2525
hamcrest = 1.3
2626
securemock = 1.2
2727
# When updating mocksocket, please also update core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
28-
mocksocket = 1.1
28+
mocksocket = 1.2
2929

3030
# benchmark dependencies
3131
jmh = 1.17.3

client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,49 +276,59 @@ public void testSearchWithMatrixStats() throws IOException {
276276
}
277277

278278
public void testSearchWithParentJoin() throws IOException {
279+
final String indexName = "child_example";
279280
StringEntity parentMapping = new StringEntity("{\n" +
280281
" \"mappings\": {\n" +
281-
" \"answer\" : {\n" +
282-
" \"_parent\" : {\n" +
283-
" \"type\" : \"question\"\n" +
282+
" \"qa\" : {\n" +
283+
" \"properties\" : {\n" +
284+
" \"qa_join_field\" : {\n" +
285+
" \"type\" : \"join\",\n" +
286+
" \"relations\" : { \"question\" : \"answer\" }\n" +
287+
" }\n" +
284288
" }\n" +
285289
" }\n" +
286-
" },\n" +
287-
" \"settings\": {\n" +
288-
" \"index.mapping.single_type\": false" +
289-
" }\n" +
290+
" }" +
290291
"}", ContentType.APPLICATION_JSON);
291-
client().performRequest("PUT", "/child_example", Collections.emptyMap(), parentMapping);
292+
client().performRequest("PUT", "/" + indexName, Collections.emptyMap(), parentMapping);
292293
StringEntity questionDoc = new StringEntity("{\n" +
293294
" \"body\": \"<p>I have Windows 2003 server and i bought a new Windows 2008 server...\",\n" +
294295
" \"title\": \"Whats the best way to file transfer my site from server to a newer one?\",\n" +
295296
" \"tags\": [\n" +
296297
" \"windows-server-2003\",\n" +
297298
" \"windows-server-2008\",\n" +
298299
" \"file-transfer\"\n" +
299-
" ]\n" +
300+
" ],\n" +
301+
" \"qa_join_field\" : \"question\"\n" +
300302
"}", ContentType.APPLICATION_JSON);
301-
client().performRequest("PUT", "/child_example/question/1", Collections.emptyMap(), questionDoc);
303+
client().performRequest("PUT", "/" + indexName + "/qa/1", Collections.emptyMap(), questionDoc);
302304
StringEntity answerDoc1 = new StringEntity("{\n" +
303305
" \"owner\": {\n" +
304306
" \"location\": \"Norfolk, United Kingdom\",\n" +
305307
" \"display_name\": \"Sam\",\n" +
306308
" \"id\": 48\n" +
307309
" },\n" +
308310
" \"body\": \"<p>Unfortunately you're pretty much limited to FTP...\",\n" +
311+
" \"qa_join_field\" : {\n" +
312+
" \"name\" : \"answer\",\n" +
313+
" \"parent\" : \"1\"\n" +
314+
" },\n" +
309315
" \"creation_date\": \"2009-05-04T13:45:37.030\"\n" +
310316
"}", ContentType.APPLICATION_JSON);
311-
client().performRequest("PUT", "child_example/answer/1", Collections.singletonMap("parent", "1"), answerDoc1);
317+
client().performRequest("PUT", "/" + indexName + "/qa/2", Collections.singletonMap("routing", "1"), answerDoc1);
312318
StringEntity answerDoc2 = new StringEntity("{\n" +
313319
" \"owner\": {\n" +
314320
" \"location\": \"Norfolk, United Kingdom\",\n" +
315321
" \"display_name\": \"Troll\",\n" +
316322
" \"id\": 49\n" +
317323
" },\n" +
318324
" \"body\": \"<p>Use Linux...\",\n" +
325+
" \"qa_join_field\" : {\n" +
326+
" \"name\" : \"answer\",\n" +
327+
" \"parent\" : \"1\"\n" +
328+
" },\n" +
319329
" \"creation_date\": \"2009-05-05T13:45:37.030\"\n" +
320330
"}", ContentType.APPLICATION_JSON);
321-
client().performRequest("PUT", "/child_example/answer/2", Collections.singletonMap("parent", "1"), answerDoc2);
331+
client().performRequest("PUT", "/" + indexName + "/qa/3", Collections.singletonMap("routing", "1"), answerDoc2);
322332
client().performRequest("POST", "/_refresh");
323333

324334
TermsAggregationBuilder leafTermAgg = new TermsAggregationBuilder("top-names", ValueType.STRING)
@@ -328,7 +338,7 @@ public void testSearchWithParentJoin() throws IOException {
328338
.size(10).subAggregation(childrenAgg);
329339
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
330340
searchSourceBuilder.size(0).aggregation(termsAgg);
331-
SearchRequest searchRequest = new SearchRequest("child_example");
341+
SearchRequest searchRequest = new SearchRequest(indexName);
332342
searchRequest.source(searchSourceBuilder);
333343

334344
SearchResponse searchResponse = execute(searchRequest, highLevelClient()::search, highLevelClient()::searchAsync);

core/licenses/lucene-analyzers-common-7.0.0-snapshot-92b1783.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
00d3260223eac0405a82eeeb8439de0e5eb5f888

core/licenses/lucene-backward-codecs-7.0.0-snapshot-92b1783.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3a698989219afd9150738899bc849075c102881b

core/licenses/lucene-core-7.0.0-snapshot-92b1783.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)