Skip to content

Commit 972e5a4

Browse files
committed
Merge branch 'master' into java-time
2 parents 3a76b95 + 9c49aac commit 972e5a4

File tree

143 files changed

+1702
-992
lines changed

Some content is hidden

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

143 files changed

+1702
-992
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testfixtures/TestFixturesPlugin.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ public void apply(Project project) {
103103
@Input
104104
public boolean dockerComposeSupported(Project project) {
105105
// Don't look for docker-compose on the PATH yet that would pick up on Windows as well
106-
return
107-
project.file("/usr/local/bin/docker-compose").exists() == false &&
108-
project.file("/usr/bin/docker-compose").exists() == false &&
109-
Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true")) == false;
106+
final boolean hasDockerCompose = project.file("/usr/local/bin/docker-compose").exists() ||
107+
project.file("/usr/bin/docker-compose").exists();
108+
return hasDockerCompose && Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true"));
110109
}
111110

112111
private void setSystemProperty(Task task, String name, Object value) {

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ slf4j = 1.6.2
1515
# when updating the JNA version, also update the version in buildSrc/build.gradle
1616
jna = 4.5.1
1717

18-
netty = 4.1.31.Final
18+
netty = 4.1.32.Final
1919
joda = 2.10.1
2020

2121
# test dependencies

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

Lines changed: 117 additions & 117 deletions
Large diffs are not rendered by default.

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

Lines changed: 68 additions & 70 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void testRequests() throws Exception {
8282
RestHighLevelClient client = highLevelClient();
8383
{
8484
//tag::migration-request-ctor
85-
IndexRequest request = new IndexRequest("index", "doc", "id"); // <1>
85+
IndexRequest request = new IndexRequest("index", "_doc", "id"); // <1>
8686
request.source("{\"field\":\"value\"}", XContentType.JSON);
8787
//end::migration-request-ctor
8888

@@ -93,7 +93,7 @@ public void testRequests() throws Exception {
9393
}
9494
{
9595
//tag::migration-request-async-execution
96-
DeleteRequest request = new DeleteRequest("index", "doc", "id"); // <1>
96+
DeleteRequest request = new DeleteRequest("index", "id"); // <1>
9797
client.deleteAsync(request, RequestOptions.DEFAULT, new ActionListener<DeleteResponse>() { // <2>
9898
@Override
9999
public void onResponse(DeleteResponse deleteResponse) {
@@ -106,11 +106,11 @@ public void onFailure(Exception e) {
106106
}
107107
});
108108
//end::migration-request-async-execution
109-
assertBusy(() -> assertFalse(client.exists(new GetRequest("index", "doc", "id"), RequestOptions.DEFAULT)));
109+
assertBusy(() -> assertFalse(client.exists(new GetRequest("index", "_doc", "id"), RequestOptions.DEFAULT)));
110110
}
111111
{
112112
//tag::migration-request-sync-execution
113-
DeleteRequest request = new DeleteRequest("index", "doc", "id");
113+
DeleteRequest request = new DeleteRequest("index", "id");
114114
DeleteResponse response = client.delete(request, RequestOptions.DEFAULT); // <1>
115115
//end::migration-request-sync-execution
116116
assertEquals(RestStatus.NOT_FOUND, response.status());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ public void onFailure(Exception e) {
204204
GetWatchRequest request = new GetWatchRequest("my_watch_id");
205205
//end::get-watch-request
206206

207-
//tag::ack-watch-execute
207+
//tag::get-watch-execute
208208
GetWatchResponse response = client.watcher().getWatch(request, RequestOptions.DEFAULT);
209-
//end::get-watch-request
209+
//end::get-watch-execute
210210

211211
//tag::get-watch-response
212212
String watchId = response.getId(); // <1>

distribution/packages/src/common/scripts/preinst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# This script is executed in the pre-installation phase
34
#
@@ -9,16 +10,22 @@
910
# $1=1 : indicates an new install
1011
# $1=2 : indicates an upgrade
1112

13+
err_exit() {
14+
echo "$@" >&2
15+
exit 1
16+
}
17+
1218
# Check for these at preinst time due to failures in postinst if they do not exist
1319
if [ -x "$JAVA_HOME/bin/java" ]; then
1420
JAVA="$JAVA_HOME/bin/java"
21+
elif command -v java; then
22+
JAVA=`command -v java`
1523
else
16-
JAVA=`which java`
24+
JAVA=""
1725
fi
1826

1927
if [ -z "$JAVA" ]; then
20-
echo "could not find java; set JAVA_HOME or ensure java is in PATH"
21-
exit 1
28+
err_exit "could not find java; set JAVA_HOME or ensure java is in PATH"
2229
fi
2330

2431
case "$1" in
@@ -75,8 +82,7 @@ case "$1" in
7582
;;
7683

7784
*)
78-
echo "pre install script called with unknown argument \`$1'" >&2
79-
exit 1
85+
err_exit "pre install script called with unknown argument \`$1'"
8086
;;
8187
esac
8288

distribution/src/bin/elasticsearch-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ else
4545
fi
4646

4747
if [ ! -x "$JAVA" ]; then
48-
echo "could not find java; set JAVA_HOME or ensure java is in PATH"
48+
echo "could not find java; set JAVA_HOME or ensure java is in PATH" >&2
4949
exit 1
5050
fi
5151

docs/java-rest/high-level/document/delete.asciidoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
[id="{upid}-{api}-request"]
1111
==== Delete Request
1212

13-
A +{request}+ has no arguments
13+
A +{request}+ has two required arguments:
1414

1515
["source","java",subs="attributes,callouts,macros"]
1616
--------------------------------------------------
1717
include-tagged::{doc-tests-file}[{api}-request]
1818
--------------------------------------------------
1919
<1> Index
20-
<2> Type
21-
<3> Document id
20+
<2> Document id
2221

2322
==== Optional arguments
2423
The following arguments can optionally be provided:

docs/reference/docs/delete.asciidoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[[docs-delete]]
22
== Delete API
33

4-
The delete API allows to delete a typed JSON document from a specific
4+
The delete API allows to delete a JSON document from a specific
55
index based on its id. The following example deletes the JSON document
6-
from an index called `twitter`, under a type called `_doc`, with id `1`:
6+
from an index called `twitter` with ID `1`:
77

88
[source,js]
99
--------------------------------------------------
@@ -92,10 +92,7 @@ the request.
9292
If an <<docs-index_,external versioning variant>> is used,
9393
the delete operation automatically creates an index if it has not been
9494
created before (check out the <<indices-create-index,create index API>>
95-
for manually creating an index), and also automatically creates a
96-
dynamic type mapping for the specific type if it has not been created
97-
before (check out the <<indices-put-mapping,put mapping>>
98-
API for manually creating type mapping).
95+
for manually creating an index).
9996

10097
[float]
10198
[[delete-distributed]]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[role="xpack"]
2+
[testenv="basic"]
3+
[[index-lifecycle-and-snapshots]]
4+
== Restoring Snapshots of Managed Indices
5+
6+
beta[]
7+
8+
When restoring a snapshot that contains indices managed by Index Lifecycle
9+
Management, the lifecycle will automatically continue to execute after the
10+
snapshot is restored. Notably, the `min_age` is relative to the original
11+
creation or rollover of the index, rather than when the index was restored. For
12+
example, a monthly index that is restored partway through its lifecycle after an
13+
accidental deletion will be continue through its lifecycle as expected: The
14+
index will be shrunk, reallocated to different nodes, or deleted on the same
15+
schedule whether or not it has been restored from a snapshot.
16+
17+
However, there may be cases where you need to restore an index from a snapshot,
18+
but do not want it to automatically continue through its lifecycle, particularly
19+
if the index would rapidly progress through lifecycle phases due to its age. For
20+
example, you may wish to add or update documents in an index before it is marked
21+
read only or shrunk, or prevent an index from automatically being deleted.
22+
23+
To stop lifecycle policy execution on an index restored from a snapshot, before
24+
restoring the snapshot, <<start-stop-ilm,lifecycle policy execution can be
25+
paused>> to allow the policy to be removed.
26+
27+
For example, the following workflow can be used in the above situation to
28+
prevent the execution of the lifecycle policy for an index:
29+
30+
1. Pause execution of all lifecycle policies using the <<ilm-stop,Stop ILM API>>
31+
2. Restore the snapshot.
32+
3. Perform whatever operations you wish before resuming lifecycle execution, or
33+
remove the lifecycle policy from the index using the
34+
<<ilm-remove-policy,Remove Policy from Index API>>
35+
4. Resume execution of lifecycle policies using the <<ilm-start,Start ILM API>>

docs/reference/ilm/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ include::update-lifecycle-policy.asciidoc[]
6464

6565
include::error-handling.asciidoc[]
6666

67+
include::ilm-and-snapshots.asciidoc[]
68+
6769
include::start-stop-ilm.asciidoc[]
Loading
228 KB
Loading
Loading

docs/reference/ml/populations.asciidoc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,34 @@ PUT _xpack/ml/anomaly_detectors/population
3232
{
3333
"description" : "Population analysis",
3434
"analysis_config" : {
35-
"bucket_span":"10m",
35+
"bucket_span":"15m",
3636
"influencers": [
37-
"username"
37+
"clientip"
3838
],
3939
"detectors": [
4040
{
4141
"function": "mean",
42-
"field_name": "bytesSent",
43-
"over_field_name": "username" <1>
42+
"field_name": "bytes",
43+
"over_field_name": "clientip" <1>
4444
}
4545
]
4646
},
4747
"data_description" : {
48-
"time_field":"@timestamp",
48+
"time_field":"timestamp",
4949
"time_format": "epoch_ms"
5050
}
5151
}
5252
----------------------------------
5353
//CONSOLE
5454
// TEST[skip:needs-licence]
55-
<1> This `over_field_name` property indicates that the metrics for each user (
56-
as identified by their `username` value) are analyzed relative to other users
55+
<1> This `over_field_name` property indicates that the metrics for each client (
56+
as identified by their IP address) are analyzed relative to other clients
5757
in each bucket.
5858

5959
If your data is stored in {es}, you can use the population job wizard in {kib}
60-
to create a job with these same properties. For example, the population job
61-
wizard provides the following job settings:
60+
to create a job with these same properties. For example, if you add the sample
61+
web logs in {kib}, you can use the following job settings in the population job
62+
wizard:
6263

6364
[role="screenshot"]
6465
image::images/ml-population-job.jpg["Job settings in the population job wizard]
@@ -81,6 +82,6 @@ details about the anomalies:
8182
[role="screenshot"]
8283
image::images/ml-population-anomaly.jpg["Anomaly details for a specific user"]
8384

84-
In this example, the user identified as `antonette` sent a high volume of bytes
85-
on the date and time shown. This event is anomalous because the mean is two times
86-
higher than the expected behavior of the population.
85+
In this example, the client IP address `29.64.62.83` received a high volume of
86+
bytes on the date and time shown. This event is anomalous because the mean is
87+
three times higher than the expected behavior of the population.

docs/reference/modules/cluster/misc.asciidoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ There is a soft limit on the number of shards in a cluster, based on the number
3030
of nodes in the cluster. This is intended to prevent operations which may
3131
unintentionally destabilize the cluster.
3232

33+
IMPORTANT: This limit is intended as a safety net, not a sizing recommendation. The
34+
exact number of shards your cluster can safely support depends on your hardware
35+
configuration and workload, but should remain well below this limit in almost
36+
all cases, as the default limit is set quite high.
37+
3338
If an operation, such as creating a new index, restoring a snapshot of an index,
3439
or opening a closed index would lead to the number of shards in the cluster
3540
going over this limit, the operation will fail with an error indicating the
@@ -53,8 +58,8 @@ adjusted using the following property:
5358
Controls the number of shards allowed in the cluster per data node.
5459

5560
For example, a 3-node cluster with the default setting would allow 3,000 shards
56-
total, across all open indexes. If the above setting is changed to 1,500, then
57-
the cluster would allow 4,500 shards total.
61+
total, across all open indexes. If the above setting is changed to 500, then
62+
the cluster would allow 1,500 shards total.
5863

5964
NOTE: If there are no data nodes in the cluster, the limit will not be enforced.
6065
This allows the creation of indices during cluster creation if dedicated master

docs/reference/setup/install/deb.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ endif::[]
105105

106106
include::skip-set-kernel-parameters.asciidoc[]
107107

108-
ifeval::["{release-state}"=="released"]
108+
ifeval::["{release-state}"!="unreleased"]
109109

110110
[NOTE]
111111
==================================================

docs/reference/setup/install/rpm.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ sudo zypper install elasticsearch <3>
9090

9191
endif::[]
9292

93-
ifeval::["{release-state}"=="released"]
93+
ifeval::["{release-state}"!="unreleased"]
9494

9595
[NOTE]
9696
==================================================

modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleRequest.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ public class RethrottleRequest extends BaseTasksRequest<RethrottleRequest> {
3939
*/
4040
private Float requestsPerSecond;
4141

42+
public RethrottleRequest() {
43+
}
44+
45+
public RethrottleRequest(StreamInput in) throws IOException {
46+
super(in);
47+
this.requestsPerSecond = in.readFloat();
48+
}
49+
50+
@Override
51+
public void writeTo(StreamOutput out) throws IOException {
52+
super.writeTo(out);
53+
out.writeFloat(requestsPerSecond);
54+
}
55+
4256
/**
4357
* The throttle to apply to all matching requests in sub-requests per second. 0 means set no throttle and that is the default.
4458
*/
@@ -80,15 +94,4 @@ public ActionRequestValidationException validate() {
8094
return validationException;
8195
}
8296

83-
@Override
84-
public void readFrom(StreamInput in) throws IOException {
85-
super.readFrom(in);
86-
requestsPerSecond = in.readFloat();
87-
}
88-
89-
@Override
90-
public void writeTo(StreamOutput out) throws IOException {
91-
super.writeTo(out);
92-
out.writeFloat(requestsPerSecond);
93-
}
9497
}

modules/reindex/src/test/java/org/elasticsearch/index/reindex/RoundTripTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ public void testRethrottleRequest() throws IOException {
184184
} else {
185185
request.setTaskId(new TaskId(randomAlphaOfLength(5), randomLong()));
186186
}
187-
RethrottleRequest tripped = new RethrottleRequest();
188-
// We use readFrom here because Rethrottle does not support the Writeable.Reader interface
189-
tripped.readFrom(toInputByteStream(request));
187+
RethrottleRequest tripped = new RethrottleRequest(toInputByteStream(request));
190188
assertEquals(request.getRequestsPerSecond(), tripped.getRequestsPerSecond(), 0.00001);
191189
assertArrayEquals(request.getActions(), tripped.getActions());
192190
assertEquals(request.getTaskId(), tripped.getTaskId());

modules/transport-netty4/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ thirdPartyAudit.excludes = [
109109
'org.jboss.marshalling.Unmarshaller',
110110

111111
// from io.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional
112+
'org.slf4j.helpers.FormattingTuple',
113+
'org.slf4j.helpers.MessageFormatter',
112114
'org.slf4j.Logger',
113115
'org.slf4j.LoggerFactory',
114116
'org.slf4j.spi.LocationAwareLogger',

modules/transport-netty4/licenses/netty-buffer-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-codec-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-codec-http-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-common-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-handler-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-resolver-4.1.31.Final.jar.sha1

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

modules/transport-netty4/licenses/netty-transport-4.1.31.Final.jar.sha1

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

0 commit comments

Comments
 (0)