Skip to content

Commit c9f1565

Browse files
committed
Merge remote-tracking branch 'es/6.x' into ccr-6.x
* es/6.x: (43 commits) ingest: upgraded ingest geoip's geoip2's dependencies. [TEST] logging for update by query test #27820 Use full profile on JDK 10 builds Require Gradle 4.3 Add unreleased v6.1.2 version TEST: reduce blob size #testExecuteMultipartUpload Check index under the store metadata lock (#27768) Upgrade to Lucene 7.2.0. (#27910) Fixed test to be up to date with the new database files. Use `_refresh` to shrink the version map on inactivity (#27918) Make KeyedLock reentrant (#27920) Fixes DocStats to not report index size < -1 (#27863) Disable TestZenDiscovery in cloud providers integrations test ingest: Upgraded the geolite2 databases. [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (#27717) [Test] Fix IndicesClientDocumentationIT (#27899) Move uid lock into LiveVersionMap (#27905) Mute testRetentionPolicyChangeDuringRecovery Increase Gradle heap space to 1536m Move GlobalCheckpointTracker and remove SequenceNumbersService (#27837) ...
2 parents 851ce69 + ec0bbef commit c9f1565

File tree

346 files changed

+7942
-1996
lines changed

Some content is hidden

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

346 files changed

+7942
-1996
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ Alternatively, `idea.no.launcher=true` can be set in the
115115
[`idea.properties`](https://www.jetbrains.com/help/idea/file-idea-properties.html)
116116
file which can be accessed under Help > Edit Custom Properties (this will require a
117117
restart of IDEA). For IDEA 2017.3 and above, in addition to the JVM option, you will need to go to
118-
`Run->Edit Configurations...` and change the value for the `Shorten command line` setting from
118+
`Run->Edit Configurations->...->Defaults->JUnit` and change the value for the `Shorten command line` setting from
119119
`user-local default: none` to `classpath file`. You may also need to [remove `ant-javafx.jar` from your
120120
classpath](https://github.com/elastic/elasticsearch/issues/14348) if that is
121121
reported as a source of jar hell.
122122

123+
To run an instance of elasticsearch from the source code run `gradle run`
124+
123125
The Elasticsearch codebase makes heavy use of Java `assert`s and the
124126
test runner requires that assertions be enabled within the JVM. This
125127
can be accomplished by passing the flag `-ea` to the JVM on startup.

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ subprojects {
196196
"org.elasticsearch.plugin:parent-join-client:${version}": ':modules:parent-join',
197197
"org.elasticsearch.plugin:aggs-matrix-stats-client:${version}": ':modules:aggs-matrix-stats',
198198
"org.elasticsearch.plugin:percolator-client:${version}": ':modules:percolator',
199+
"org.elasticsearch.plugin:rank-eval-client:${version}": ':modules:rank-eval',
199200
]
200201

201202
for (final Version version : versionCollection.versionsIndexCompatibleWithCurrent) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class BuildPlugin implements Plugin<Project> {
126126
// enforce Gradle version
127127
final GradleVersion currentGradleVersion = GradleVersion.current();
128128

129-
final GradleVersion minGradle = GradleVersion.version('3.3')
129+
final GradleVersion minGradle = GradleVersion.version('4.3')
130130
if (currentGradleVersion < minGradle) {
131131
throw new GradleException("${minGradle} or above is required to build elasticsearch")
132132
}
@@ -408,7 +408,11 @@ class BuildPlugin implements Plugin<Project> {
408408

409409
/** Adds compiler settings to the project */
410410
static void configureCompile(Project project) {
411-
project.ext.compactProfile = 'compact3'
411+
if (project.javaVersion < JavaVersion.VERSION_1_10) {
412+
project.ext.compactProfile = 'compact3'
413+
} else {
414+
project.ext.compactProfile = 'full'
415+
}
412416
project.afterEvaluate {
413417
project.tasks.withType(JavaCompile) {
414418
File gradleJavaHome = Jvm.current().javaHome
@@ -444,13 +448,6 @@ class BuildPlugin implements Plugin<Project> {
444448
// hack until gradle supports java 9's new "--release" arg
445449
assert minimumJava == JavaVersion.VERSION_1_8
446450
options.compilerArgs << '--release' << '8'
447-
if (GradleVersion.current().getBaseVersion() < GradleVersion.version("4.1")) {
448-
// this hack is not needed anymore since Gradle 4.1, see https://github.com/gradle/gradle/pull/2474
449-
doFirst {
450-
sourceCompatibility = null
451-
targetCompatibility = null
452-
}
453-
}
454451
}
455452
}
456453
}

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 6.2.0
2-
lucene = 7.2.0-snapshot-7deca62
2+
lucene = 7.2.0
33

44
# optional dependencies
55
spatial4j = 0.6

client/rest-high-level/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies {
3939
compile "org.elasticsearch.client:elasticsearch-rest-client:${version}"
4040
compile "org.elasticsearch.plugin:parent-join-client:${version}"
4141
compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}"
42+
compile "org.elasticsearch.plugin:rank-eval-client:${version}"
4243

4344
testCompile "org.elasticsearch.client:test:${version}"
4445
testCompile "org.elasticsearch.test:framework:${version}"
@@ -60,4 +61,4 @@ forbiddenApisMain {
6061
// specified
6162
signaturesURLs += [PrecommitTasks.getResource('/forbidden/http-signatures.txt')]
6263
signaturesURLs += [file('src/main/resources/forbidden/rest-high-level-signatures.txt').toURI().toURL()]
63-
}
64+
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
import org.elasticsearch.common.xcontent.XContentParser;
5858
import org.elasticsearch.common.xcontent.cbor.CborXContent;
5959
import org.elasticsearch.common.xcontent.smile.SmileXContent;
60+
import org.elasticsearch.index.rankeval.DiscountedCumulativeGain;
61+
import org.elasticsearch.index.rankeval.EvaluationMetric;
62+
import org.elasticsearch.index.rankeval.MeanReciprocalRank;
63+
import org.elasticsearch.index.rankeval.PrecisionAtK;
6064
import org.elasticsearch.join.aggregations.ChildrenAggregationBuilder;
6165
import org.elasticsearch.rest.RestStatus;
6266
import org.elasticsearch.search.SearchHits;
@@ -648,7 +652,7 @@ public void testDefaultNamedXContents() {
648652

649653
public void testProvidedNamedXContents() {
650654
List<NamedXContentRegistry.Entry> namedXContents = RestHighLevelClient.getProvidedNamedXContents();
651-
assertEquals(2, namedXContents.size());
655+
assertEquals(5, namedXContents.size());
652656
Map<Class<?>, Integer> categories = new HashMap<>();
653657
List<String> names = new ArrayList<>();
654658
for (NamedXContentRegistry.Entry namedXContent : namedXContents) {
@@ -658,10 +662,14 @@ public void testProvidedNamedXContents() {
658662
categories.put(namedXContent.categoryClass, counter + 1);
659663
}
660664
}
661-
assertEquals(1, categories.size());
665+
assertEquals(2, categories.size());
662666
assertEquals(Integer.valueOf(2), categories.get(Aggregation.class));
663667
assertTrue(names.contains(ChildrenAggregationBuilder.NAME));
664668
assertTrue(names.contains(MatrixStatsAggregationBuilder.NAME));
669+
assertEquals(Integer.valueOf(3), categories.get(EvaluationMetric.class));
670+
assertTrue(names.contains(PrecisionAtK.NAME));
671+
assertTrue(names.contains(DiscountedCumulativeGain.NAME));
672+
assertTrue(names.contains(MeanReciprocalRank.NAME));
665673
}
666674

667675
private static class TrackingActionListener implements ActionListener<Integer> {

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

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.action.support.ActiveShardCount;
3030
import org.elasticsearch.action.support.IndicesOptions;
3131
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
32+
import org.elasticsearch.client.Response;
3233
import org.elasticsearch.client.RestHighLevelClient;
3334
import org.elasticsearch.common.settings.Settings;
3435
import org.elasticsearch.common.unit.TimeValue;
@@ -86,6 +87,32 @@ public void testDeleteIndex() throws IOException {
8687
boolean acknowledged = deleteIndexResponse.isAcknowledged(); // <1>
8788
// end::delete-index-response
8889
assertTrue(acknowledged);
90+
}
91+
92+
{
93+
// tag::delete-index-notfound
94+
try {
95+
DeleteIndexRequest request = new DeleteIndexRequest("does_not_exist");
96+
client.indices().deleteIndex(request);
97+
} catch (ElasticsearchException exception) {
98+
if (exception.status() == RestStatus.NOT_FOUND) {
99+
// <1>
100+
}
101+
}
102+
// end::delete-index-notfound
103+
}
104+
}
105+
106+
public void testDeleteIndexAsync() throws Exception {
107+
final RestHighLevelClient client = highLevelClient();
108+
109+
{
110+
CreateIndexResponse createIndexResponse = client.indices().createIndex(new CreateIndexRequest("posts"));
111+
assertTrue(createIndexResponse.isAcknowledged());
112+
}
113+
114+
{
115+
DeleteIndexRequest request = new DeleteIndexRequest("posts");
89116

90117
// tag::delete-index-execute-async
91118
client.indices().deleteIndexAsync(request, new ActionListener<DeleteIndexResponse>() {
@@ -100,19 +127,12 @@ public void onFailure(Exception e) {
100127
}
101128
});
102129
// end::delete-index-execute-async
103-
}
104130

105-
{
106-
// tag::delete-index-notfound
107-
try {
108-
DeleteIndexRequest request = new DeleteIndexRequest("does_not_exist");
109-
client.indices().deleteIndex(request);
110-
} catch (ElasticsearchException exception) {
111-
if (exception.status() == RestStatus.NOT_FOUND) {
112-
// <1>
113-
}
114-
}
115-
// end::delete-index-notfound
131+
assertBusy(() -> {
132+
// TODO Use Indices Exist API instead once it exists
133+
Response response = client.getLowLevelClient().performRequest("HEAD", "posts");
134+
assertTrue(RestStatus.NOT_FOUND.getStatus() == response.getStatusLine().getStatusCode());
135+
});
116136
}
117137
}
118138

@@ -174,6 +194,14 @@ public void testCreateIndex() throws IOException {
174194
// end::create-index-response
175195
assertTrue(acknowledged);
176196
assertTrue(shardsAcked);
197+
}
198+
}
199+
200+
public void testCreateIndexAsync() throws Exception {
201+
final RestHighLevelClient client = highLevelClient();
202+
203+
{
204+
CreateIndexRequest request = new CreateIndexRequest("twitter");
177205

178206
// tag::create-index-execute-async
179207
client.indices().createIndexAsync(request, new ActionListener<CreateIndexResponse>() {
@@ -188,6 +216,13 @@ public void onFailure(Exception e) {
188216
}
189217
});
190218
// end::create-index-execute-async
219+
220+
assertBusy(() -> {
221+
// TODO Use Indices Exist API instead once it exists
222+
Response response = client.getLowLevelClient().performRequest("HEAD", "twitter");
223+
assertTrue(RestStatus.OK.getStatus() == response.getStatusLine().getStatusCode());
224+
});
191225
}
192226
}
227+
193228
}

client/transport/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
compile "org.elasticsearch.plugin:lang-mustache-client:${version}"
3333
compile "org.elasticsearch.plugin:percolator-client:${version}"
3434
compile "org.elasticsearch.plugin:parent-join-client:${version}"
35+
compile "org.elasticsearch.plugin:rank-eval-client:${version}"
3536
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
3637
testCompile "junit:junit:${versions.junit}"
3738
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
@@ -54,4 +55,4 @@ namingConventions {
5455
testClass = 'com.carrotsearch.randomizedtesting.RandomizedTest'
5556
//we don't have integration tests
5657
skipIntegTestInDisguise = true
57-
}
58+
}

core/licenses/lucene-analyzers-common-7.2.0-snapshot-7deca62.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+
4e1b4638fb8b07befc8175880641f821af3e655a

0 commit comments

Comments
 (0)