Skip to content

Commit 3f45c09

Browse files
committed
Merge branch 'master' into default-no-tls10
2 parents 96fb7e6 + 18a3e48 commit 3f45c09

File tree

60 files changed

+884
-550
lines changed

Some content is hidden

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

60 files changed

+884
-550
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchResponse.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020

2121
import org.elasticsearch.common.ParseField;
2222
import org.elasticsearch.common.xcontent.ObjectParser;
23-
import org.elasticsearch.common.xcontent.ToXContentObject;
24-
import org.elasticsearch.common.xcontent.XContentBuilder;
2523
import org.elasticsearch.common.xcontent.XContentParser;
2624

2725
import java.io.IOException;
2826
import java.util.Objects;
2927

30-
public class PutWatchResponse implements ToXContentObject {
28+
public class PutWatchResponse {
3129

3230
private static final ObjectParser<PutWatchResponse, Void> PARSER
33-
= new ObjectParser<>("x_pack_put_watch_response", PutWatchResponse::new);
31+
= new ObjectParser<>("x_pack_put_watch_response", true, PutWatchResponse::new);
3432

3533
static {
3634
PARSER.declareString(PutWatchResponse::setId, new ParseField("_id"));
@@ -90,15 +88,6 @@ public int hashCode() {
9088
return Objects.hash(id, version, created);
9189
}
9290

93-
@Override
94-
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
95-
return builder.startObject()
96-
.field("_id", id)
97-
.field("_version", version)
98-
.field("created", created)
99-
.endObject();
100-
}
101-
10291
public static PutWatchResponse fromXContent(XContentParser parser) throws IOException {
10392
return PARSER.parse(parser, null);
10493
}

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,37 @@
1818
*/
1919
package org.elasticsearch.client.watcher;
2020

21-
import org.elasticsearch.common.xcontent.XContentParser;
22-
import org.elasticsearch.test.AbstractXContentTestCase;
21+
import org.elasticsearch.common.xcontent.XContentBuilder;
22+
import org.elasticsearch.test.ESTestCase;
2323

2424
import java.io.IOException;
2525

26-
public class PutWatchResponseTests extends AbstractXContentTestCase<PutWatchResponse> {
26+
import static org.elasticsearch.test.AbstractXContentTestCase.xContentTester;
2727

28-
@Override
29-
protected PutWatchResponse createTestInstance() {
30-
String id = randomAlphaOfLength(10);
31-
long version = randomLongBetween(1, 10);
32-
boolean created = randomBoolean();
33-
return new PutWatchResponse(id, version, created);
28+
public class PutWatchResponseTests extends ESTestCase {
29+
30+
public void testFromXContent() throws IOException {
31+
xContentTester(this::createParser,
32+
PutWatchResponseTests::createTestInstance,
33+
PutWatchResponseTests::toXContent,
34+
PutWatchResponse::fromXContent)
35+
.supportsUnknownFields(true)
36+
.assertToXContentEquivalence(false)
37+
.test();
3438
}
3539

36-
@Override
37-
protected PutWatchResponse doParseInstance(XContentParser parser) throws IOException {
38-
return PutWatchResponse.fromXContent(parser);
40+
private static XContentBuilder toXContent(PutWatchResponse response, XContentBuilder builder) throws IOException {
41+
return builder.startObject()
42+
.field("_id", response.getId())
43+
.field("_version", response.getVersion())
44+
.field("created", response.isCreated())
45+
.endObject();
3946
}
4047

41-
@Override
42-
protected boolean supportsUnknownFields() {
43-
return false;
48+
private static PutWatchResponse createTestInstance() {
49+
String id = randomAlphaOfLength(10);
50+
long version = randomLongBetween(1, 10);
51+
boolean created = randomBoolean();
52+
return new PutWatchResponse(id, version, created);
4453
}
4554
}

distribution/packages/src/common/env/elasticsearch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ES_STARTUP_SLEEP_TIME=5
3636
# Specifies the maximum file descriptor number that can be opened by this process
3737
# When using Systemd, this setting is ignored and the LimitNOFILE defined in
3838
# /usr/lib/systemd/system/elasticsearch.service takes precedence
39-
#MAX_OPEN_FILES=65536
39+
#MAX_OPEN_FILES=65535
4040

4141
# The maximum number of bytes of memory that may be locked into RAM
4242
# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option

distribution/packages/src/common/systemd/elasticsearch.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ StandardOutput=journal
2929
StandardError=inherit
3030

3131
# Specifies the maximum file descriptor number that can be opened by this process
32-
LimitNOFILE=65536
32+
LimitNOFILE=65535
3333

3434
# Specifies the maximum number of processes
3535
LimitNPROC=4096

distribution/packages/src/deb/init.d/elasticsearch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ES_HOME=/usr/share/$NAME
3939
#ES_JAVA_OPTS=
4040

4141
# Maximum number of open files
42-
MAX_OPEN_FILES=65536
42+
MAX_OPEN_FILES=65535
4343

4444
# Maximum amount of locked memory
4545
#MAX_LOCKED_MEMORY=

distribution/packages/src/rpm/init.d/elasticsearch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333

3434
# Sets the default values for elasticsearch variables used in this script
3535
ES_HOME="/usr/share/elasticsearch"
36-
MAX_OPEN_FILES=65536
36+
MAX_OPEN_FILES=65535
3737
MAX_MAP_COUNT=262144
3838
ES_PATH_CONF="${path.conf}"
3939

docs/reference/getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ If everything goes well with installation, you should see a bunch of messages th
248248
[2018-09-13T12:20:05,006][INFO ][o.e.n.Node ] [localhost.localdomain] initialized
249249
[2018-09-13T12:20:05,007][INFO ][o.e.n.Node ] [localhost.localdomain] starting ...
250250
[2018-09-13T12:20:05,202][INFO ][o.e.t.TransportService ] [localhost.localdomain] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
251-
[2018-09-13T12:20:05,221][WARN ][o.e.b.BootstrapChecks ] [localhost.localdomain] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
251+
[2018-09-13T12:20:05,221][WARN ][o.e.b.BootstrapChecks ] [localhost.localdomain] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
252252
[2018-09-13T12:20:05,221][WARN ][o.e.b.BootstrapChecks ] [localhost.localdomain] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
253253
[2018-09-13T12:20:08,355][INFO ][o.e.c.s.MasterService ] [localhost.localdomain] zen-disco-elected-as-master ([0] nodes joined)[, ], reason: master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}
254254
[2018-09-13T12:20:08,360][INFO ][o.e.c.s.ClusterApplierService] [localhost.localdomain] master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}, reason: apply cluster state (from master [master {localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)[, ]]])

docs/reference/setup/install/docker.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ needed, adjust them in the Daemon, or override them per container, for example
338338
using `docker run`:
339339
+
340340
--
341-
--ulimit nofile=65536:65536
341+
--ulimit nofile=65535:65535
342342

343343
NOTE: One way of checking the Docker daemon defaults for the aforementioned
344344
ulimits is by running:

docs/reference/setup/install/sysconfig-file.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
`MAX_OPEN_FILES`::
77

8-
Maximum number of open files, defaults to `65536`.
8+
Maximum number of open files, defaults to `65535`.
99

1010
`MAX_LOCKED_MEMORY`::
1111

docs/reference/setup/sysconfig/configuring.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open file handles (`ulimit -n`) to 65,536, you can do the following:
2525
[source,sh]
2626
--------------------------------
2727
sudo su <1>
28-
ulimit -n 65536 <2>
28+
ulimit -n 65535 <2>
2929
su elasticsearch <3>
3030
--------------------------------
3131
<1> Become `root`.
@@ -46,7 +46,7 @@ the `limits.conf` file:
4646

4747
[source,sh]
4848
--------------------------------
49-
elasticsearch - nofile 65536
49+
elasticsearch - nofile 65535
5050
--------------------------------
5151

5252
This change will only take effect the next time the `elasticsearch` user opens

0 commit comments

Comments
 (0)