Skip to content

Commit e4a919f

Browse files
committed
Merge branch '6.x' into ccr-6.x
* 6.x: [Kerberos] Use canonical host name (#32588) Cross-cluster search: preserve cluster alias in shard failures (#32608) [TEST] Allow to run in FIPS JVM (#32607) Handle AlreadyClosedException when bumping primary term [Test] Add ckb to the list of unsupported languages (#32611) SCRIPTING: Move Aggregation Scripts to their own context (#32068) (#32629) [TEST] Enhance failure message when bulk updates have failures [ML] Add ML result classes to protocol library (#32587) Suppress LicensingDocumentationIT.testPutLicense in release builds (#32613) [Rollup] Improve ID scheme for rollup documents (#32558) Mutes failing SQL string function tests due to #32589 Suppress Wildfly test in FIPS JVMs (#32543) Add cluster UUID to Cluster Stats API response (#32206) [ML] Add some ML config classes to protocol library (#32502) [TEST]Split transport verification mode none tests (#32488) [Rollup] Remove builders from DateHistogramGroupConfig (#32555) [ML] Add Detector config classes to protocol library (#32495) [Rollup] Remove builders from MetricConfig (#32536) Fix race between replica reset and primary promotion (#32442) HLRC: Move commercial clients from XPackClient (#32596) Security: move User to protocol project (#32367) Minor fix for javadoc (applicable for java 11). (#32573) Painless: Move Some Lookup Logic to PainlessLookup (#32565) Core: Minor size reduction for AbstractComponent (#32509) INGEST: Enable default pipelines (#32286) (#32591) TEST: Avoid merges in testSeqNoAndCheckpoints [Rollup] Remove builders from HistoGroupConfig (#32533) fixed elements in array of produced terms (#32519) Mutes ReindexFailureTests.searchFailure dues to #28053 Mutes LicensingDocumentationIT due to #32580 Remove the SATA controller from OpenSUSE box [ML] Rename JobProvider to JobResultsProvider (#32551)
2 parents 81b66e7 + f102836 commit e4a919f

File tree

329 files changed

+9545
-1892
lines changed

Some content is hidden

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

329 files changed

+9545
-1892
lines changed

Vagrantfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ Vagrant.configure(2) do |config|
115115
'opensuse-42'.tap do |box|
116116
config.vm.define box, define_opts do |config|
117117
config.vm.box = 'elastic/opensuse-42-x86_64'
118-
119-
# https://github.com/elastic/elasticsearch/issues/30295
120-
config.vm.provider 'virtualbox' do |vbox|
121-
vbox.customize ['storagectl', :id, '--name', 'SATA Controller', '--hostiocache', 'on']
122-
end
123118
suse_common config, box
124119
end
125120
end

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

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ public class RestHighLevelClient implements Closeable {
205205
private final SnapshotClient snapshotClient = new SnapshotClient(this);
206206
private final TasksClient tasksClient = new TasksClient(this);
207207
private final XPackClient xPackClient = new XPackClient(this);
208+
private final WatcherClient watcherClient = new WatcherClient(this);
209+
private final LicenseClient licenseClient = new LicenseClient(this);
208210

209211
/**
210212
* Creates a {@link RestHighLevelClient} given the low level {@link RestClientBuilder} that allows to build the
@@ -296,18 +298,38 @@ public final TasksClient tasks() {
296298
}
297299

298300
/**
299-
* A wrapper for the {@link RestHighLevelClient} that provides methods for
300-
* accessing the Elastic Licensed X-Pack APIs that are shipped with the
301-
* default distribution of Elasticsearch. All of these APIs will 404 if run
302-
* against the OSS distribution of Elasticsearch.
301+
* Provides methods for accessing the Elastic Licensed X-Pack Info
302+
* and Usage APIs that are shipped with the default distribution of
303+
* Elasticsearch. All of these APIs will 404 if run against the OSS
304+
* distribution of Elasticsearch.
303305
* <p>
304-
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-api.html">
305-
* X-Pack APIs on elastic.co</a> for more information.
306+
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html">
307+
* Info APIs on elastic.co</a> for more information.
306308
*/
307309
public final XPackClient xpack() {
308310
return xPackClient;
309311
}
310312

313+
/**
314+
* Provides methods for accessing the Elastic Licensed Watcher APIs that
315+
* are shipped with the default distribution of Elasticsearch. All of
316+
* these APIs will 404 if run against the OSS distribution of Elasticsearch.
317+
* <p>
318+
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api.html">
319+
* Watcher APIs on elastic.co</a> for more information.
320+
*/
321+
public WatcherClient watcher() { return watcherClient; }
322+
323+
/**
324+
* Provides methods for accessing the Elastic Licensed Licensing APIs that
325+
* are shipped with the default distribution of Elasticsearch. All of
326+
* these APIs will 404 if run against the OSS distribution of Elasticsearch.
327+
* <p>
328+
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/licensing-apis.html">
329+
* Licensing APIs on elastic.co</a> for more information.
330+
*/
331+
public LicenseClient license() { return licenseClient; }
332+
311333
/**
312334
* Executes a bulk request using the Bulk API.
313335
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html">Bulk API on elastic.co</a>

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,9 @@
4141
public final class XPackClient {
4242

4343
private final RestHighLevelClient restHighLevelClient;
44-
private final WatcherClient watcherClient;
45-
private final LicenseClient licenseClient;
4644

4745
XPackClient(RestHighLevelClient restHighLevelClient) {
4846
this.restHighLevelClient = restHighLevelClient;
49-
this.watcherClient = new WatcherClient(restHighLevelClient);
50-
this.licenseClient = new LicenseClient(restHighLevelClient);
51-
}
52-
53-
public WatcherClient watcher() {
54-
return watcherClient;
5547
}
5648

5749
/**
@@ -102,15 +94,4 @@ public void usageAsync(XPackUsageRequest request, RequestOptions options, Action
10294
restHighLevelClient.performRequestAsyncAndParseEntity(request, RequestConverters::xpackUsage, options,
10395
XPackUsageResponse::fromXContent, listener, emptySet());
10496
}
105-
106-
/**
107-
* A wrapper for the {@link RestHighLevelClient} that provides methods for
108-
* accessing the Elastic Licensing APIs.
109-
* <p>
110-
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/licensing-apis.html">
111-
* X-Pack APIs on elastic.co</a> for more information.
112-
*/
113-
public LicenseClient license() {
114-
return licenseClient;
115-
}
11697
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,9 @@ public void testApiNamingConventions() throws Exception {
774774
method.isAnnotationPresent(Deprecated.class));
775775
} else {
776776
//TODO xpack api are currently ignored, we need to load xpack yaml spec too
777-
if (apiName.startsWith("xpack.") == false) {
777+
if (apiName.startsWith("xpack.") == false &&
778+
apiName.startsWith("license.") == false &&
779+
apiName.startsWith("watcher.") == false) {
778780
apiNotFound.add(apiName);
779781
}
780782
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ private PutWatchResponse createWatch(String watchId) throws Exception {
4646
"}";
4747
BytesReference bytesReference = new BytesArray(json);
4848
PutWatchRequest putWatchRequest = new PutWatchRequest(watchId, bytesReference, XContentType.JSON);
49-
return highLevelClient().xpack().watcher().putWatch(putWatchRequest, RequestOptions.DEFAULT);
49+
return highLevelClient().watcher().putWatch(putWatchRequest, RequestOptions.DEFAULT);
5050
}
5151

5252
public void testDeleteWatch() throws Exception {
5353
// delete watch that exists
5454
{
5555
String watchId = randomAlphaOfLength(10);
5656
createWatch(watchId);
57-
DeleteWatchResponse deleteWatchResponse = highLevelClient().xpack().watcher().deleteWatch(new DeleteWatchRequest(watchId),
57+
DeleteWatchResponse deleteWatchResponse = highLevelClient().watcher().deleteWatch(new DeleteWatchRequest(watchId),
5858
RequestOptions.DEFAULT);
5959
assertThat(deleteWatchResponse.getId(), is(watchId));
6060
assertThat(deleteWatchResponse.getVersion(), is(2L));
@@ -64,7 +64,7 @@ public void testDeleteWatch() throws Exception {
6464
// delete watch that does not exist
6565
{
6666
String watchId = randomAlphaOfLength(10);
67-
DeleteWatchResponse deleteWatchResponse = highLevelClient().xpack().watcher().deleteWatch(new DeleteWatchRequest(watchId),
67+
DeleteWatchResponse deleteWatchResponse = highLevelClient().watcher().deleteWatch(new DeleteWatchRequest(watchId),
6868
RequestOptions.DEFAULT);
6969
assertThat(deleteWatchResponse.getId(), is(watchId));
7070
assertThat(deleteWatchResponse.getVersion(), is(1L));

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.client.documentation;
2121

22+
import org.elasticsearch.Build;
2223
import org.elasticsearch.action.ActionListener;
2324
import org.elasticsearch.action.LatchedActionListener;
2425
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
@@ -43,6 +44,7 @@
4344
public class LicensingDocumentationIT extends ESRestHighLevelClientTestCase {
4445

4546
public void testPutLicense() throws Exception {
47+
assumeTrue("License is only valid when tested against snapshot/test builds", Build.CURRENT.isSnapshot());
4648
RestHighLevelClient client = highLevelClient();
4749
String license = "{\"license\": {\"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4a8\",\"type\":\"gold\"," +
4850
"\"issue_date_in_millis\":1411948800000,\"expiry_date_in_millis\":1914278399999,\"max_nodes\":1,\"issued_to\":\"issued_to\"," +
@@ -60,7 +62,7 @@ public void testPutLicense() throws Exception {
6062
request.setLicenseDefinition(license); // <1>
6163
request.setAcknowledge(false); // <2>
6264

63-
PutLicenseResponse response = client.xpack().license().putLicense(request, RequestOptions.DEFAULT);
65+
PutLicenseResponse response = client.license().putLicense(request, RequestOptions.DEFAULT);
6466
//end::put-license-execute
6567

6668
//tag::put-license-response
@@ -96,7 +98,7 @@ public void onFailure(Exception e) {
9698
listener = new LatchedActionListener<>(listener, latch);
9799

98100
// tag::put-license-execute-async
99-
client.xpack().license().putLicenseAsync(
101+
client.license().putLicenseAsync(
100102
request, RequestOptions.DEFAULT, listener); // <1>
101103
// end::put-license-execute-async
102104

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void testWatcher() throws Exception {
4949
"}");
5050
PutWatchRequest request = new PutWatchRequest("my_watch_id", watch, XContentType.JSON);
5151
request.setActive(false); // <1>
52-
PutWatchResponse response = client.xpack().watcher().putWatch(request, RequestOptions.DEFAULT);
52+
PutWatchResponse response = client.watcher().putWatch(request, RequestOptions.DEFAULT);
5353
//end::x-pack-put-watch-execute
5454

5555
//tag::x-pack-put-watch-response
@@ -85,7 +85,7 @@ public void onFailure(Exception e) {
8585
listener = new LatchedActionListener<>(listener, latch);
8686

8787
// tag::x-pack-put-watch-execute-async
88-
client.xpack().watcher().putWatchAsync(request, RequestOptions.DEFAULT, listener); // <1>
88+
client.watcher().putWatchAsync(request, RequestOptions.DEFAULT, listener); // <1>
8989
// end::x-pack-put-watch-execute-async
9090

9191
assertTrue(latch.await(30L, TimeUnit.SECONDS));
@@ -94,7 +94,7 @@ public void onFailure(Exception e) {
9494
{
9595
//tag::x-pack-delete-watch-execute
9696
DeleteWatchRequest request = new DeleteWatchRequest("my_watch_id");
97-
DeleteWatchResponse response = client.xpack().watcher().deleteWatch(request, RequestOptions.DEFAULT);
97+
DeleteWatchResponse response = client.watcher().deleteWatch(request, RequestOptions.DEFAULT);
9898
//end::x-pack-delete-watch-execute
9999

100100
//tag::x-pack-delete-watch-response
@@ -125,7 +125,7 @@ public void onFailure(Exception e) {
125125
listener = new LatchedActionListener<>(listener, latch);
126126

127127
// tag::x-pack-delete-watch-execute-async
128-
client.xpack().watcher().deleteWatchAsync(request, RequestOptions.DEFAULT, listener); // <1>
128+
client.watcher().deleteWatchAsync(request, RequestOptions.DEFAULT, listener); // <1>
129129
// end::x-pack-delete-watch-execute-async
130130

131131
assertTrue(latch.await(30L, TimeUnit.SECONDS));

docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The above example produces the following term:
8787

8888
[source,text]
8989
---------------------------
90-
[ My, credit, card, is 123_456_789 ]
90+
[ My, credit, card, is, 123_456_789 ]
9191
---------------------------
9292

9393
WARNING: Using a replacement string that changes the length of the original

docs/reference/cluster/stats.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Will return, for example:
2222
"successful" : 1,
2323
"failed" : 0
2424
},
25+
"cluster_uuid": "YjAvIhsCQ9CbjWZb2qJw3Q",
2526
"cluster_name": "elasticsearch",
2627
"timestamp": 1459427693515,
2728
"status": "green",
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
teardown:
3+
- do:
4+
ingest.delete_pipeline:
5+
id: "my_pipeline"
6+
ignore: 404
7+
8+
---
9+
"Test index with default pipeline":
10+
- do:
11+
ingest.put_pipeline:
12+
id: "my_pipeline"
13+
body: >
14+
{
15+
"description": "_description",
16+
"processors": [
17+
{
18+
"bytes" : {
19+
"field" : "bytes_source_field",
20+
"target_field" : "bytes_target_field"
21+
}
22+
}
23+
]
24+
}
25+
- match: { acknowledged: true }
26+
27+
- do:
28+
indices.create:
29+
index: test
30+
body:
31+
settings:
32+
index:
33+
default_pipeline: "my_pipeline"
34+
35+
- do:
36+
index:
37+
index: test
38+
type: test
39+
id: 1
40+
body: {bytes_source_field: "1kb"}
41+
42+
- do:
43+
get:
44+
index: test
45+
type: test
46+
id: 1
47+
- match: { _source.bytes_source_field: "1kb" }
48+
- match: { _source.bytes_target_field: 1024 }
49+
50+
- do:
51+
index:
52+
index: test
53+
type: test
54+
id: 2
55+
pipeline: "_none"
56+
body: {bytes_source_field: "1kb"}
57+
58+
- do:
59+
get:
60+
index: test
61+
type: test
62+
id: 2
63+
- match: { _source.bytes_source_field: "1kb" }
64+
- is_false: _source.bytes_target_field
65+
66+
- do:
67+
catch: bad_request
68+
index:
69+
index: test
70+
type: test
71+
id: 3
72+
pipeline: ""
73+
body: {bytes_source_field: "1kb"}

0 commit comments

Comments
 (0)