From dd21aa41be9300ce7e29e918c9e4a87a9d98db22 Mon Sep 17 00:00:00 2001 From: markharwood Date: Mon, 7 Nov 2016 10:45:35 +0000 Subject: [PATCH 01/22] Docs fix - Diversified sampler agg had incorrect title and example Closes #21347 --- .../bucket/diversified-sampler-aggregation.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc index ac6dff5a248..f5a45da976b 100644 --- a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc @@ -1,5 +1,5 @@ [[search-aggregations-bucket-diversified-sampler-aggregation]] -=== Sampler Aggregation +=== Diversified Sampler Aggregation experimental[] @@ -24,7 +24,7 @@ Example: }, "aggs": { "sample": { - "sampler": { + "diversified_sampler": { "shard_size": 200, "field" : "user.id" }, From c92b4b30a0db01ff8892ac27a8ceccefc4d3b70a Mon Sep 17 00:00:00 2001 From: Alexander Kazakov Date: Mon, 7 Nov 2016 15:02:09 +0300 Subject: [PATCH 02/22] Percentiles bucket fails for 100th percentile (#21218) It mistakenly multiplies the quantile by the array `length` instead of `length-1`. --- .../PercentilesBucketPipelineAggregator.java | 2 +- .../pipeline/PercentilesBucketIT.java | 47 +++++++------------ 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregator.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregator.java index 2818d0f3f5e..7f51a99d798 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregator.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregator.java @@ -88,7 +88,7 @@ public class PercentilesBucketPipelineAggregator extends BucketMetricsPipelineAg } } else { for (int i = 0; i < percents.length; i++) { - int index = (int)((percents[i] / 100.0) * data.size()); + int index = (int) Math.round((percents[i] / 100.0) * (data.size() - 1)); percentiles[i] = data.get(index); } } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java index 3ad2367c5c5..179956a38e8 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java @@ -51,7 +51,7 @@ import static org.hamcrest.core.IsNull.notNullValue; public class PercentilesBucketIT extends ESIntegTestCase { private static final String SINGLE_VALUED_FIELD_NAME = "l_value"; - private static final double[] PERCENTS = {1.0, 25.0, 50.0, 75.0, 99.0}; + private static final double[] PERCENTS = {0.0, 1.0, 25.0, 50.0, 75.0, 99.0, 100.0}; static int numDocs; static int interval; static int minRandomValue; @@ -123,11 +123,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = response.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Double p : PERCENTS) { - double expected = values[(int)((p / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } - + assertPercentileBucket(PERCENTS, values, percentilesBucketValue); } public void testDocCountAsSubAgg() throws Exception { @@ -174,10 +170,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = termsBucket.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Double p : PERCENTS) { - double expected = values[(int)((p / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, values, percentilesBucketValue); } } @@ -212,10 +205,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = response.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Double p : PERCENTS) { - double expected = values[(int)((p / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, values, percentilesBucketValue); } public void testMetricTopLevelDefaultPercents() throws Exception { @@ -304,10 +294,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = termsBucket.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Double p : PERCENTS) { - double expected = values.get((int) ((p / 100) * values.size())); - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, values.stream().mapToDouble(Double::doubleValue).toArray(), percentilesBucketValue); } } @@ -361,10 +348,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = termsBucket.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Double p : PERCENTS) { - double expected = values[(int)((p / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, values, percentilesBucketValue); } } @@ -489,7 +473,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { .subAggregation( histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval) .extendedBounds(minRandomValue, maxRandomValue)) - .subAggregation(percentilesBucket("percentile_histo_bucket", "histo>_count"))) + .subAggregation(percentilesBucket("percentile_histo_bucket", "histo>_count").percents(PERCENTS))) .addAggregation(percentilesBucket("percentile_terms_bucket", "terms>percentile_histo_bucket.50") .percents(PERCENTS)).execute().actionGet(); @@ -525,10 +509,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = termsBucket.getAggregations().get("percentile_histo_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentile_histo_bucket")); - for (Double p : PERCENTS) { - double expected = innerValues[(int)((p / 100) * innerValues.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, innerValues, percentilesBucketValue); values[i] = percentilesBucketValue.percentile(50.0); } @@ -537,10 +518,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = response.getAggregations().get("percentile_terms_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentile_terms_bucket")); - for (Double p : PERCENTS) { - double expected = values[(int)((p / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(PERCENTS, values, percentilesBucketValue); } public void testNestedWithDecimal() throws Exception { @@ -608,4 +586,11 @@ public class PercentilesBucketIT extends ESIntegTestCase { assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); } } + + private void assertPercentileBucket(double[] percents, double[] values, PercentilesBucket percentiles) { + for (Double p : percents) { + int index = (int) Math.round((p / 100.0) * (values.length - 1)); + assertThat(percentiles.percentile(p), equalTo(values[index])); + } + } } From 457c87affb72f24b4e758e798da9f1f6f6a9973f Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 7 Nov 2016 13:48:04 +0100 Subject: [PATCH 03/22] Fix PercentilesBucketIT expectations. --- .../pipeline/PercentilesBucketIT.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java index 179956a38e8..c582c76bd8c 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java @@ -34,6 +34,7 @@ import org.elasticsearch.test.ESIntegTestCase; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Iterator; import java.util.List; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -238,11 +239,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = response.getAggregations().get("percentiles_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentiles_bucket")); - for (Percentile p : percentilesBucketValue) { - double expected = values[(int)((p.getPercent() / 100) * values.length)]; - assertThat(percentilesBucketValue.percentile(p.getPercent()), equalTo(expected)); - assertThat(p.getValue(), equalTo(expected)); - } + assertPercentileBucket(values, percentilesBucketValue); } public void testMetricAsSubAgg() throws Exception { @@ -569,10 +566,7 @@ public class PercentilesBucketIT extends ESIntegTestCase { PercentilesBucket percentilesBucketValue = termsBucket.getAggregations().get("percentile_histo_bucket"); assertThat(percentilesBucketValue, notNullValue()); assertThat(percentilesBucketValue.getName(), equalTo("percentile_histo_bucket")); - for (Double p : percent) { - double expected = innerValues[(int)((p / 100) * innerValues.length)]; - assertThat(percentilesBucketValue.percentile(p), equalTo(expected)); - } + assertPercentileBucket(innerValues, percentilesBucketValue); values[i] = percentilesBucketValue.percentile(99.9); } @@ -587,10 +581,21 @@ public class PercentilesBucketIT extends ESIntegTestCase { } } - private void assertPercentileBucket(double[] percents, double[] values, PercentilesBucket percentiles) { - for (Double p : percents) { - int index = (int) Math.round((p / 100.0) * (values.length - 1)); - assertThat(percentiles.percentile(p), equalTo(values[index])); + private void assertPercentileBucket(double[] values, PercentilesBucket percentiles) { + for (Percentile percentile : percentiles) { + assertEquals(percentiles.percentile(percentile.getPercent()), percentile.getValue(), 0d); + int index = (int) Math.round((percentile.getPercent() / 100.0) * (values.length - 1)); + assertThat(percentile.getValue(), equalTo(values[index])); } } + + private void assertPercentileBucket(double[] percents, double[] values, PercentilesBucket percentiles) { + Iterator it = percentiles.iterator(); + for (int i = 0; i < percents.length; ++i) { + assertTrue(it.hasNext()); + assertEquals(percents[i], it.next().getPercent(), 0d); + } + assertFalse(it.hasNext()); + assertPercentileBucket(values, percentiles); + } } From 5413efc570dfed0db26ede2cc0ef6ab737417748 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Mon, 7 Nov 2016 13:59:11 +0100 Subject: [PATCH 04/22] Packaging Deb: configure start-stop-daemon to not go into background (#21343) On ubuntu 14.04, which uses upstart, where as our debian package uses sysvinit, there is no stdout/stderr message printed when starting up, because the start-stop-daemon swallows it. As Elasticsearch is started to daemonize, we can remove the background flag from the start-stop-daemon and thus see, if the system does not have enough memory for starting up - something that happens often on VMs, since Elasticsearch 5.0 uses 2gb by default instead of one. Relates #21300 Relates #12716 --- distribution/deb/src/main/packaging/init.d/elasticsearch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/deb/src/main/packaging/init.d/elasticsearch b/distribution/deb/src/main/packaging/init.d/elasticsearch index f04008ba796..ae0bd44c291 100755 --- a/distribution/deb/src/main/packaging/init.d/elasticsearch +++ b/distribution/deb/src/main/packaging/init.d/elasticsearch @@ -137,7 +137,7 @@ case "$1" in fi # Start Daemon - start-stop-daemon -d $ES_HOME --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS + start-stop-daemon -d $ES_HOME --start --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS return=$? if [ $return -eq 0 ]; then i=0 From 8383af67349762cd4d5db2a69509daccc5b9e2e0 Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Mon, 7 Nov 2016 14:14:52 +0100 Subject: [PATCH 05/22] The routing query string param is supported by mget but was missing from the rest spec (#21357) --- rest-api-spec/src/main/resources/rest-api-spec/api/mget.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json index 1f1f5adf75e..46f595b2186 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json @@ -32,6 +32,10 @@ "type" : "boolean", "description" : "Refresh the shard containing the document before performing the operation" }, + "routing": { + "type" : "string", + "description" : "Specific routing value" + }, "_source": { "type" : "list", "description" : "True or false to return the _source field or not, or a list of fields to return" From a36465d479751103fc1c9e58b0e38d1b56b07698 Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Mon, 7 Nov 2016 14:48:50 +0100 Subject: [PATCH 06/22] Removed left over ID and [float] from the setup docs --- docs/reference/setup/important-settings.asciidoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/reference/setup/important-settings.asciidoc b/docs/reference/setup/important-settings.asciidoc index 80e6c1801e9..63f988325a7 100644 --- a/docs/reference/setup/important-settings.asciidoc +++ b/docs/reference/setup/important-settings.asciidoc @@ -184,6 +184,3 @@ discovery.zen.minimum_master_nodes: 2 IMPORTANT: If `discovery.zen.minimum_master_nodes` is not set when Elasticsearch is running in <>, an exception will be thrown which will prevent the node from starting. - -[float] -[[node.max_local_storage_nodes]] From 263af27d766a67263add2ba620f47776bd131316 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 7 Nov 2016 14:55:07 +0100 Subject: [PATCH 07/22] Fix docs example after #21218. --- .../pipeline/percentiles-bucket-aggregation.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc b/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc index fcb29104d67..252f535fd54 100644 --- a/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc @@ -65,7 +65,7 @@ POST /sales/_search <1> `buckets_path` instructs this percentiles_bucket aggregation that we want to calculate percentiles for the `sales` aggregation in the `sales_per_month` date histogram. -<2> `percents` specifies which percentiles we wish to calculate, in this case, the 25th, 50th and 75th percentil +<2> `percents` specifies which percentiles we wish to calculate, in this case, the 25th, 50th and 75th percentiles. And the following may be the response: @@ -107,7 +107,7 @@ And the following may be the response: }, "percentiles_monthly_sales": { "values" : { - "25.0": 60.0, + "25.0": 375.0, "50.0": 375.0, "75.0": 550.0 } From 23a271f0922640fa2502b1b4cd45dd02d62972a4 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 13:20:22 -0500 Subject: [PATCH 08/22] Address race condition in HTTP pipeline tests This commit adapts a previous fix to the HTTP pipeline tests for Netty 4 to Netty 3. Relates #19845 --- .../Netty3HttpServerPipeliningTests.java | 68 +++++++++++++------ .../Netty4HttpServerPipeliningTests.java | 17 ++--- 2 files changed, 53 insertions(+), 32 deletions(-) diff --git a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3HttpServerPipeliningTests.java b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3HttpServerPipeliningTests.java index 29fc543c4d2..a0f7fe787da 100644 --- a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3HttpServerPipeliningTests.java +++ b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3HttpServerPipeliningTests.java @@ -41,23 +41,24 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler; import org.jboss.netty.handler.codec.http.DefaultHttpResponse; import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; -import org.jboss.netty.handler.codec.http.QueryStringDecoder; import org.junit.After; import org.junit.Before; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import static org.elasticsearch.http.netty3.Netty3HttpClient.returnHttpResponseBodies; +import static org.elasticsearch.test.hamcrest.RegexMatcher.matches; +import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.is; import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH; import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK; import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; @@ -95,14 +96,21 @@ public class Netty3HttpServerPipeliningTests extends ESTestCase { .build(); httpServerTransport = new CustomNetty3HttpServerTransport(settings); httpServerTransport.start(); - TransportAddress transportAddress = (TransportAddress) randomFrom(httpServerTransport.boundAddress() - .boundAddresses()); + TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses()); - List requests = Arrays.asList("/firstfast", "/slow?sleep=500", "/secondfast", "/slow?sleep=1000", "/thirdfast"); + final int numberOfRequests = randomIntBetween(4, 16); + final List requests = new ArrayList<>(numberOfRequests); + for (int i = 0; i < numberOfRequests; i++) { + if (rarely()) { + requests.add("/slow/" + i); + } else { + requests.add("/" + i); + } + } try (Netty3HttpClient nettyHttpClient = new Netty3HttpClient()) { Collection responses = nettyHttpClient.get(transportAddress.address(), requests.toArray(new String[]{})); Collection responseBodies = returnHttpResponseBodies(responses); - assertThat(responseBodies, contains("/firstfast", "/slow?sleep=500", "/secondfast", "/slow?sleep=1000", "/thirdfast")); + assertThat(responseBodies, contains(requests.toArray())); } } @@ -113,17 +121,37 @@ public class Netty3HttpServerPipeliningTests extends ESTestCase { .build(); httpServerTransport = new CustomNetty3HttpServerTransport(settings); httpServerTransport.start(); - TransportAddress transportAddress = (TransportAddress) randomFrom(httpServerTransport.boundAddress() - .boundAddresses()); + TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses()); + + final int numberOfRequests = randomIntBetween(4, 16); + final Set slowIds = new HashSet<>(); + final List requests = new ArrayList<>(numberOfRequests); + for (int i = 0; i < numberOfRequests; i++) { + if (rarely()) { + requests.add("/slow/" + i); + slowIds.add(i); + } else { + requests.add("/" + i); + } + } - List requests = Arrays.asList("/slow?sleep=1000", "/firstfast", "/secondfast", "/thirdfast", "/slow?sleep=500"); try (Netty3HttpClient nettyHttpClient = new Netty3HttpClient()) { Collection responses = nettyHttpClient.get(transportAddress.address(), requests.toArray(new String[]{})); List responseBodies = new ArrayList<>(returnHttpResponseBodies(responses)); - // we cannot be sure about the order of the fast requests, but the slow ones should have to be last - assertThat(responseBodies, hasSize(5)); - assertThat(responseBodies.get(3), is("/slow?sleep=500")); - assertThat(responseBodies.get(4), is("/slow?sleep=1000")); + // we cannot be sure about the order of the responses, but the slow ones should come last + assertThat(responseBodies, hasSize(numberOfRequests)); + for (int i = 0; i < numberOfRequests - slowIds.size(); i++) { + assertThat(responseBodies.get(i), matches("/\\d+")); + } + + final Set ids = new HashSet<>(); + for (int i = 0; i < slowIds.size(); i++) { + final String response = responseBodies.get(numberOfRequests - slowIds.size() + i); + assertThat(response, matches("/slow/\\d+")); + assertTrue(ids.add(Integer.parseInt(response.split("/")[2]))); + } + + assertThat(ids, equalTo(slowIds)); } } @@ -216,17 +244,15 @@ public class Netty3HttpServerPipeliningTests extends ESTestCase { httpResponse.headers().add(CONTENT_LENGTH, buffer.readableBytes()); httpResponse.setContent(buffer); - QueryStringDecoder decoder = new QueryStringDecoder(request.getUri()); - - final int timeout = request.getUri().startsWith("/slow") && decoder.getParameters().containsKey("sleep") - ? Integer.valueOf(decoder.getParameters().get("sleep").get(0)) : 0; - if (timeout > 0) { + final boolean slow = request.getUri().matches("/slow/\\d+"); + if (slow) { try { - Thread.sleep(timeout); + Thread.sleep(scaledRandomIntBetween(500, 1000)); } catch (InterruptedException e1) { - Thread.currentThread().interrupt(); throw new RuntimeException(e1); } + } else { + assert request.getUri().matches("/\\d+"); } if (oue != null) { diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java index 50c65a6195e..701baf80aed 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java @@ -89,8 +89,7 @@ public class Netty4HttpServerPipeliningTests extends ESTestCase { .build(); try (final HttpServerTransport httpServerTransport = new CustomNettyHttpServerTransport(settings)) { httpServerTransport.start(); - final TransportAddress transportAddress = - (TransportAddress) randomFrom(httpServerTransport.boundAddress().boundAddresses()); + final TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses()); final int numberOfRequests = randomIntBetween(4, 16); final List requests = new ArrayList<>(numberOfRequests); @@ -117,18 +116,15 @@ public class Netty4HttpServerPipeliningTests extends ESTestCase { .build(); try (final HttpServerTransport httpServerTransport = new CustomNettyHttpServerTransport(settings)) { httpServerTransport.start(); - final TransportAddress transportAddress = - (TransportAddress) randomFrom(httpServerTransport.boundAddress().boundAddresses()); + final TransportAddress transportAddress = randomFrom(httpServerTransport.boundAddress().boundAddresses()); final int numberOfRequests = randomIntBetween(4, 16); final Set slowIds = new HashSet<>(); final List requests = new ArrayList<>(numberOfRequests); - int numberOfSlowRequests = 0; for (int i = 0; i < numberOfRequests; i++) { if (rarely()) { requests.add("/slow/" + i); slowIds.add(i); - numberOfSlowRequests++; } else { requests.add("/" + i); } @@ -137,16 +133,15 @@ public class Netty4HttpServerPipeliningTests extends ESTestCase { try (Netty4HttpClient nettyHttpClient = new Netty4HttpClient()) { Collection responses = nettyHttpClient.get(transportAddress.address(), requests.toArray(new String[]{})); List responseBodies = new ArrayList<>(Netty4HttpClient.returnHttpResponseBodies(responses)); - // we can not be sure about the order of the responses, but the slow ones should - // come last + // we can not be sure about the order of the responses, but the slow ones should come last assertThat(responseBodies, hasSize(numberOfRequests)); - for (int i = 0; i < numberOfRequests - numberOfSlowRequests; i++) { + for (int i = 0; i < numberOfRequests - slowIds.size(); i++) { assertThat(responseBodies.get(i), matches("/\\d+")); } final Set ids = new HashSet<>(); - for (int i = 0; i < numberOfSlowRequests; i++) { - final String response = responseBodies.get(numberOfRequests - numberOfSlowRequests + i); + for (int i = 0; i < slowIds.size(); i++) { + final String response = responseBodies.get(numberOfRequests - slowIds.size() + i); assertThat(response, matches("/slow/\\d+" )); assertTrue(ids.add(Integer.parseInt(response.split("/")[2]))); } From 8067412983fa177b37a8eb76e6e86aa841d9c7a5 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 14:04:04 -0500 Subject: [PATCH 09/22] Remove load average leniency Today when acquiring load average stats, this method is rather lenient when reading /proc/loadavg. This commit removes this leniency so that any such issues are more likely to be exposed to the end-user. Relates #21380 --- .../org/elasticsearch/monitor/os/OsProbe.java | 59 ++++++++----------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java b/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java index f2195732db3..1c93407a749 100644 --- a/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java +++ b/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java @@ -29,6 +29,7 @@ import org.elasticsearch.monitor.Probes; import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.file.Files; import java.nio.file.Path; @@ -120,10 +121,8 @@ public class OsProbe { * * On Windows, this method returns {@code null}. * - * On Linux, this method should return the 1, 5, and 15-minute load - * averages. If obtaining these values from {@code /proc/loadavg} - * fails, the method will fallback to obtaining the 1-minute load - * average. + * On Linux, this method returns the 1, 5, and 15-minute load + * averages. * * On macOS, this method should return the 1-minute load average. * @@ -133,30 +132,31 @@ public class OsProbe { if (Constants.WINDOWS) { return null; } else if (Constants.LINUX) { - final String procLoadAvg = readProcLoadavg(); - if (procLoadAvg != null) { + try { + final String procLoadAvg = readProcLoadavg(); assert procLoadAvg.matches("(\\d+\\.\\d+\\s+){3}\\d+/\\d+\\s+\\d+"); final String[] fields = procLoadAvg.split("\\s+"); - try { - return new double[]{Double.parseDouble(fields[0]), Double.parseDouble(fields[1]), Double.parseDouble(fields[2])}; - } catch (final NumberFormatException e) { - if (logger.isDebugEnabled()) { - logger.debug(String.format(Locale.ROOT, "error parsing /proc/loadavg [%s]", procLoadAvg), e); - } + return new double[]{Double.parseDouble(fields[0]), Double.parseDouble(fields[1]), Double.parseDouble(fields[2])}; + } catch (final IOException e) { + if (logger.isDebugEnabled()) { + logger.debug("error reading /proc/loadavg", e); } + return null; + } + } else { + assert Constants.MAC_OS_X; + if (getSystemLoadAverage == null) { + return null; + } + try { + final double oneMinuteLoadAverage = (double) getSystemLoadAverage.invoke(osMxBean); + return new double[]{oneMinuteLoadAverage >= 0 ? oneMinuteLoadAverage : -1, -1, -1}; + } catch (IllegalAccessException | InvocationTargetException e) { + if (logger.isDebugEnabled()) { + logger.debug("error reading one minute load average from operating system", e); + } + return null; } - // fallback - } - - if (getSystemLoadAverage == null) { - return null; - } - try { - final double oneMinuteLoadAverage = (double) getSystemLoadAverage.invoke(osMxBean); - return new double[] { oneMinuteLoadAverage >= 0 ? oneMinuteLoadAverage : -1, -1, -1 }; - } catch (final Exception e) { - logger.debug("error obtaining system load average", e); - return null; } } @@ -171,15 +171,8 @@ public class OsProbe { * @return the line from {@code /proc/loadavg} or {@code null} */ @SuppressForbidden(reason = "access /proc/loadavg") - String readProcLoadavg() { - try { - final List lines = Files.readAllLines(PathUtils.get("/proc/loadavg")); - assert lines != null && lines.size() == 1; - return lines.get(0); - } catch (final IOException e) { - logger.debug("error reading /proc/loadavg", e); - return null; - } + String readProcLoadavg() throws IOException { + return readSingleLine(PathUtils.get("/proc/loadavg")); } public short getSystemCpuPercent() { From 871a077ac467e60b69a7e8cb59d34abde7d95b8c Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Mon, 7 Nov 2016 14:20:28 -0500 Subject: [PATCH 10/22] Fixes get snapshot duplicates when asking for _all (#21340) Before, when requesting to get the snapshots in a repository, if `_all` was specified for the set of snapshots to get, any in-progress snapshots would be returned twice. This commit fixes the issue ensuring that each snapshot, whether in-progress or completed, is only returned once when making a call to get snapshots (GET /_snapshot/{repository_name}/_all). This commit also enables `_current` to appear anywhere in the get snapshots list, and will be used as a pseudo regex to mean "match any currently running snapshots". Closes #21335 --- .../get/TransportGetSnapshotsAction.java | 41 ++++++++++--------- .../SharedClusterSnapshotRestoreIT.java | 38 ++++++++++++++--- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java index ad8cb1ae88e..573bb0ea263 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java @@ -39,7 +39,7 @@ import org.elasticsearch.transport.TransportService; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedHashSet; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -80,25 +80,26 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction snapshotInfoBuilder = new ArrayList<>(); - if (isAllSnapshots(request.snapshots())) { - snapshotInfoBuilder.addAll(snapshotsService.currentSnapshots(repository)); - snapshotInfoBuilder.addAll(snapshotsService.snapshots(repository, - snapshotsService.snapshotIds(repository), - request.ignoreUnavailable())); - } else if (isCurrentSnapshots(request.snapshots())) { - snapshotInfoBuilder.addAll(snapshotsService.currentSnapshots(repository)); - } else { - final Map allSnapshotIds = new HashMap<>(); - for (SnapshotInfo snapshotInfo : snapshotsService.currentSnapshots(repository)) { - SnapshotId snapshotId = snapshotInfo.snapshotId(); - allSnapshotIds.put(snapshotId.getName(), snapshotId); - } + final Map allSnapshotIds = new HashMap<>(); + final List currentSnapshotIds = new ArrayList<>(); + for (SnapshotInfo snapshotInfo : snapshotsService.currentSnapshots(repository)) { + SnapshotId snapshotId = snapshotInfo.snapshotId(); + allSnapshotIds.put(snapshotId.getName(), snapshotId); + currentSnapshotIds.add(snapshotId); + } + if (isCurrentSnapshotsOnly(request.snapshots()) == false) { for (SnapshotId snapshotId : snapshotsService.snapshotIds(repository)) { allSnapshotIds.put(snapshotId.getName(), snapshotId); } - final Set toResolve = new LinkedHashSet<>(); // maintain order + } + final Set toResolve = new HashSet<>(); + if (isAllSnapshots(request.snapshots())) { + toResolve.addAll(allSnapshotIds.values()); + } else { for (String snapshotOrPattern : request.snapshots()) { - if (Regex.isSimpleMatchPattern(snapshotOrPattern) == false) { + if (GetSnapshotsRequest.CURRENT_SNAPSHOT.equalsIgnoreCase(snapshotOrPattern)) { + toResolve.addAll(currentSnapshotIds); + } else if (Regex.isSimpleMatchPattern(snapshotOrPattern) == false) { if (allSnapshotIds.containsKey(snapshotOrPattern)) { toResolve.add(allSnapshotIds.get(snapshotOrPattern)); } else if (request.ignoreUnavailable() == false) { @@ -113,12 +114,12 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction(toResolve), request.ignoreUnavailable())); } + + snapshotInfoBuilder.addAll(snapshotsService.snapshots(repository, new ArrayList<>(toResolve), request.ignoreUnavailable())); listener.onResponse(new GetSnapshotsResponse(snapshotInfoBuilder)); } catch (Exception e) { listener.onFailure(e); @@ -129,7 +130,7 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction responseListener = + client.admin().cluster().prepareCreateSnapshot(repositoryName, "snap-on-empty-repo") + .setWaitForCompletion(false) + .setIndices(indexName) + .execute(); + waitForBlock(initialBlockedNode, repositoryName, TimeValue.timeValueSeconds(60)); // wait for block to kick in + getSnapshotsResponse = client.admin().cluster() + .prepareGetSnapshots("test-repo") + .setSnapshots(randomFrom("_all", "_current", "snap-on-*", "*-on-empty-repo", "snap-on-empty-repo")) + .get(); + assertEquals(1, getSnapshotsResponse.getSnapshots().size()); + assertEquals("snap-on-empty-repo", getSnapshotsResponse.getSnapshots().get(0).snapshotId().getName()); + unblockNode(repositoryName, initialBlockedNode); // unblock node + responseListener.actionGet(TimeValue.timeValueMillis(10000L)); // timeout after 10 seconds + client.admin().cluster().prepareDeleteSnapshot(repositoryName, "snap-on-empty-repo").get(); + final int numSnapshots = randomIntBetween(1, 3) + 1; - logger.info("--> take {} snapshot(s)", numSnapshots); + logger.info("--> take {} snapshot(s)", numSnapshots - 1); final String[] snapshotNames = new String[numSnapshots]; for (int i = 0; i < numSnapshots - 1; i++) { final String snapshotName = randomAsciiOfLength(8).toLowerCase(Locale.ROOT); @@ -2538,9 +2556,19 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas logger.info("--> get all snapshots with a current in-progress"); // with ignore unavailable set to true, should not throw an exception + final List snapshotsToGet = new ArrayList<>(); + if (randomBoolean()) { + // use _current plus the individual names of the finished snapshots + snapshotsToGet.add("_current"); + for (int i = 0; i < numSnapshots - 1; i++) { + snapshotsToGet.add(snapshotNames[i]); + } + } else { + snapshotsToGet.add("_all"); + } getSnapshotsResponse = client.admin().cluster() .prepareGetSnapshots(repositoryName) - .addSnapshots("_all") + .setSnapshots(snapshotsToGet.toArray(Strings.EMPTY_ARRAY)) .get(); List sortedNames = Arrays.asList(snapshotNames); Collections.sort(sortedNames); From f80aa65fe96f0804a0877f2602b7ae0f32ea49f9 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 15:50:06 -0500 Subject: [PATCH 11/22] Remove JDK 7 checks from JVMCheck This commit removes checks for buggy JDK 7 JVMs from the JVM check as Elasticsearch does not support JDK 7. Relates #21381 --- .../src/main/java/org/elasticsearch/bootstrap/JVMCheck.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java index c367b38a79b..fd7c9c4b20b 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java @@ -174,12 +174,6 @@ final class JVMCheck { static { Map bugs = new HashMap<>(); - // 1.7.0: loop optimizer bug - bugs.put("21.0-b17", new HotspotBug("https://bugs.openjdk.java.net/browse/JDK-7070134", "-XX:-UseLoopPredicate")); - // register allocation issues (technically only x86/amd64). This impacted update 40, 45, and 51 - bugs.put("24.0-b56", new HotspotBug("https://bugs.openjdk.java.net/browse/JDK-8024830", "-XX:-UseSuperWord")); - bugs.put("24.45-b08", new HotspotBug("https://bugs.openjdk.java.net/browse/JDK-8024830", "-XX:-UseSuperWord")); - bugs.put("24.51-b03", new HotspotBug("https://bugs.openjdk.java.net/browse/JDK-8024830", "-XX:-UseSuperWord")); G1GCCheck g1GcCheck = new G1GCCheck(); bugs.put("25.0-b70", g1GcCheck); bugs.put("25.11-b03", g1GcCheck); From b30732c4644541934100dc5ed9f59b668d167008 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 16:19:05 -0500 Subject: [PATCH 12/22] Migrate G1GC JVM check to bootstrap check This commit fixes an assertion in G1GCCheck#jvmVersion that was mistakenly asserting on itself. Relates #21388 --- .../bootstrap/BootstrapCheck.java | 50 ++++++ .../org/elasticsearch/bootstrap/JVMCheck.java | 156 +----------------- .../bootstrap/BootstrapCheckTests.java | 56 +++++++ .../reference/setup/bootstrap-checks.asciidoc | 8 + 4 files changed, 116 insertions(+), 154 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java index a0c834aa35f..a466eb2e7c6 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java @@ -44,6 +44,8 @@ import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.function.Predicate; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * We enforce limits once any network host is configured. In this case we assume the node is running in production @@ -172,6 +174,7 @@ final class BootstrapCheck { checks.add(new UseSerialGCCheck()); checks.add(new OnErrorCheck()); checks.add(new OnOutOfMemoryErrorCheck()); + checks.add(new G1GCCheck()); return Collections.unmodifiableList(checks); } @@ -549,4 +552,51 @@ final class BootstrapCheck { } + /** + * Bootstrap check for versions of HotSpot that are known to have issues that can lead to index corruption when G1GC is enabled. + */ + static class G1GCCheck implements BootstrapCheck.Check { + + @Override + public boolean check() { + if ("Oracle Corporation".equals(jvmVendor()) && isG1GCEnabled()) { + final String jvmVersion = jvmVersion(); + final Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)-b\\d+"); + final Matcher matcher = pattern.matcher(jvmVersion); + final boolean matches = matcher.matches(); + assert matches : jvmVersion; + final int major = Integer.parseInt(matcher.group(1)); + final int update = Integer.parseInt(matcher.group(2)); + return major == 25 && update < 40; + } else { + return false; + } + } + + // visible for testing + String jvmVendor() { + return Constants.JVM_VENDOR; + } + + // visible for testing + boolean isG1GCEnabled() { + assert "Oracle Corporation".equals(jvmVendor()); + return JvmInfo.jvmInfo().useG1GC().equals("true"); + } + + // visible for testing + String jvmVersion() { + assert "Oracle Corporation".equals(jvmVendor()); + return Constants.JVM_VERSION; + } + + @Override + public String errorMessage() { + return String.format( + Locale.ROOT, + "JVM version [%s] can cause data corruption when used with G1GC; upgrade to at least Java 8u40", jvmVersion()); + } + + } + } diff --git a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java index fd7c9c4b20b..8afebbce82d 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java @@ -31,174 +31,21 @@ import java.util.Optional; /** Checks that the JVM is ok and won't cause index corruption */ final class JVMCheck { + /** no instantiation */ private JVMCheck() {} - /** - * URL with latest JVM recommendations - */ - static final String JVM_RECOMMENDATIONS = "http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html"; - /** * System property which if set causes us to bypass the check completely (but issues a warning in doing so) */ static final String JVM_BYPASS = "es.bypass.vm.check"; - /** - * Metadata and messaging for checking and reporting HotSpot - * issues. - */ - interface HotSpotCheck { - /** - * If this HotSpot check should be executed. - * - * @return true if this HotSpot check should be executed - */ - boolean check(); - - /** - * The error message to display when this HotSpot issue is - * present. - * - * @return the error message for this HotSpot issue - */ - String getErrorMessage(); - - /** - * The warning message for this HotSpot issue if a workaround - * exists and is used. - * - * @return the warning message for this HotSpot issue - */ - Optional getWarningMessage(); - - /** - * The workaround for this HotSpot issue, if one exists. - * - * @return the workaround for this HotSpot issue, if one exists - */ - Optional getWorkaround(); - } - - /** - * Metadata and messaging for hotspot bugs. - */ - static class HotspotBug implements HotSpotCheck { - - /** OpenJDK bug URL */ - final String bugUrl; - - /** Compiler workaround flag (null if there is no workaround) */ - final String workAround; - - HotspotBug(String bugUrl, String workAround) { - this.bugUrl = bugUrl; - this.workAround = workAround; - } - - /** Returns an error message to the user for a broken version */ - public String getErrorMessage() { - StringBuilder sb = new StringBuilder(); - sb.append("Java version: ").append(fullVersion()); - sb.append(" suffers from critical bug ").append(bugUrl); - sb.append(" which can cause data corruption."); - sb.append(System.lineSeparator()); - sb.append("Please upgrade the JVM, see ").append(JVM_RECOMMENDATIONS); - sb.append(" for current recommendations."); - if (workAround != null) { - sb.append(System.lineSeparator()); - sb.append("If you absolutely cannot upgrade, please add ").append(workAround); - sb.append(" to the ES_JAVA_OPTS environment variable."); - sb.append(System.lineSeparator()); - sb.append("Upgrading is preferred, this workaround will result in degraded performance."); - } - return sb.toString(); - } - - /** Warns the user when a workaround is being used to dodge the bug */ - public Optional getWarningMessage() { - StringBuilder sb = new StringBuilder(); - sb.append("Workaround flag ").append(workAround); - sb.append(" for bug ").append(bugUrl); - sb.append(" found. "); - sb.append(System.lineSeparator()); - sb.append("This will result in degraded performance!"); - sb.append(System.lineSeparator()); - sb.append("Upgrading is preferred, see ").append(JVM_RECOMMENDATIONS); - sb.append(" for current recommendations."); - return Optional.of(sb.toString()); - } - - public boolean check() { - return true; - } - - @Override - public Optional getWorkaround() { - return Optional.of(workAround); - } - } - - static class G1GCCheck implements HotSpotCheck { - @Override - public boolean check() { - return JvmInfo.jvmInfo().useG1GC().equals("true"); - } - - /** Returns an error message to the user for a broken version */ - public String getErrorMessage() { - StringBuilder sb = new StringBuilder(); - sb.append("Java version: ").append(fullVersion()); - sb.append(" can cause data corruption"); - sb.append(" when used with G1GC."); - sb.append(System.lineSeparator()); - sb.append("Please upgrade the JVM, see ").append(JVM_RECOMMENDATIONS); - sb.append(" for current recommendations."); - return sb.toString(); - } - - @Override - public Optional getWarningMessage() { - return Optional.empty(); - } - - @Override - public Optional getWorkaround() { - return Optional.empty(); - } - } - - /** mapping of hotspot version to hotspot bug information for the most serious bugs */ - static final Map JVM_BROKEN_HOTSPOT_VERSIONS; - - static { - Map bugs = new HashMap<>(); - - G1GCCheck g1GcCheck = new G1GCCheck(); - bugs.put("25.0-b70", g1GcCheck); - bugs.put("25.11-b03", g1GcCheck); - bugs.put("25.20-b23", g1GcCheck); - bugs.put("25.25-b02", g1GcCheck); - bugs.put("25.31-b07", g1GcCheck); - - JVM_BROKEN_HOTSPOT_VERSIONS = Collections.unmodifiableMap(bugs); - } - /** * Checks that the current JVM is "ok". This means it doesn't have severe bugs that cause data corruption. */ static void check() { if (Boolean.parseBoolean(System.getProperty(JVM_BYPASS))) { Loggers.getLogger(JVMCheck.class).warn("bypassing jvm version check for version [{}], this can result in data corruption!", fullVersion()); - } else if ("Oracle Corporation".equals(Constants.JVM_VENDOR)) { - HotSpotCheck bug = JVM_BROKEN_HOTSPOT_VERSIONS.get(Constants.JVM_VERSION); - if (bug != null && bug.check()) { - if (bug.getWorkaround().isPresent() && ManagementFactory.getRuntimeMXBean().getInputArguments().contains(bug.getWorkaround().get())) { - Loggers.getLogger(JVMCheck.class).warn("{}", bug.getWarningMessage().get()); - } else { - throw new RuntimeException(bug.getErrorMessage()); - } - } } else if ("IBM Corporation".equals(Constants.JVM_VENDOR)) { // currently some old JVM versions from IBM will easily result in index corruption. // 2.8+ seems ok for ES from testing. @@ -237,4 +84,5 @@ final class JVMCheck { sb.append("]"); return sb.toString(); } + } diff --git a/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java b/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java index 2a00ca889d6..6566ed607d0 100644 --- a/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java +++ b/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; @@ -42,6 +43,7 @@ import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.Matchers.not; import static org.mockito.Mockito.mock; @@ -530,6 +532,60 @@ public class BootstrapCheckTests extends ESTestCase { consumer.accept(e); } + public void testG1GCCheck() throws NodeValidationException { + final AtomicBoolean isG1GCEnabled = new AtomicBoolean(true); + final AtomicReference jvmVersion = + new AtomicReference<>(String.format(Locale.ROOT, "25.%d-b%d", randomIntBetween(0, 39), randomIntBetween(1, 128))); + final BootstrapCheck.G1GCCheck oracleCheck = new BootstrapCheck.G1GCCheck() { + + @Override + String jvmVendor() { + return "Oracle Corporation"; + } + + @Override + boolean isG1GCEnabled() { + return isG1GCEnabled.get(); + } + + @Override + String jvmVersion() { + return jvmVersion.get(); + } + + }; + + final NodeValidationException e = + expectThrows( + NodeValidationException.class, + () -> BootstrapCheck.check(true, Collections.singletonList(oracleCheck), "testG1GCCheck")); + assertThat( + e.getMessage(), + containsString( + "JVM version [" + jvmVersion.get() + "] can cause data corruption when used with G1GC; upgrade to at least Java 8u40")); + + // if G1GC is disabled, nothing should happen + isG1GCEnabled.set(false); + BootstrapCheck.check(true, Collections.singletonList(oracleCheck), "testG1GCCheck"); + + // if on or after update 40, nothing should happen independent of whether or not G1GC is enabled + isG1GCEnabled.set(randomBoolean()); + jvmVersion.set(String.format(Locale.ROOT, "25.%d-b%d", randomIntBetween(40, 112), randomIntBetween(1, 128))); + BootstrapCheck.check(true, Collections.singletonList(oracleCheck), "testG1GCCheck"); + + final BootstrapCheck.G1GCCheck nonOracleCheck = new BootstrapCheck.G1GCCheck() { + + @Override + String jvmVendor() { + return randomAsciiOfLength(8); + } + + }; + + // if not on an Oracle JVM, nothing should happen + BootstrapCheck.check(true, Collections.singletonList(nonOracleCheck), "testG1GCCheck"); + } + public void testAlwaysEnforcedChecks() { final BootstrapCheck.Check check = new BootstrapCheck.Check() { @Override diff --git a/docs/reference/setup/bootstrap-checks.asciidoc b/docs/reference/setup/bootstrap-checks.asciidoc index 9c2276bc213..9e199ba8375 100644 --- a/docs/reference/setup/bootstrap-checks.asciidoc +++ b/docs/reference/setup/bootstrap-checks.asciidoc @@ -161,3 +161,11 @@ enabled. This check is always enforced. To pass this check do not enable use the JVM flag `ExitOnOutOfMemoryError`. While this does not have the full capabilities of `OnError` nor `OnOutOfMemoryError`, arbitrary forking will not be supported with seccomp enabled. + +=== G1GC check + +Early versions of the HotSpot JVM that shipped with JDK 8 are known to have +issues that can lead to index corruption when the G1GC collector is enabled. +The versions impacted are those earlier than the version of HotSpot that +shipped with JDK 8u40. The G1GC check detects these early versions of the +HotSpot JVM. From 68a0d20ccde5129d82d4704c4198c22cdc4d90e8 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 7 Nov 2016 22:18:24 +0100 Subject: [PATCH 13/22] increase logging level to DEBUG in backwards-5.0 tests --- qa/backwards-5.0/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/backwards-5.0/build.gradle b/qa/backwards-5.0/build.gradle index 6e1beef51c7..7cb7d7a1a2a 100644 --- a/qa/backwards-5.0/build.gradle +++ b/qa/backwards-5.0/build.gradle @@ -19,5 +19,6 @@ integTest { numNodes = 2 numBwcNodes = 1 bwcVersion = "6.0.0-alpha1-SNAPSHOT" // this is the same as the current version until we released the first RC + setting 'logger.org.elasticsearch', 'DEBUG' } } From 1f0c6cd137225e1e6117918a7cf33603c3ede15b Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 16:27:28 -0500 Subject: [PATCH 14/22] Remove double space in bootstrap checks docs This commit removes a double space in the G1GC check section of the bootstrap check docs. --- docs/reference/setup/bootstrap-checks.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/setup/bootstrap-checks.asciidoc b/docs/reference/setup/bootstrap-checks.asciidoc index 9e199ba8375..1d6a3cf242a 100644 --- a/docs/reference/setup/bootstrap-checks.asciidoc +++ b/docs/reference/setup/bootstrap-checks.asciidoc @@ -165,7 +165,7 @@ forking will not be supported with seccomp enabled. === G1GC check Early versions of the HotSpot JVM that shipped with JDK 8 are known to have -issues that can lead to index corruption when the G1GC collector is enabled. +issues that can lead to index corruption when the G1GC collector is enabled. The versions impacted are those earlier than the version of HotSpot that shipped with JDK 8u40. The G1GC check detects these early versions of the HotSpot JVM. From edb9d8fc036b929d2c0d044cdad6490c8f32da66 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 7 Nov 2016 13:33:08 -0800 Subject: [PATCH 15/22] Docs: Update discovery plugins example configuration with discovery.zen.hosts_provider (#21390) This new setting was added with deguicing unicast hosts providers, but the docs were not updated. --- docs/plugins/discovery-azure-classic.asciidoc | 2 +- docs/plugins/discovery-ec2.asciidoc | 2 +- docs/plugins/discovery-file.asciidoc | 14 +++++++++----- docs/plugins/discovery-gce.asciidoc | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/plugins/discovery-azure-classic.asciidoc b/docs/plugins/discovery-azure-classic.asciidoc index ffb4087bad0..f69df7f5171 100644 --- a/docs/plugins/discovery-azure-classic.asciidoc +++ b/docs/plugins/discovery-azure-classic.asciidoc @@ -56,7 +56,7 @@ cloud: type: pkcs12 discovery: - type: azure + zen.hosts_provider: azure ---- [IMPORTANT] diff --git a/docs/plugins/discovery-ec2.asciidoc b/docs/plugins/discovery-ec2.asciidoc index 90b9047aa56..4c21f7fcc92 100644 --- a/docs/plugins/discovery-ec2.asciidoc +++ b/docs/plugins/discovery-ec2.asciidoc @@ -139,7 +139,7 @@ environments). Here is a simple sample configuration: [source,yaml] ---- discovery: - type: ec2 + zen.hosts_provider: ec2 ---- You must also set `cloud.aws.region` if you are not using default AWS region. See <> for details. diff --git a/docs/plugins/discovery-file.asciidoc b/docs/plugins/discovery-file.asciidoc index e8e1e42f867..15175620d52 100644 --- a/docs/plugins/discovery-file.asciidoc +++ b/docs/plugins/discovery-file.asciidoc @@ -39,11 +39,15 @@ The node must be stopped before removing the plugin. The file-based discovery plugin provides the ability to specify the unicast hosts list through a simple `unicast_hosts.txt` file that can -be dynamically updated at any time. The discovery type for this plugin -is still the default `zen` plugin, so no changes are required to the -`elasticsearch.yml` config file. This plugin simply provides a facility -to supply the unicast hosts list for zen discovery through an external -file that can be updated at any time by a side process. +be dynamically updated at any time. To enable, add the following in `elasticsearch.yml`: + +[source,yaml] +---- +discovery.zen.hosts_provider: file +---- + +This plugin simply provides a facility to supply the unicast hosts list for +zen discovery through an external file that can be updated at any time by a side process. For example, this gives a convenient mechanism for an Elasticsearch instance that is run in docker containers to be dynamically supplied a list of IP diff --git a/docs/plugins/discovery-gce.asciidoc b/docs/plugins/discovery-gce.asciidoc index 0f79a12f4ff..1f19a379dc3 100644 --- a/docs/plugins/discovery-gce.asciidoc +++ b/docs/plugins/discovery-gce.asciidoc @@ -46,7 +46,7 @@ cloud: project_id: zone: discovery: - type: gce + zen.hosts_provider: gce -------------------------------------------------- The following gce settings (prefixed with `cloud.gce`) are supported: From 6a6e1bed55271bfd10fdb29cb7ab42c45aaec888 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 16:35:39 -0500 Subject: [PATCH 16/22] Remove JVMCheck This commit removes JVMCheck. Previously there were three checks in this class: - check for super word bug in JDK 7 - check for G1GC bugs in JDK 8 - check for broken IBM JDKs The first check is obsolete since we require JDK 8 now. The second check is refactored into a bootstrap check. The third check is removed since we do not even support the IBM JDK. Relates #21389 --- .../elasticsearch/bootstrap/Bootstrap.java | 3 - .../org/elasticsearch/bootstrap/JVMCheck.java | 88 ------------------- 2 files changed, 91 deletions(-) delete mode 100644 core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java diff --git a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index 8da3d6b658c..022f7a3c4de 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -271,9 +271,6 @@ final class Bootstrap { closeSystOut(); } - // fail if using broken version - JVMCheck.check(); - // fail if somebody replaced the lucene jars checkLucene(); diff --git a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java deleted file mode 100644 index 8afebbce82d..00000000000 --- a/core/src/main/java/org/elasticsearch/bootstrap/JVMCheck.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.bootstrap; - -import org.apache.lucene.util.Constants; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.monitor.jvm.JvmInfo; - -import java.lang.management.ManagementFactory; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -/** Checks that the JVM is ok and won't cause index corruption */ -final class JVMCheck { - - /** no instantiation */ - private JVMCheck() {} - - /** - * System property which if set causes us to bypass the check completely (but issues a warning in doing so) - */ - static final String JVM_BYPASS = "es.bypass.vm.check"; - - /** - * Checks that the current JVM is "ok". This means it doesn't have severe bugs that cause data corruption. - */ - static void check() { - if (Boolean.parseBoolean(System.getProperty(JVM_BYPASS))) { - Loggers.getLogger(JVMCheck.class).warn("bypassing jvm version check for version [{}], this can result in data corruption!", fullVersion()); - } else if ("IBM Corporation".equals(Constants.JVM_VENDOR)) { - // currently some old JVM versions from IBM will easily result in index corruption. - // 2.8+ seems ok for ES from testing. - float version = Float.POSITIVE_INFINITY; - try { - version = Float.parseFloat(Constants.JVM_VERSION); - } catch (NumberFormatException ignored) { - // this is just a simple best-effort to detect old runtimes, - // if we cannot parse it, we don't fail. - } - if (version < 2.8f) { - StringBuilder sb = new StringBuilder(); - sb.append("IBM J9 runtimes < 2.8 suffer from several bugs which can cause data corruption."); - sb.append(System.lineSeparator()); - sb.append("Your version: " + fullVersion()); - sb.append(System.lineSeparator()); - sb.append("Please upgrade the JVM to a recent IBM JDK"); - throw new RuntimeException(sb.toString()); - } - } - } - - /** - * Returns java + jvm version, looks like this: - * {@code Oracle Corporation 1.8.0_45 [Java HotSpot(TM) 64-Bit Server VM 25.45-b02]} - */ - static String fullVersion() { - StringBuilder sb = new StringBuilder(); - sb.append(Constants.JAVA_VENDOR); - sb.append(" "); - sb.append(Constants.JAVA_VERSION); - sb.append(" ["); - sb.append(Constants.JVM_NAME); - sb.append(" "); - sb.append(Constants.JVM_VERSION); - sb.append("]"); - return sb.toString(); - } - -} From 7c31e8cc589133a300331a141e943974f7b95b3e Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 7 Nov 2016 17:26:28 -0500 Subject: [PATCH 17/22] Modify Javadoc line length in OsProbe.java This commit changes the Javadocs in OsProbe.java to take advantage of the fact that the line-length limit is 140 characters. This change makes these Javadocs easier to read and easier to maintain. --- .../org/elasticsearch/monitor/os/OsProbe.java | 158 ++++++------------ 1 file changed, 53 insertions(+), 105 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java b/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java index 1c93407a749..8d66ba41b30 100644 --- a/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java +++ b/core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java @@ -121,8 +121,7 @@ public class OsProbe { * * On Windows, this method returns {@code null}. * - * On Linux, this method returns the 1, 5, and 15-minute load - * averages. + * On Linux, this method returns the 1, 5, and 15-minute load averages. * * On macOS, this method should return the 1-minute load average. * @@ -161,12 +160,9 @@ public class OsProbe { } /** - * The line from {@code /proc/loadavg}. The first three fields are - * the load averages averaged over 1, 5, and 15 minutes. The fourth - * field is two numbers separated by a slash, the first is the - * number of currently runnable scheduling entities, the second is - * the number of scheduling entities on the system. The fifth field - * is the PID of the most recently created process. + * The line from {@code /proc/loadavg}. The first three fields are the load averages averaged over 1, 5, and 15 minutes. The fourth + * field is two numbers separated by a slash, the first is the number of currently runnable scheduling entities, the second is the + * number of scheduling entities on the system. The fifth field is the PID of the most recently created process. * * @return the line from {@code /proc/loadavg} or {@code null} */ @@ -196,15 +192,11 @@ public class OsProbe { private static final Pattern CONTROL_GROUP_PATTERN = Pattern.compile("\\d+:([^:,]+(?:,[^:,]+)?):(/.*)"); /** - * A map of the control groups to which the Elasticsearch process - * belongs. Note that this is a map because the control groups can - * vary from subsystem to subsystem. Additionally, this map can not - * be cached because a running process can be reclassified. + * A map of the control groups to which the Elasticsearch process belongs. Note that this is a map because the control groups can vary + * from subsystem to subsystem. Additionally, this map can not be cached because a running process can be reclassified. * - * @return a map from subsystems to the control group for the - * Elasticsearch process. - * @throws IOException if an I/O exception occurs reading - * {@code /proc/self/cgroup} + * @return a map from subsystems to the control group for the Elasticsearch process. + * @throws IOException if an I/O exception occurs reading {@code /proc/self/cgroup} */ private Map getControlGroups() throws IOException { final List lines = readProcSelfCgroup(); @@ -227,21 +219,16 @@ public class OsProbe { } /** - * The lines from {@code /proc/self/cgroup}. This file represents - * the control groups to which the Elasticsearch process belongs. - * Each line in this file represents a control group hierarchy of - * the form + * The lines from {@code /proc/self/cgroup}. This file represents the control groups to which the Elasticsearch process belongs. Each + * line in this file represents a control group hierarchy of the form *

* {@code \d+:([^:,]+(?:,[^:,]+)?):(/.*)} *

- * with the first field representing the hierarchy ID, the second - * field representing a comma-separated list of the subsystems - * bound to the hierarchy, and the last field representing the - * control group. + * with the first field representing the hierarchy ID, the second field representing a comma-separated list of the subsystems bound to + * the hierarchy, and the last field representing the control group. * * @return the lines from {@code /proc/self/cgroup} - * @throws IOException if an I/O exception occurs reading - * {@code /proc/self/cgroup} + * @throws IOException if an I/O exception occurs reading {@code /proc/self/cgroup} */ @SuppressForbidden(reason = "access /proc/self/cgroup") List readProcSelfCgroup() throws IOException { @@ -251,33 +238,24 @@ public class OsProbe { } /** - * The total CPU time in nanoseconds consumed by all tasks in the - * cgroup to which the Elasticsearch process belongs for the - * {@code cpuacct} subsystem. + * The total CPU time in nanoseconds consumed by all tasks in the cgroup to which the Elasticsearch process belongs for the {@code + * cpuacct} subsystem. * - * @param controlGroup the control group for the Elasticsearch - * process for the {@code cpuacct} subsystem + * @param controlGroup the control group for the Elasticsearch process for the {@code cpuacct} subsystem * @return the total CPU time in nanoseconds - * @throws IOException if an I/O exception occurs reading - * {@code cpuacct.usage} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpuacct.usage} for the control group */ private long getCgroupCpuAcctUsageNanos(final String controlGroup) throws IOException { return Long.parseLong(readSysFsCgroupCpuAcctCpuAcctUsage(controlGroup)); } /** - * Returns the line from {@code cpuacct.usage} for the control - * group to which the Elasticsearch process belongs for the - * {@code cpuacct} subsystem. This line represents the total CPU - * time in nanoseconds consumed by all tasks in the same control - * group. + * Returns the line from {@code cpuacct.usage} for the control group to which the Elasticsearch process belongs for the {@code cpuacct} + * subsystem. This line represents the total CPU time in nanoseconds consumed by all tasks in the same control group. * - * @param controlGroup the control group to which the Elasticsearch - * process belongs for the {@code cpuacct} - * subsystem + * @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpuacct} subsystem * @return the line from {@code cpuacct.usage} - * @throws IOException if an I/O exception occurs reading - * {@code cpuacct.usage} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpuacct.usage} for the control group */ @SuppressForbidden(reason = "access /sys/fs/cgroup/cpuacct") String readSysFsCgroupCpuAcctCpuAcctUsage(final String controlGroup) throws IOException { @@ -285,33 +263,25 @@ public class OsProbe { } /** - * The total period of time in microseconds for how frequently the - * Elasticsearch control group's access to CPU resources will be + * The total period of time in microseconds for how frequently the Elasticsearch control group's access to CPU resources will be * reallocated. * - * @param controlGroup the control group for the Elasticsearch - * process for the {@code cpuacct} subsystem + * @param controlGroup the control group for the Elasticsearch process for the {@code cpuacct} subsystem * @return the CFS quota period in microseconds - * @throws IOException if an I/O exception occurs reading - * {@code cpu.cfs_period_us} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.cfs_period_us} for the control group */ private long getCgroupCpuAcctCpuCfsPeriodMicros(final String controlGroup) throws IOException { return Long.parseLong(readSysFsCgroupCpuAcctCpuCfsPeriod(controlGroup)); } /** - * Returns the line from {@code cpu.cfs_period_us} for the control - * group to which the Elasticsearch process belongs for the - * {@code cpu} subsystem. This line represents the period of time - * in microseconds for how frequently the control group's access to - * CPU resources will be reallocated. + * Returns the line from {@code cpu.cfs_period_us} for the control group to which the Elasticsearch process belongs for the {@code cpu} + * subsystem. This line represents the period of time in microseconds for how frequently the control group's access to CPU resources + * will be reallocated. * - * @param controlGroup the control group to which the Elasticsearch - * process belongs for the {@code cpu} - * subsystem + * @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpu} subsystem * @return the line from {@code cpu.cfs_period_us} - * @throws IOException if an I/O exception occurs reading - * {@code cpu.cfs_period_us} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.cfs_period_us} for the control group */ @SuppressForbidden(reason = "access /sys/fs/cgroup/cpu") String readSysFsCgroupCpuAcctCpuCfsPeriod(final String controlGroup) throws IOException { @@ -319,33 +289,25 @@ public class OsProbe { } /** - * The total time in microseconds that all tasks in the - * Elasticsearch control group can run during one period as - * specified by {@code cpu.cfs_period_us}. + * The total time in microseconds that all tasks in the Elasticsearch control group can run during one period as specified by {@code + * cpu.cfs_period_us}. * - * @param controlGroup the control group for the Elasticsearch - * process for the {@code cpuacct} subsystem + * @param controlGroup the control group for the Elasticsearch process for the {@code cpuacct} subsystem * @return the CFS quota in microseconds - * @throws IOException if an I/O exception occurs reading - * {@code cpu.cfs_quota_us} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.cfs_quota_us} for the control group */ private long getCgroupCpuAcctCpuCfsQuotaMicros(final String controlGroup) throws IOException { return Long.parseLong(readSysFsCgroupCpuAcctCpuAcctCfsQuota(controlGroup)); } /** - * Returns the line from {@code cpu.cfs_quota_us} for the control - * group to which the Elasticsearch process belongs for the - * {@code cpu} subsystem. This line represents the total time in - * microseconds that all tasks in the control group can run during - * one period as specified by {@code cpu.cfs_period_us}. + * Returns the line from {@code cpu.cfs_quota_us} for the control group to which the Elasticsearch process belongs for the {@code cpu} + * subsystem. This line represents the total time in microseconds that all tasks in the control group can run during one period as + * specified by {@code cpu.cfs_period_us}. * - * @param controlGroup the control group to which the Elasticsearch - * process belongs for the {@code cpu} - * subsystem + * @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpu} subsystem * @return the line from {@code cpu.cfs_quota_us} - * @throws IOException if an I/O exception occurs reading - * {@code cpu.cfs_quota_us} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.cfs_quota_us} for the control group */ @SuppressForbidden(reason = "access /sys/fs/cgroup/cpu") String readSysFsCgroupCpuAcctCpuAcctCfsQuota(final String controlGroup) throws IOException { @@ -353,14 +315,11 @@ public class OsProbe { } /** - * The CPU time statistics for all tasks in the Elasticsearch - * control group. + * The CPU time statistics for all tasks in the Elasticsearch control group. * - * @param controlGroup the control group for the Elasticsearch - * process for the {@code cpuacct} subsystem + * @param controlGroup the control group for the Elasticsearch process for the {@code cpuacct} subsystem * @return the CPU time statistics - * @throws IOException if an I/O exception occurs reading - * {@code cpu.stat} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.stat} for the control group */ private OsStats.Cgroup.CpuStat getCgroupCpuAcctCpuStat(final String controlGroup) throws IOException { final List lines = readSysFsCgroupCpuAcctCpuStat(controlGroup); @@ -388,28 +347,20 @@ public class OsProbe { } /** - * Returns the lines from {@code cpu.stat} for the control - * group to which the Elasticsearch process belongs for the - * {@code cpu} subsystem. These lines represent the CPU time - * statistics and have the form + * Returns the lines from {@code cpu.stat} for the control group to which the Elasticsearch process belongs for the {@code cpu} + * subsystem. These lines represent the CPU time statistics and have the form *

      * nr_periods \d+
      * nr_throttled \d+
      * throttled_time \d+
      * 
- * where {@code nr_periods} is the number of period intervals - * as specified by {@code cpu.cfs_period_us} that have elapsed, - * {@code nr_throttled} is the number of times tasks in the given - * control group have been throttled, and {@code throttled_time} is - * the total time in nanoseconds for which tasks in the given - * control group have been throttled. + * where {@code nr_periods} is the number of period intervals as specified by {@code cpu.cfs_period_us} that have elapsed, {@code + * nr_throttled} is the number of times tasks in the given control group have been throttled, and {@code throttled_time} is the total + * time in nanoseconds for which tasks in the given control group have been throttled. * - * @param controlGroup the control group to which the Elasticsearch - * process belongs for the {@code cpu} - * subsystem + * @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpu} subsystem * @return the lines from {@code cpu.stat} - * @throws IOException if an I/O exception occurs reading - * {@code cpu.stat} for the control group + * @throws IOException if an I/O exception occurs reading {@code cpu.stat} for the control group */ @SuppressForbidden(reason = "access /sys/fs/cgroup/cpu") List readSysFsCgroupCpuAcctCpuStat(final String controlGroup) throws IOException { @@ -419,11 +370,10 @@ public class OsProbe { } /** - * Checks if cgroup stats are available by checking for the existence of {@code /proc/self/cgroup}, - * {@code /sys/fs/cgroup/cpu}, and {@code /sys/fs/cgroup/cpuacct}. + * Checks if cgroup stats are available by checking for the existence of {@code /proc/self/cgroup}, {@code /sys/fs/cgroup/cpu}, and + * {@code /sys/fs/cgroup/cpuacct}. * - * @return {@code true} if the stats are available, otherwise - * {@code false} + * @return {@code true} if the stats are available, otherwise {@code false} */ @SuppressForbidden(reason = "access /proc/self/cgroup, /sys/fs/cgroup/cpu, and /sys/fs/cgroup/cpuacct") protected boolean areCgroupStatsAvailable() { @@ -442,8 +392,7 @@ public class OsProbe { /** * Basic cgroup stats. * - * @return basic cgroup stats, or {@code null} if an I/O exception - * occurred reading the cgroup stats + * @return basic cgroup stats, or {@code null} if an I/O exception occurred reading the cgroup stats */ private OsStats.Cgroup getCgroup() { try { @@ -507,8 +456,7 @@ public class OsProbe { } /** - * Returns a given method of the OperatingSystemMXBean, - * or null if the method is not found or unavailable. + * Returns a given method of the OperatingSystemMXBean, or null if the method is not found or unavailable. */ private static Method getMethod(String methodName) { try { From f83311449211cac6f646557b84b1a711203eb45b Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 7 Nov 2016 15:05:18 -0800 Subject: [PATCH 18/22] Fix g1gc bootstrap check to only try parsing java version for java 8 --- .../main/java/org/elasticsearch/bootstrap/BootstrapCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java index a466eb2e7c6..0676eff5b12 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java @@ -559,7 +559,7 @@ final class BootstrapCheck { @Override public boolean check() { - if ("Oracle Corporation".equals(jvmVendor()) && isG1GCEnabled()) { + if ("Oracle Corporation".equals(jvmVendor()) && Constants.JRE_IS_MINIMUM_JAVA9 == false && isG1GCEnabled()) { final String jvmVersion = jvmVersion(); final Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)-b\\d+"); final Matcher matcher = pattern.matcher(jvmVersion); From 7a2c984bcc7ce8d59900a0f8d96cbb647009273f Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 7 Nov 2016 15:07:34 -0800 Subject: [PATCH 19/22] Test: Remove multi process support from rest test runner (#21391) At one point in the past when moving out the rest tests from core to their own subproject, we had multiple test classes which evenly split up the tests to run. However, we simplified this and went back to a single test runner to have better reproduceability in tests. This change removes the remnants of that multiplexing support. --- .../test/rest/DebClientYamlTestSuiteIT.java | 2 +- .../IntegTestZipClientYamlTestSuiteIT.java | 2 +- .../test/rest/RpmClientYamlTestSuiteIT.java | 2 +- .../test/rest/TarClientYamlTestSuiteIT.java | 2 +- .../test/rest/ZipClientYamlTestSuiteIT.java | 2 +- .../smoketest/DocsClientYamlTestSuiteIT.java | 2 +- .../MatrixStatsClientYamlTestSuiteIT.java | 2 +- .../IngestCommonClientYamlTestSuiteIT.java | 2 +- .../LangExpressionClientYamlTestSuiteIT.java | 2 +- .../LangGroovyClientYamlTestSuiteIT.java | 2 +- .../LangMustacheClientYamlTestSuiteIT.java | 2 +- .../LangPainlessClientYamlTestSuiteIT.java | 2 +- .../PercolatorClientYamlTestSuiteIT.java | 2 +- .../reindex/ReindexClientYamlTestSuiteIT.java | 2 +- .../netty3/Netty3ClientYamlTestSuiteIT.java | 2 +- .../netty4/Netty4ClientYamlTestSuiteIT.java | 2 +- .../analysis/IcuClientYamlTestSuiteIT.java | 2 +- .../KuromojiClientYamlTestSuiteIT.java | 2 +- .../PhoneticClientYamlTestSuiteIT.java | 2 +- .../SmartCNClientYamlTestSuiteIT.java | 2 +- .../StempelClientYamlTestSuiteIT.java | 2 +- .../UkrainianClientYamlTestSuiteIT.java | 2 +- ...veryAzureClassicClientYamlTestSuiteIT.java | 2 +- .../aws/CloudAwsClientYamlTestSuiteIT.java | 2 +- ...leBasedDiscoveryClientYamlTestSuiteIT.java | 2 +- .../DiscoveryGceClientYamlTestSuiteIT.java | 2 +- ...IngestAttachmentClientYamlTestSuiteIT.java | 2 +- .../IngestGeoIpClientYamlTestSuiteIT.java | 2 +- .../IngestUserAgentClientYamlTestSuiteIT.java | 2 +- .../JvmExampleClientYamlTestSuiteIT.java | 2 +- .../LangJavascriptClientYamlTestSuiteIT.java | 2 +- .../LangPythonClientYamlTestSuiteIT.java | 2 +- .../MapperMurmur3ClientYamlTestSuiteIT.java | 2 +- .../size/MapperSizeClientYamlTestSuiteIT.java | 2 +- .../RepositoryAzureClientYamlTestSuiteIT.java | 2 +- .../RepositoryGcsClientYamlTestSuiteIT.java | 2 +- .../RepositoryHdfsClientYamlTestSuiteIT.java | 2 +- .../s3/RepositoryS3ClientYamlTestSuiteIT.java | 2 +- .../store/StoreSmbClientYamlTestSuiteIT.java | 2 +- .../Backwards50ClientYamlTestSuiteIT.java | 2 +- .../UpgradeClusterClientYamlTestSuiteIT.java | 2 +- ...stIngestDisabledClientYamlTestSuiteIT.java | 2 +- ...ngestWithAllDepsClientYamlTestSuiteIT.java | 2 +- ...okeTestMultiNodeClientYamlTestSuiteIT.java | 2 +- ...SmokeTestPluginsClientYamlTestSuiteIT.java | 2 +- ...ndexWithPainlessClientYamlTestSuiteIT.java | 2 +- .../rest/yaml/ESClientYamlSuiteTestCase.java | 20 ++++++------------- 47 files changed, 52 insertions(+), 60 deletions(-) diff --git a/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java b/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java index a94f0faf2d2..a63b304a1d4 100644 --- a/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java +++ b/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class DebClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java b/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java index ca54a3becd9..c81ff7439f9 100644 --- a/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java +++ b/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class IntegTestZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java b/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java index a5b7f46269f..9569dfe4d10 100644 --- a/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java +++ b/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class RpmClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java b/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java index 73d323f7d50..0c811c383d0 100644 --- a/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java +++ b/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class TarClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java b/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java index 329c8259d0b..52581c8e765 100644 --- a/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java +++ b/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class ZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java index 688eefc98d5..87ca5acf1ca 100644 --- a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java +++ b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java @@ -37,7 +37,7 @@ public class DocsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } @Override diff --git a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java index 6fb70ad3d63..11ddd2dfd41 100644 --- a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java +++ b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java @@ -34,6 +34,6 @@ public class MatrixStatsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java index 3c71f5710fd..1b678835c4b 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class IngestCommonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java b/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java index 3d1071ee17c..9a30def83e1 100644 --- a/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java +++ b/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class LangExpressionClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java b/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java index c8e9c74827a..f407b5b6ce7 100644 --- a/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java +++ b/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class LangGroovyClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java index 160327dbab6..377fa870c41 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class LangMustacheClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java index ca95dafd0b8..55d3f1c8101 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java @@ -37,7 +37,7 @@ public class LangPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java index 24e92715ede..db1bbf13c83 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class PercolatorClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java index 186bb2f0a5e..54483eae569 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class ReindexClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java index 9ed1df1cfed..04de8e8eebe 100644 --- a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java +++ b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java @@ -39,7 +39,7 @@ public class Netty3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java index 8f7483e2791..237227cd4df 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java @@ -40,7 +40,7 @@ public class Netty4ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java b/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java index 47224836037..ce2e660ecfc 100644 --- a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java +++ b/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class IcuClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java index e99c5c2bacf..0797b10d774 100644 --- a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java +++ b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class KuromojiClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java index 975b84f1574..447eb1d6cd7 100644 --- a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java +++ b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class PhoneticClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java b/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java index 6415dc436eb..534af79a199 100644 --- a/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java +++ b/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class SmartCNClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java index 34d264122ef..56edcdb692c 100644 --- a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java +++ b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class StempelClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java b/plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java index 590d3614b97..dd77fdf74a5 100644 --- a/plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java +++ b/plugins/analysis-ukrainian/src/test/java/org/elasticsearch/index/analysis/UkrainianClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class UkrainianClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java index 30276c16c89..33c5d41f70c 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class DiscoveryAzureClassicClientYamlTestSuiteIT extends ESClientYamlSuit @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java index f5f49c14833..3cd30c187d4 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class CloudAwsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-file/src/test/java/org/elasticsearch/discovery/file/FileBasedDiscoveryClientYamlTestSuiteIT.java b/plugins/discovery-file/src/test/java/org/elasticsearch/discovery/file/FileBasedDiscoveryClientYamlTestSuiteIT.java index 45905a152ce..8a0bd808dba 100644 --- a/plugins/discovery-file/src/test/java/org/elasticsearch/discovery/file/FileBasedDiscoveryClientYamlTestSuiteIT.java +++ b/plugins/discovery-file/src/test/java/org/elasticsearch/discovery/file/FileBasedDiscoveryClientYamlTestSuiteIT.java @@ -38,6 +38,6 @@ public class FileBasedDiscoveryClientYamlTestSuiteIT extends ESClientYamlSuiteTe @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java index 8ce17ff9fa5..3af39b6da5d 100644 --- a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java +++ b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class DiscoveryGceClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java index d720a4abf28..40e95451e49 100644 --- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java +++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class IngestAttachmentClientYamlTestSuiteIT extends ESClientYamlSuiteTest @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java b/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java index 26838b600da..ed381dab0b6 100644 --- a/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java +++ b/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class IngestGeoIpClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java b/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java index b0aa115a1a2..2acac873637 100644 --- a/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java +++ b/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java @@ -36,6 +36,6 @@ public class IngestUserAgentClientYamlTestSuiteIT extends ESClientYamlSuiteTestC @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java b/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java index 0ef413d9595..b7bae90817b 100644 --- a/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java +++ b/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class JvmExampleClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java index e89372c8b36..300b2325863 100644 --- a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java +++ b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class LangJavascriptClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java index 618ea6b20e5..a0b4452ba44 100644 --- a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java +++ b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class LangPythonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java index 204f6c07a99..3e9a5f13927 100644 --- a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java +++ b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class MapperMurmur3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCas @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java index 44f26c4ec51..d8de3635b77 100644 --- a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java +++ b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class MapperSizeClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java index c7eeff27401..2919d073978 100644 --- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java +++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class RepositoryAzureClientYamlTestSuiteIT extends ESClientYamlSuiteTestC @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java index 52145bf87e2..6ed036e277f 100644 --- a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java +++ b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class RepositoryGcsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCas @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java index 1dfbb3c51b7..264a350d514 100644 --- a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java +++ b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class RepositoryHdfsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java index 04c4f6fc0f1..9c567a570fe 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class RepositoryS3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java b/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java index 72394b79693..0b9de745cac 100644 --- a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java +++ b/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class StoreSmbClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java index e3ab68b3477..af77b216bc4 100644 --- a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java +++ b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java @@ -37,7 +37,7 @@ public class Backwards50ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java index 496a02e42dc..f58d618adf3 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java @@ -42,7 +42,7 @@ public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return createParameters(0, 1); + return createParameters(); } } diff --git a/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java b/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java index c8d506424c0..beb7499bf7f 100644 --- a/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java +++ b/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class SmokeTestIngestDisabledClientYamlTestSuiteIT extends ESClientYamlSu @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java b/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java index b3b84dfc55e..0bd7b9ac029 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class SmokeTestIngestWithAllDepsClientYamlTestSuiteIT extends ESClientYam @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java b/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java index 456387e6c19..1fe8cfeb9d5 100644 --- a/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java +++ b/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTe @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java b/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java index 05021f3c2bb..0f5636095e9 100644 --- a/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java +++ b/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java @@ -36,7 +36,7 @@ public class SmokeTestPluginsClientYamlTestSuiteIT extends ESClientYamlSuiteTest @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java b/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java index db01ce2dfe9..fb4f27210d8 100644 --- a/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java +++ b/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java @@ -35,6 +35,6 @@ public class SmokeTestReindexWithPainlessClientYamlTestSuiteIT extends ESClientY @ParametersFactory public static Iterable parameters() throws IOException, ClientYamlTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); + return ESClientYamlSuiteTestCase.createParameters(); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index f44558d7567..cb46c278c2b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -117,9 +117,9 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { super.afterIfFailed(errors); } - public static Iterable createParameters(int id, int count) throws IOException, ClientYamlTestParseException { + public static Iterable createParameters() throws IOException, ClientYamlTestParseException { //parse tests only if rest test group is enabled, otherwise rest tests might not even be available on file system - List restTestCandidates = collectTestCandidates(id, count); + List restTestCandidates = collectTestCandidates(); List objects = new ArrayList<>(); for (ClientYamlTestCandidate restTestCandidate : restTestCandidates) { objects.add(new Object[]{restTestCandidate}); @@ -127,7 +127,7 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { return objects; } - private static List collectTestCandidates(int id, int count) throws ClientYamlTestParseException, IOException { + private static List collectTestCandidates() throws ClientYamlTestParseException, IOException { List testCandidates = new ArrayList<>(); FileSystem fileSystem = getFileSystem(); // don't make a try-with, getFileSystem returns null @@ -140,12 +140,9 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { for (String api : yamlSuites.keySet()) { List yamlFiles = new ArrayList<>(yamlSuites.get(api)); for (Path yamlFile : yamlFiles) { - String key = api + yamlFile.getFileName().toString(); - if (mustExecute(key, id, count)) { - ClientYamlTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile); - for (ClientYamlTestSection testSection : restTestSuite.getTestSections()) { - testCandidates.add(new ClientYamlTestCandidate(restTestSuite, testSection)); - } + ClientYamlTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile); + for (ClientYamlTestSection testSection : restTestSuite.getTestSections()) { + testCandidates.add(new ClientYamlTestCandidate(restTestSuite, testSection)); } } } @@ -164,11 +161,6 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { return testCandidates; } - private static boolean mustExecute(String test, int id, int count) { - int hash = (int) (Math.abs((long)test.hashCode()) % count); - return hash == id; - } - private static String[] resolvePathsProperty(String propertyName, String defaultValue) { String property = System.getProperty(propertyName); if (!Strings.hasLength(property)) { From 562a30d3c661f3b91c4cbb0f4bc9db7677e69627 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 7 Nov 2016 15:29:35 -0800 Subject: [PATCH 20/22] Move licenses for core jar to core directory (#21383) All plugins currently have their own licenses dir for the dependencyLicenses task, but core disables this and has the check inside distribution. This may have been better for maven, but for gradle it makes more sense to just use the dependencyLicenses task that automatically exists inside :core, and remove the hacked up version that is inside distribution. --- core/build.gradle | 6 ++++-- .../licenses/HdrHistogram-2.1.6.jar.sha1 | 0 .../licenses/HdrHistogram-LICENSE.txt | 0 .../licenses/HdrHistogram-NOTICE.txt | 0 .../licenses/apache-log4j-extras-DEPENDENCIES | 0 .../licenses/hppc-0.7.1.jar.sha1 | 0 .../licenses/hppc-LICENSE.txt | 0 .../licenses/hppc-NOTICE.txt | 0 .../licenses/jackson-LICENSE | 0 .../licenses/jackson-NOTICE | 0 .../licenses/jackson-core-2.8.1.jar.sha1 | 0 .../jackson-dataformat-cbor-2.8.1.jar.sha1 | 0 .../jackson-dataformat-smile-2.8.1.jar.sha1 | 0 .../jackson-dataformat-yaml-2.8.1.jar.sha1 | 0 .../licenses/jna-4.2.2.jar.sha1 | 0 .../licenses/jna-LICENSE.txt | 0 .../licenses/jna-NOTICE.txt | 0 .../licenses/joda-convert-1.2.jar.sha1 | 0 .../licenses/joda-convert-LICENSE.txt | 0 .../licenses/joda-convert-NOTICE.txt | 0 .../licenses/joda-time-2.9.4.jar.sha1 | 0 .../licenses/joda-time-LICENSE.txt | 0 .../licenses/joda-time-NOTICE.txt | 0 .../licenses/jopt-simple-5.0.2.jar.sha1 | 0 .../licenses/jopt-simple-LICENSE.txt | 0 .../licenses/jopt-simple-NOTICE.txt | 0 .../licenses/jts-1.13.jar.sha1 | 0 .../licenses/jts-LICENSE.txt | 0 .../licenses/jts-NOTICE.txt | 0 .../licenses/log4j-1.2-api-2.7.jar.sha1 | 0 .../licenses/log4j-LICENSE.txt | 0 .../licenses/log4j-NOTICE.txt | 0 .../licenses/log4j-api-2.7.jar.sha1 | 0 .../licenses/log4j-api-LICENSE.txt | 0 .../licenses/log4j-api-NOTICE.txt | 0 .../licenses/log4j-core-2.7.jar.sha1 | 0 .../licenses/log4j-core-LICENSE.txt | 0 .../licenses/log4j-core-NOTICE.txt | 0 .../licenses/lucene-LICENSE.txt | 0 .../licenses/lucene-NOTICE.txt | 0 ...ers-common-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ard-codecs-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ucene-core-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...e-grouping-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ighlighter-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ucene-join-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ene-memory-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ucene-misc-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ne-queries-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ueryparser-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ne-sandbox-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ne-spatial-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ial-extras-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 | 0 ...ne-suggest-6.3.0-snapshot-a66a445.jar.sha1 | 0 .../licenses/securesm-1.1.jar.sha1 | 0 .../licenses/securesm-LICENSE.txt | 0 .../licenses/securesm-NOTICE.txt | 0 .../licenses/snakeyaml-1.15.jar.sha1 | 0 .../licenses/snakeyaml-LICENSE.txt | 0 .../licenses/snakeyaml-NOTICE.txt | 0 .../licenses/spatial4j-0.6.jar.sha1 | 0 .../licenses/spatial4j-ABOUT.txt | 0 .../licenses/spatial4j-LICENSE.txt | 0 .../licenses/spatial4j-NOTICE.txt | 0 .../licenses/t-digest-3.0.jar.sha1 | 0 .../licenses/t-digest-LICENSE.txt | 0 .../licenses/t-digest-NOTICE.txt | 0 distribution/build.gradle | 19 +------------------ distribution/rpm/build.gradle | 2 +- 70 files changed, 6 insertions(+), 21 deletions(-) rename {distribution => core}/licenses/HdrHistogram-2.1.6.jar.sha1 (100%) rename {distribution => core}/licenses/HdrHistogram-LICENSE.txt (100%) rename {distribution => core}/licenses/HdrHistogram-NOTICE.txt (100%) rename {distribution => core}/licenses/apache-log4j-extras-DEPENDENCIES (100%) rename {distribution => core}/licenses/hppc-0.7.1.jar.sha1 (100%) rename {distribution => core}/licenses/hppc-LICENSE.txt (100%) rename {distribution => core}/licenses/hppc-NOTICE.txt (100%) rename {distribution => core}/licenses/jackson-LICENSE (100%) rename {distribution => core}/licenses/jackson-NOTICE (100%) rename {distribution => core}/licenses/jackson-core-2.8.1.jar.sha1 (100%) rename {distribution => core}/licenses/jackson-dataformat-cbor-2.8.1.jar.sha1 (100%) rename {distribution => core}/licenses/jackson-dataformat-smile-2.8.1.jar.sha1 (100%) rename {distribution => core}/licenses/jackson-dataformat-yaml-2.8.1.jar.sha1 (100%) rename {distribution => core}/licenses/jna-4.2.2.jar.sha1 (100%) rename {distribution => core}/licenses/jna-LICENSE.txt (100%) rename {distribution => core}/licenses/jna-NOTICE.txt (100%) rename {distribution => core}/licenses/joda-convert-1.2.jar.sha1 (100%) rename {distribution => core}/licenses/joda-convert-LICENSE.txt (100%) rename {distribution => core}/licenses/joda-convert-NOTICE.txt (100%) rename {distribution => core}/licenses/joda-time-2.9.4.jar.sha1 (100%) rename {distribution => core}/licenses/joda-time-LICENSE.txt (100%) rename {distribution => core}/licenses/joda-time-NOTICE.txt (100%) rename {distribution => core}/licenses/jopt-simple-5.0.2.jar.sha1 (100%) rename {distribution => core}/licenses/jopt-simple-LICENSE.txt (100%) rename {distribution => core}/licenses/jopt-simple-NOTICE.txt (100%) rename {distribution => core}/licenses/jts-1.13.jar.sha1 (100%) rename {distribution => core}/licenses/jts-LICENSE.txt (100%) rename {distribution => core}/licenses/jts-NOTICE.txt (100%) rename {distribution => core}/licenses/log4j-1.2-api-2.7.jar.sha1 (100%) rename {distribution => core}/licenses/log4j-LICENSE.txt (100%) rename {distribution => core}/licenses/log4j-NOTICE.txt (100%) rename {distribution => core}/licenses/log4j-api-2.7.jar.sha1 (100%) rename {distribution => core}/licenses/log4j-api-LICENSE.txt (100%) rename {distribution => core}/licenses/log4j-api-NOTICE.txt (100%) rename {distribution => core}/licenses/log4j-core-2.7.jar.sha1 (100%) rename {distribution => core}/licenses/log4j-core-LICENSE.txt (100%) rename {distribution => core}/licenses/log4j-core-NOTICE.txt (100%) rename {distribution => core}/licenses/lucene-LICENSE.txt (100%) rename {distribution => core}/licenses/lucene-NOTICE.txt (100%) rename {distribution => core}/licenses/lucene-analyzers-common-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-backward-codecs-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-core-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-grouping-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-highlighter-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-join-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-memory-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-misc-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-queries-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-queryparser-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-sandbox-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-spatial-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-spatial-extras-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/lucene-suggest-6.3.0-snapshot-a66a445.jar.sha1 (100%) rename {distribution => core}/licenses/securesm-1.1.jar.sha1 (100%) rename {distribution => core}/licenses/securesm-LICENSE.txt (100%) rename {distribution => core}/licenses/securesm-NOTICE.txt (100%) rename {distribution => core}/licenses/snakeyaml-1.15.jar.sha1 (100%) rename {distribution => core}/licenses/snakeyaml-LICENSE.txt (100%) rename {distribution => core}/licenses/snakeyaml-NOTICE.txt (100%) rename {distribution => core}/licenses/spatial4j-0.6.jar.sha1 (100%) rename {distribution => core}/licenses/spatial4j-ABOUT.txt (100%) rename {distribution => core}/licenses/spatial4j-LICENSE.txt (100%) rename {distribution => core}/licenses/spatial4j-NOTICE.txt (100%) rename {distribution => core}/licenses/t-digest-3.0.jar.sha1 (100%) rename {distribution => core}/licenses/t-digest-LICENSE.txt (100%) rename {distribution => core}/licenses/t-digest-NOTICE.txt (100%) diff --git a/core/build.gradle b/core/build.gradle index 4f7bec337a7..0726666e0cf 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -257,8 +257,10 @@ thirdPartyAudit.excludes = [ 'org.noggit.JSONParser', ] -// dependency license are currently checked in distribution -dependencyLicenses.enabled = false +dependencyLicenses { + mapping from: /lucene-.*/, to: 'lucene' + mapping from: /jackson-.*/, to: 'jackson' +} if (isEclipse == false || project.path == ":core-tests") { task integTest(type: RandomizedTestingTask, diff --git a/distribution/licenses/HdrHistogram-2.1.6.jar.sha1 b/core/licenses/HdrHistogram-2.1.6.jar.sha1 similarity index 100% rename from distribution/licenses/HdrHistogram-2.1.6.jar.sha1 rename to core/licenses/HdrHistogram-2.1.6.jar.sha1 diff --git a/distribution/licenses/HdrHistogram-LICENSE.txt b/core/licenses/HdrHistogram-LICENSE.txt similarity index 100% rename from distribution/licenses/HdrHistogram-LICENSE.txt rename to core/licenses/HdrHistogram-LICENSE.txt diff --git a/distribution/licenses/HdrHistogram-NOTICE.txt b/core/licenses/HdrHistogram-NOTICE.txt similarity index 100% rename from distribution/licenses/HdrHistogram-NOTICE.txt rename to core/licenses/HdrHistogram-NOTICE.txt diff --git a/distribution/licenses/apache-log4j-extras-DEPENDENCIES b/core/licenses/apache-log4j-extras-DEPENDENCIES similarity index 100% rename from distribution/licenses/apache-log4j-extras-DEPENDENCIES rename to core/licenses/apache-log4j-extras-DEPENDENCIES diff --git a/distribution/licenses/hppc-0.7.1.jar.sha1 b/core/licenses/hppc-0.7.1.jar.sha1 similarity index 100% rename from distribution/licenses/hppc-0.7.1.jar.sha1 rename to core/licenses/hppc-0.7.1.jar.sha1 diff --git a/distribution/licenses/hppc-LICENSE.txt b/core/licenses/hppc-LICENSE.txt similarity index 100% rename from distribution/licenses/hppc-LICENSE.txt rename to core/licenses/hppc-LICENSE.txt diff --git a/distribution/licenses/hppc-NOTICE.txt b/core/licenses/hppc-NOTICE.txt similarity index 100% rename from distribution/licenses/hppc-NOTICE.txt rename to core/licenses/hppc-NOTICE.txt diff --git a/distribution/licenses/jackson-LICENSE b/core/licenses/jackson-LICENSE similarity index 100% rename from distribution/licenses/jackson-LICENSE rename to core/licenses/jackson-LICENSE diff --git a/distribution/licenses/jackson-NOTICE b/core/licenses/jackson-NOTICE similarity index 100% rename from distribution/licenses/jackson-NOTICE rename to core/licenses/jackson-NOTICE diff --git a/distribution/licenses/jackson-core-2.8.1.jar.sha1 b/core/licenses/jackson-core-2.8.1.jar.sha1 similarity index 100% rename from distribution/licenses/jackson-core-2.8.1.jar.sha1 rename to core/licenses/jackson-core-2.8.1.jar.sha1 diff --git a/distribution/licenses/jackson-dataformat-cbor-2.8.1.jar.sha1 b/core/licenses/jackson-dataformat-cbor-2.8.1.jar.sha1 similarity index 100% rename from distribution/licenses/jackson-dataformat-cbor-2.8.1.jar.sha1 rename to core/licenses/jackson-dataformat-cbor-2.8.1.jar.sha1 diff --git a/distribution/licenses/jackson-dataformat-smile-2.8.1.jar.sha1 b/core/licenses/jackson-dataformat-smile-2.8.1.jar.sha1 similarity index 100% rename from distribution/licenses/jackson-dataformat-smile-2.8.1.jar.sha1 rename to core/licenses/jackson-dataformat-smile-2.8.1.jar.sha1 diff --git a/distribution/licenses/jackson-dataformat-yaml-2.8.1.jar.sha1 b/core/licenses/jackson-dataformat-yaml-2.8.1.jar.sha1 similarity index 100% rename from distribution/licenses/jackson-dataformat-yaml-2.8.1.jar.sha1 rename to core/licenses/jackson-dataformat-yaml-2.8.1.jar.sha1 diff --git a/distribution/licenses/jna-4.2.2.jar.sha1 b/core/licenses/jna-4.2.2.jar.sha1 similarity index 100% rename from distribution/licenses/jna-4.2.2.jar.sha1 rename to core/licenses/jna-4.2.2.jar.sha1 diff --git a/distribution/licenses/jna-LICENSE.txt b/core/licenses/jna-LICENSE.txt similarity index 100% rename from distribution/licenses/jna-LICENSE.txt rename to core/licenses/jna-LICENSE.txt diff --git a/distribution/licenses/jna-NOTICE.txt b/core/licenses/jna-NOTICE.txt similarity index 100% rename from distribution/licenses/jna-NOTICE.txt rename to core/licenses/jna-NOTICE.txt diff --git a/distribution/licenses/joda-convert-1.2.jar.sha1 b/core/licenses/joda-convert-1.2.jar.sha1 similarity index 100% rename from distribution/licenses/joda-convert-1.2.jar.sha1 rename to core/licenses/joda-convert-1.2.jar.sha1 diff --git a/distribution/licenses/joda-convert-LICENSE.txt b/core/licenses/joda-convert-LICENSE.txt similarity index 100% rename from distribution/licenses/joda-convert-LICENSE.txt rename to core/licenses/joda-convert-LICENSE.txt diff --git a/distribution/licenses/joda-convert-NOTICE.txt b/core/licenses/joda-convert-NOTICE.txt similarity index 100% rename from distribution/licenses/joda-convert-NOTICE.txt rename to core/licenses/joda-convert-NOTICE.txt diff --git a/distribution/licenses/joda-time-2.9.4.jar.sha1 b/core/licenses/joda-time-2.9.4.jar.sha1 similarity index 100% rename from distribution/licenses/joda-time-2.9.4.jar.sha1 rename to core/licenses/joda-time-2.9.4.jar.sha1 diff --git a/distribution/licenses/joda-time-LICENSE.txt b/core/licenses/joda-time-LICENSE.txt similarity index 100% rename from distribution/licenses/joda-time-LICENSE.txt rename to core/licenses/joda-time-LICENSE.txt diff --git a/distribution/licenses/joda-time-NOTICE.txt b/core/licenses/joda-time-NOTICE.txt similarity index 100% rename from distribution/licenses/joda-time-NOTICE.txt rename to core/licenses/joda-time-NOTICE.txt diff --git a/distribution/licenses/jopt-simple-5.0.2.jar.sha1 b/core/licenses/jopt-simple-5.0.2.jar.sha1 similarity index 100% rename from distribution/licenses/jopt-simple-5.0.2.jar.sha1 rename to core/licenses/jopt-simple-5.0.2.jar.sha1 diff --git a/distribution/licenses/jopt-simple-LICENSE.txt b/core/licenses/jopt-simple-LICENSE.txt similarity index 100% rename from distribution/licenses/jopt-simple-LICENSE.txt rename to core/licenses/jopt-simple-LICENSE.txt diff --git a/distribution/licenses/jopt-simple-NOTICE.txt b/core/licenses/jopt-simple-NOTICE.txt similarity index 100% rename from distribution/licenses/jopt-simple-NOTICE.txt rename to core/licenses/jopt-simple-NOTICE.txt diff --git a/distribution/licenses/jts-1.13.jar.sha1 b/core/licenses/jts-1.13.jar.sha1 similarity index 100% rename from distribution/licenses/jts-1.13.jar.sha1 rename to core/licenses/jts-1.13.jar.sha1 diff --git a/distribution/licenses/jts-LICENSE.txt b/core/licenses/jts-LICENSE.txt similarity index 100% rename from distribution/licenses/jts-LICENSE.txt rename to core/licenses/jts-LICENSE.txt diff --git a/distribution/licenses/jts-NOTICE.txt b/core/licenses/jts-NOTICE.txt similarity index 100% rename from distribution/licenses/jts-NOTICE.txt rename to core/licenses/jts-NOTICE.txt diff --git a/distribution/licenses/log4j-1.2-api-2.7.jar.sha1 b/core/licenses/log4j-1.2-api-2.7.jar.sha1 similarity index 100% rename from distribution/licenses/log4j-1.2-api-2.7.jar.sha1 rename to core/licenses/log4j-1.2-api-2.7.jar.sha1 diff --git a/distribution/licenses/log4j-LICENSE.txt b/core/licenses/log4j-LICENSE.txt similarity index 100% rename from distribution/licenses/log4j-LICENSE.txt rename to core/licenses/log4j-LICENSE.txt diff --git a/distribution/licenses/log4j-NOTICE.txt b/core/licenses/log4j-NOTICE.txt similarity index 100% rename from distribution/licenses/log4j-NOTICE.txt rename to core/licenses/log4j-NOTICE.txt diff --git a/distribution/licenses/log4j-api-2.7.jar.sha1 b/core/licenses/log4j-api-2.7.jar.sha1 similarity index 100% rename from distribution/licenses/log4j-api-2.7.jar.sha1 rename to core/licenses/log4j-api-2.7.jar.sha1 diff --git a/distribution/licenses/log4j-api-LICENSE.txt b/core/licenses/log4j-api-LICENSE.txt similarity index 100% rename from distribution/licenses/log4j-api-LICENSE.txt rename to core/licenses/log4j-api-LICENSE.txt diff --git a/distribution/licenses/log4j-api-NOTICE.txt b/core/licenses/log4j-api-NOTICE.txt similarity index 100% rename from distribution/licenses/log4j-api-NOTICE.txt rename to core/licenses/log4j-api-NOTICE.txt diff --git a/distribution/licenses/log4j-core-2.7.jar.sha1 b/core/licenses/log4j-core-2.7.jar.sha1 similarity index 100% rename from distribution/licenses/log4j-core-2.7.jar.sha1 rename to core/licenses/log4j-core-2.7.jar.sha1 diff --git a/distribution/licenses/log4j-core-LICENSE.txt b/core/licenses/log4j-core-LICENSE.txt similarity index 100% rename from distribution/licenses/log4j-core-LICENSE.txt rename to core/licenses/log4j-core-LICENSE.txt diff --git a/distribution/licenses/log4j-core-NOTICE.txt b/core/licenses/log4j-core-NOTICE.txt similarity index 100% rename from distribution/licenses/log4j-core-NOTICE.txt rename to core/licenses/log4j-core-NOTICE.txt diff --git a/distribution/licenses/lucene-LICENSE.txt b/core/licenses/lucene-LICENSE.txt similarity index 100% rename from distribution/licenses/lucene-LICENSE.txt rename to core/licenses/lucene-LICENSE.txt diff --git a/distribution/licenses/lucene-NOTICE.txt b/core/licenses/lucene-NOTICE.txt similarity index 100% rename from distribution/licenses/lucene-NOTICE.txt rename to core/licenses/lucene-NOTICE.txt diff --git a/distribution/licenses/lucene-analyzers-common-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-analyzers-common-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-analyzers-common-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-analyzers-common-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-backward-codecs-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-backward-codecs-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-backward-codecs-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-backward-codecs-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-core-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-core-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-core-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-core-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-grouping-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-grouping-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-grouping-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-grouping-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-highlighter-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-highlighter-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-highlighter-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-highlighter-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-join-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-join-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-join-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-join-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-memory-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-memory-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-memory-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-memory-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-misc-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-misc-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-misc-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-misc-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-queries-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-queries-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-queries-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-queries-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-queryparser-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-queryparser-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-queryparser-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-queryparser-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-sandbox-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-sandbox-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-sandbox-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-sandbox-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-spatial-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-spatial-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-spatial-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-spatial-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-spatial-extras-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-spatial-extras-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-spatial-extras-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-spatial-extras-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-spatial3d-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/lucene-suggest-6.3.0-snapshot-a66a445.jar.sha1 b/core/licenses/lucene-suggest-6.3.0-snapshot-a66a445.jar.sha1 similarity index 100% rename from distribution/licenses/lucene-suggest-6.3.0-snapshot-a66a445.jar.sha1 rename to core/licenses/lucene-suggest-6.3.0-snapshot-a66a445.jar.sha1 diff --git a/distribution/licenses/securesm-1.1.jar.sha1 b/core/licenses/securesm-1.1.jar.sha1 similarity index 100% rename from distribution/licenses/securesm-1.1.jar.sha1 rename to core/licenses/securesm-1.1.jar.sha1 diff --git a/distribution/licenses/securesm-LICENSE.txt b/core/licenses/securesm-LICENSE.txt similarity index 100% rename from distribution/licenses/securesm-LICENSE.txt rename to core/licenses/securesm-LICENSE.txt diff --git a/distribution/licenses/securesm-NOTICE.txt b/core/licenses/securesm-NOTICE.txt similarity index 100% rename from distribution/licenses/securesm-NOTICE.txt rename to core/licenses/securesm-NOTICE.txt diff --git a/distribution/licenses/snakeyaml-1.15.jar.sha1 b/core/licenses/snakeyaml-1.15.jar.sha1 similarity index 100% rename from distribution/licenses/snakeyaml-1.15.jar.sha1 rename to core/licenses/snakeyaml-1.15.jar.sha1 diff --git a/distribution/licenses/snakeyaml-LICENSE.txt b/core/licenses/snakeyaml-LICENSE.txt similarity index 100% rename from distribution/licenses/snakeyaml-LICENSE.txt rename to core/licenses/snakeyaml-LICENSE.txt diff --git a/distribution/licenses/snakeyaml-NOTICE.txt b/core/licenses/snakeyaml-NOTICE.txt similarity index 100% rename from distribution/licenses/snakeyaml-NOTICE.txt rename to core/licenses/snakeyaml-NOTICE.txt diff --git a/distribution/licenses/spatial4j-0.6.jar.sha1 b/core/licenses/spatial4j-0.6.jar.sha1 similarity index 100% rename from distribution/licenses/spatial4j-0.6.jar.sha1 rename to core/licenses/spatial4j-0.6.jar.sha1 diff --git a/distribution/licenses/spatial4j-ABOUT.txt b/core/licenses/spatial4j-ABOUT.txt similarity index 100% rename from distribution/licenses/spatial4j-ABOUT.txt rename to core/licenses/spatial4j-ABOUT.txt diff --git a/distribution/licenses/spatial4j-LICENSE.txt b/core/licenses/spatial4j-LICENSE.txt similarity index 100% rename from distribution/licenses/spatial4j-LICENSE.txt rename to core/licenses/spatial4j-LICENSE.txt diff --git a/distribution/licenses/spatial4j-NOTICE.txt b/core/licenses/spatial4j-NOTICE.txt similarity index 100% rename from distribution/licenses/spatial4j-NOTICE.txt rename to core/licenses/spatial4j-NOTICE.txt diff --git a/distribution/licenses/t-digest-3.0.jar.sha1 b/core/licenses/t-digest-3.0.jar.sha1 similarity index 100% rename from distribution/licenses/t-digest-3.0.jar.sha1 rename to core/licenses/t-digest-3.0.jar.sha1 diff --git a/distribution/licenses/t-digest-LICENSE.txt b/core/licenses/t-digest-LICENSE.txt similarity index 100% rename from distribution/licenses/t-digest-LICENSE.txt rename to core/licenses/t-digest-LICENSE.txt diff --git a/distribution/licenses/t-digest-NOTICE.txt b/core/licenses/t-digest-NOTICE.txt similarity index 100% rename from distribution/licenses/t-digest-NOTICE.txt rename to core/licenses/t-digest-NOTICE.txt diff --git a/distribution/build.gradle b/distribution/build.gradle index cc4912888da..2cfd7ebbbce 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -39,10 +39,6 @@ buildscript { } } -// this is common configuration for distributions, but we also add it here for the license check to use -ext.dependencyFiles = project(':core').configurations.runtime.copyRecursive() - - /***************************************************************************** * Modules * *****************************************************************************/ @@ -146,7 +142,7 @@ subprojects { libFiles = copySpec { into 'lib' from project(':core').jar - from project(':distribution').dependencyFiles + from project(':core').configurations.runtime } modulesFiles = copySpec { @@ -438,19 +434,6 @@ configure(subprojects.findAll { ['deb', 'rpm'].contains(it.name) }) { } } -// TODO: dependency checks should really be when building the jar itself, which would remove the need -// for this hackery and instead we can do this inside the BuildPlugin -task dependencyLicenses(type: DependencyLicensesTask) { - dependsOn = [dependencyFiles] - dependencies = dependencyFiles - mapping from: /lucene-.*/, to: 'lucene' - mapping from: /jackson-.*/, to: 'jackson' -} -task check(group: 'Verification', description: 'Runs all checks.', dependsOn: dependencyLicenses) {} // dummy task! -task updateShas(type: UpdateShasTask) { - parentTask = dependencyLicenses -} - task run(type: RunTask) { distribution = 'zip' } diff --git a/distribution/rpm/build.gradle b/distribution/rpm/build.gradle index a0dc33b9ad4..6f8299522ca 100644 --- a/distribution/rpm/build.gradle +++ b/distribution/rpm/build.gradle @@ -18,7 +18,7 @@ */ task buildRpm(type: Rpm) { - dependsOn dependencyFiles, preparePackagingFiles + dependsOn preparePackagingFiles baseName 'elasticsearch' // this is what pom generation uses for artifactId // Follow elasticsearch's rpm file naming convention archiveName "${packageName}-${project.version}.rpm" From 6b4280c7be2e3c0aa4da6ef6ce1693ee591f2e11 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 7 Nov 2016 17:04:41 -0800 Subject: [PATCH 21/22] Better fix for java8 restriction of g1gc check This makes the fix actually testable. --- .../elasticsearch/bootstrap/BootstrapCheck.java | 7 ++++++- .../bootstrap/BootstrapCheckTests.java | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java index 0676eff5b12..308f02015b3 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java @@ -559,7 +559,7 @@ final class BootstrapCheck { @Override public boolean check() { - if ("Oracle Corporation".equals(jvmVendor()) && Constants.JRE_IS_MINIMUM_JAVA9 == false && isG1GCEnabled()) { + if ("Oracle Corporation".equals(jvmVendor()) && isJava8() && isG1GCEnabled()) { final String jvmVersion = jvmVersion(); final Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)-b\\d+"); final Matcher matcher = pattern.matcher(jvmVersion); @@ -590,6 +590,11 @@ final class BootstrapCheck { return Constants.JVM_VERSION; } + // visible for tests + boolean isJava8() { + return Constants.JVM_SPEC_VERSION.equals("1.8"); + } + @Override public String errorMessage() { return String.format( diff --git a/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java b/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java index 6566ed607d0..b60e6f01268 100644 --- a/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java +++ b/core/src/test/java/org/elasticsearch/bootstrap/BootstrapCheckTests.java @@ -534,6 +534,7 @@ public class BootstrapCheckTests extends ESTestCase { public void testG1GCCheck() throws NodeValidationException { final AtomicBoolean isG1GCEnabled = new AtomicBoolean(true); + final AtomicBoolean isJava8 = new AtomicBoolean(true); final AtomicReference jvmVersion = new AtomicReference<>(String.format(Locale.ROOT, "25.%d-b%d", randomIntBetween(0, 39), randomIntBetween(1, 128))); final BootstrapCheck.G1GCCheck oracleCheck = new BootstrapCheck.G1GCCheck() { @@ -553,6 +554,11 @@ public class BootstrapCheckTests extends ESTestCase { return jvmVersion.get(); } + @Override + boolean isJava8() { + return isJava8.get(); + } + }; final NodeValidationException e = @@ -584,6 +590,15 @@ public class BootstrapCheckTests extends ESTestCase { // if not on an Oracle JVM, nothing should happen BootstrapCheck.check(true, Collections.singletonList(nonOracleCheck), "testG1GCCheck"); + + final BootstrapCheck.G1GCCheck nonJava8Check = new BootstrapCheck.G1GCCheck() { + @Override + boolean isJava8() { + return false; + } + }; + // if not java 8, nothing should happen + BootstrapCheck.check(true, Collections.singletonList(nonJava8Check), "testG1GCCheck"); } public void testAlwaysEnforcedChecks() { From cd34eed03ecbbe2f2cbb7f82bc5e4e806b0c98ca Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Tue, 8 Nov 2016 11:07:54 +0100 Subject: [PATCH 22/22] Make ensureGreen and ensureYellow wait for cluster size consistency (#21344) We currently often use ensureGreen or ensureYellow to check whether the cluster is in a good state again after shutting down a node. With the change in #21092, however, it can happen that if the node that is stopped is the master node, another node will become master and publish a cluster state where it is master but where the node that was stopped hasn't been removed yet from the cluster state. It will only publish a second state thereafter where the old master is removed. If the ensureGreen/ensureYellow is timed just right, it will get to execute before the second cluster state update removing the old master and the condition ensureGreen / ensureYellow might not hold at that point anymore. --- .../elasticsearch/test/ESIntegTestCase.java | 61 ++++++++++++------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java index 7f0af14f93a..470d4f48df5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java @@ -152,6 +152,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Random; import java.util.Set; @@ -181,6 +182,7 @@ import static org.hamcrest.Matchers.emptyArray; import static org.hamcrest.Matchers.emptyIterable; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.startsWith; @@ -869,15 +871,45 @@ public abstract class ESIntegTestCase extends ESTestCase { * @param timeout time out value to set on {@link org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest} */ public ClusterHealthStatus ensureGreen(TimeValue timeout, String... indices) { - ClusterHealthResponse actionGet = client().admin().cluster() - .health(Requests.clusterHealthRequest(indices).timeout(timeout).waitForGreenStatus().waitForEvents(Priority.LANGUID).waitForNoRelocatingShards(true)).actionGet(); + return ensureColor(ClusterHealthStatus.GREEN, timeout, indices); + } + + /** + * Ensures the cluster has a yellow state via the cluster health API. + */ + public ClusterHealthStatus ensureYellow(String... indices) { + return ensureColor(ClusterHealthStatus.YELLOW, TimeValue.timeValueSeconds(30), indices); + } + + private ClusterHealthStatus ensureColor(ClusterHealthStatus clusterHealthStatus, TimeValue timeout, String... indices) { + String color = clusterHealthStatus.name().toLowerCase(Locale.ROOT); + String method = "ensure" + Strings.capitalize(color); + + ClusterHealthRequest healthRequest = Requests.clusterHealthRequest(indices) + .timeout(timeout) + .waitForStatus(clusterHealthStatus) + .waitForEvents(Priority.LANGUID) + .waitForNoRelocatingShards(true) + // We currently often use ensureGreen or ensureYellow to check whether the cluster is back in a good state after shutting down + // a node. If the node that is stopped is the master node, another node will become master and publish a cluster state where it + // is master but where the node that was stopped hasn't been removed yet from the cluster state. It will only subsequently + // publish a second state where the old master is removed. If the ensureGreen/ensureYellow is timed just right, it will get to + // execute before the second cluster state update removes the old master and the condition ensureGreen / ensureYellow will + // trivially hold if it held before the node was shut down. The following "waitForNodes" condition ensures that the node has + // been removed by the master so that the health check applies to the set of nodes we expect to be part of the cluster. + .waitForNodes(Integer.toString(cluster().size())); + + ClusterHealthResponse actionGet = client().admin().cluster().health(healthRequest).actionGet(); if (actionGet.isTimedOut()) { - logger.info("ensureGreen timed out, cluster state:\n{}\n{}", - client().admin().cluster().prepareState().get().getState(), client().admin().cluster().preparePendingClusterTasks().get()); - fail("timed out waiting for green state"); + logger.info("{} timed out, cluster state:\n{}\n{}", + method, + client().admin().cluster().prepareState().get().getState(), + client().admin().cluster().preparePendingClusterTasks().get()); + fail("timed out waiting for " + color + " state"); } - assertThat(actionGet.getStatus(), equalTo(ClusterHealthStatus.GREEN)); - logger.debug("indices {} are green", indices.length == 0 ? "[_all]" : indices); + assertThat("Expected at least " + clusterHealthStatus + " but got " + actionGet.getStatus(), + actionGet.getStatus().value(), lessThanOrEqualTo(clusterHealthStatus.value())); + logger.debug("indices {} are {}", indices.length == 0 ? "[_all]" : indices, color); return actionGet.getStatus(); } @@ -991,21 +1023,6 @@ public abstract class ESIntegTestCase extends ESTestCase { .get().isAcknowledged()); } - /** - * Ensures the cluster has a yellow state via the cluster health API. - */ - public ClusterHealthStatus ensureYellow(String... indices) { - ClusterHealthResponse actionGet = client().admin().cluster() - .health(Requests.clusterHealthRequest(indices).waitForNoRelocatingShards(true).waitForYellowStatus().waitForEvents(Priority.LANGUID)).actionGet(); - if (actionGet.isTimedOut()) { - logger.info("ensureYellow timed out, cluster state:\n{}\n{}", - client().admin().cluster().prepareState().get().getState(), client().admin().cluster().preparePendingClusterTasks().get()); - assertThat("timed out waiting for yellow", actionGet.isTimedOut(), equalTo(false)); - } - logger.debug("indices {} are yellow", indices.length == 0 ? "[_all]" : indices); - return actionGet.getStatus(); - } - /** * Prints the current cluster state as debug logging. */