Skip to content

Commit

Permalink
Merge branch 'master' into close-index-api-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrx committed Dec 21, 2018
2 parents fb24469 + cfea2fd commit bd2af2c
Show file tree
Hide file tree
Showing 414 changed files with 6,806 additions and 4,033 deletions.
1 change: 1 addition & 0 deletions .ci/matrix-build-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

ES_BUILD_JAVA:
- java11
- openjdk12
1 change: 1 addition & 0 deletions .ci/matrix-runtime-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ ES_RUNTIME_JAVA:
- java8
- java8fips
- java11
- openjdk12
- zulu8
- zulu11
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,7 @@ class BuildPlugin implements Plugin<Project> {
it.standardOutput = dockerVersionOutput
})
final String dockerVersion = dockerVersionOutput.toString().trim()
final Matcher matcher = dockerVersion =~ /Docker version (\d+\.\d+)\.\d+(?:-ce)?, build [0-9a-f]{7}/
assert matcher.matches() : dockerVersion
final dockerMajorMinorVersion = matcher.group(1)
final String[] majorMinor = dockerMajorMinorVersion.split("\\.")
if (Integer.parseInt(majorMinor[0]) < 17
|| (Integer.parseInt(majorMinor[0]) == 17 && Integer.parseInt(majorMinor[1]) < 5)) {
final String message = String.format(
Locale.ROOT,
"building Docker images requires Docker version 17.05+ due to use of multi-stage builds yet was [%s]",
dockerVersion)
throwDockerRequiredException(message)
}
checkDockerVersionRecent(dockerVersion)

final ByteArrayOutputStream dockerImagesErrorOutput = new ByteArrayOutputStream()
// the Docker binary executes, check that we can execute a privileged command
Expand Down Expand Up @@ -339,6 +328,21 @@ class BuildPlugin implements Plugin<Project> {
}
}

protected static void checkDockerVersionRecent(String dockerVersion) {
final Matcher matcher = dockerVersion =~ /Docker version (\d+\.\d+)\.\d+(?:-ce)?, build [0-9a-f]{7,40}/
assert matcher.matches(): dockerVersion
final dockerMajorMinorVersion = matcher.group(1)
final String[] majorMinor = dockerMajorMinorVersion.split("\\.")
if (Integer.parseInt(majorMinor[0]) < 17
|| (Integer.parseInt(majorMinor[0]) == 17 && Integer.parseInt(majorMinor[1]) < 5)) {
final String message = String.format(
Locale.ROOT,
"building Docker images requires Docker version 17.05+ due to use of multi-stage builds yet was [%s]",
dockerVersion)
throwDockerRequiredException(message)
}
}

private static void throwDockerRequiredException(final String message) {
throw new GradleException(
message + "\nyou can address this by attending to the reported issue, "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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.gradle;

import org.elasticsearch.gradle.test.GradleUnitTestCase;
import org.gradle.api.GradleException;
import org.junit.Test;


public class BuildPluginTests extends GradleUnitTestCase {

public void testPassingDockerVersions() {
BuildPlugin.checkDockerVersionRecent("Docker version 18.06.1-ce, build e68fc7a215d7");
BuildPlugin.checkDockerVersionRecent("Docker version 17.05.0, build e68fc7a");
BuildPlugin.checkDockerVersionRecent("Docker version 17.05.1, build e68fc7a");
}

@Test(expected = GradleException.class)
public void testFailingDockerVersions() {
BuildPlugin.checkDockerVersionRecent("Docker version 17.04.0, build e68fc7a");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,16 @@ static Request multiGet(MultiGetRequest multiGetRequest) throws IOException {

static Request index(IndexRequest indexRequest) {
String method = Strings.hasLength(indexRequest.id()) ? HttpPut.METHOD_NAME : HttpPost.METHOD_NAME;
boolean isCreate = (indexRequest.opType() == DocWriteRequest.OpType.CREATE);
String endpoint = endpoint(indexRequest.index(), indexRequest.type(), indexRequest.id(), isCreate ? "_create" : null);

String endpoint;
if (indexRequest.opType() == DocWriteRequest.OpType.CREATE) {
endpoint = indexRequest.type().equals(MapperService.SINGLE_MAPPING_NAME)
? endpoint(indexRequest.index(), "_create", indexRequest.id())
: endpoint(indexRequest.index(), indexRequest.type(), indexRequest.id(), "_create");
} else {
endpoint = endpoint(indexRequest.index(), indexRequest.type(), indexRequest.id());
}

Request request = new Request(method, endpoint);

Params parameters = new Params(request);
Expand Down Expand Up @@ -471,7 +479,7 @@ static Request count(CountRequest countRequest) throws IOException {
}

static Request explain(ExplainRequest explainRequest) throws IOException {
String endpoint = explainRequest.isTypeless()
String endpoint = explainRequest.type().equals(MapperService.SINGLE_MAPPING_NAME)
? endpoint(explainRequest.index(), "_explain", explainRequest.id())
: endpoint(explainRequest.index(), explainRequest.type(), explainRequest.id(), "_explain");
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ public void testIndex() throws IOException {

Request request = RequestConverters.index(indexRequest);
if (indexRequest.opType() == DocWriteRequest.OpType.CREATE) {
assertEquals("/" + index + "/_doc/" + id + "/_create", request.getEndpoint());
assertEquals("/" + index + "/_create/" + id, request.getEndpoint());
} else if (id != null) {
assertEquals("/" + index + "/_doc/" + id, request.getEndpoint());
} else {
Expand Down Expand Up @@ -1685,17 +1685,17 @@ public void testEndpointBuilder() {
assertEquals("/a/b", endpointBuilder.build());
}
{
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a").addPathPart("b").addPathPartAsIs("_create");
assertEquals("/a/b/_create", endpointBuilder.build());
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a").addPathPart("b").addPathPartAsIs("_endpoint");
assertEquals("/a/b/_endpoint", endpointBuilder.build());
}

{
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a", "b", "c").addPathPartAsIs("_create");
assertEquals("/a/b/c/_create", endpointBuilder.build());
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a", "b", "c").addPathPartAsIs("_endpoint");
assertEquals("/a/b/c/_endpoint", endpointBuilder.build());
}
{
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a").addPathPartAsIs("_create");
assertEquals("/a/_create", endpointBuilder.build());
EndpointBuilder endpointBuilder = new EndpointBuilder().addPathPart("a").addPathPartAsIs("_endpoint");
assertEquals("/a/_endpoint", endpointBuilder.build());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,6 @@ public void onFailure(Exception e) {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/36362")
public void testInvalidateToken() throws Exception {
RestHighLevelClient client = highLevelClient();

Expand Down
2 changes: 1 addition & 1 deletion docs/Versions.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:version: 7.0.0-alpha1
:version: 7.0.0-alpha2
:major-version: 7.x
:lucene_version: 8.0.0
:lucene_version_path: 8_0_0
Expand Down
3 changes: 2 additions & 1 deletion docs/java-rest/high-level/search/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,5 @@ include-tagged::{doc-tests-file}[{api}-request-profiling-aggs]
<4> Retrieve the time in millis spent executing the Lucene collector
<5> Retrieve the profile results for the sub-aggregations (if any)

The Rest API documentation contains more information about {ref}/_profiling_aggregations.html[Profiling Aggregations]
The Rest API documentation contains more information about
{ref}/search-profile-aggregations.html[Profiling aggregations].
14 changes: 8 additions & 6 deletions docs/plugins/discovery.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[[discovery]]
== Discovery Plugins

Discovery plugins extend Elasticsearch by adding new discovery mechanisms that
can be used instead of {ref}/modules-discovery-zen.html[Zen Discovery].
Discovery plugins extend Elasticsearch by adding new hosts providers that can be
used to extend the {ref}/modules-discovery.html[cluster formation module].

[float]
==== Core discovery plugins
Expand All @@ -11,22 +11,24 @@ The core discovery plugins are:

<<discovery-ec2,EC2 discovery>>::

The EC2 discovery plugin uses the https://github.com/aws/aws-sdk-java[AWS API] for unicast discovery.
The EC2 discovery plugin uses the https://github.com/aws/aws-sdk-java[AWS API]
for unicast discovery.

<<discovery-azure-classic,Azure Classic discovery>>::

The Azure Classic discovery plugin uses the Azure Classic API for unicast discovery.
The Azure Classic discovery plugin uses the Azure Classic API for unicast
discovery.

<<discovery-gce,GCE discovery>>::

The Google Compute Engine discovery plugin uses the GCE API for unicast discovery.
The Google Compute Engine discovery plugin uses the GCE API for unicast
discovery.

[float]
==== Community contributed discovery plugins

A number of discovery plugins have been contributed by our community:

* https://github.com/shikhar/eskka[eskka Discovery Plugin] (by Shikhar Bhushan)
* https://github.com/fabric8io/elasticsearch-cloud-kubernetes[Kubernetes Discovery Plugin] (by Jimmi Dyson, http://fabric8.io[fabric8])

include::discovery-ec2.asciidoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-delete-auto-follow-pattern]]
=== Delete Auto-Follow Pattern API
=== Delete auto-follow pattern API
++++
<titleabbrev>Delete Auto-Follow Pattern</titleabbrev>
<titleabbrev>Delete auto-follow pattern</titleabbrev>
++++

beta[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-auto-follow-pattern]]
=== Get Auto-Follow Pattern API
=== Get auto-follow pattern API
++++
<titleabbrev>Get Auto-Follow Pattern</titleabbrev>
<titleabbrev>Get auto-follow pattern</titleabbrev>
++++

beta[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-put-auto-follow-pattern]]
=== Create Auto-Follow Pattern API
=== Create auto-follow pattern API
++++
<titleabbrev>Create Auto-Follow Pattern</titleabbrev>
<titleabbrev>Create auto-follow pattern</titleabbrev>
++++

beta[]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ccr/apis/follow/get-follow-stats.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-follow-stats]]
=== Get Follower Stats API
=== Get follower stats API
++++
<titleabbrev>Get Follower Stats</titleabbrev>
<titleabbrev>Get follower stats</titleabbrev>
++++

beta[]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ccr/apis/follow/post-pause-follow.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-pause-follow]]
=== Pause Follower API
=== Pause follower API
++++
<titleabbrev>Pause Follower</titleabbrev>
<titleabbrev>Pause follower</titleabbrev>
++++

beta[]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ccr/apis/follow/post-resume-follow.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-resume-follow]]
=== Resume Follower API
=== Resume follower API
++++
<titleabbrev>Resume Follower</titleabbrev>
<titleabbrev>Resume follower</titleabbrev>
++++

beta[]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ccr/apis/follow/put-follow.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-put-follow]]
=== Create Follower API
=== Create follower API
++++
<titleabbrev>Create Follower</titleabbrev>
<titleabbrev>Create follower</titleabbrev>
++++

beta[]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ccr/apis/get-ccr-stats.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-stats]]
=== Get Cross-Cluster Replication Stats API
=== Get cross-cluster replication stats API
++++
<titleabbrev>Get CCR Stats</titleabbrev>
<titleabbrev>Get CCR stats</titleabbrev>
++++

beta[]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ccr/getting-started.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-getting-started]]
== Getting Started with {ccr}
== Getting started with {ccr}

beta[]

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/commands/certgen.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ keys for each instance. If you chose to generate a CA, which is the default
behavior, the certificate and private key are included in the output file. If
you chose to generate CSRs, you should provide them to your commercial or
organization-specific certificate authority to obtain signed certificates. The
signed certificates must be in PEM format to work with {security}.
signed certificates must be in PEM format to work with the {stack}
{security-features}.

[float]
=== Parameters
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/commands/certutil.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ the command produces a zip file containing the generated certificates and keys.

The `csr` mode generates certificate signing requests (CSRs) that you can send
to a trusted certificate authority to obtain signed certificates. The signed
certificates must be in PEM or PKCS#12 format to work with {security}.
certificates must be in PEM or PKCS#12 format to work with {es}
{security-features}.

By default, the command produces a single CSR for a single instance.

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/commands/setup-passwords.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ bin/elasticsearch-setup-passwords auto|interactive
[float]
=== Description

This command is intended for use only during the initial configuration of
{xpack}. It uses the
This command is intended for use only during the initial configuration of the
{es} {security-features}. It uses the
{stack-ov}/built-in-users.html#bootstrap-elastic-passwords[`elastic` bootstrap password]
to run user management API requests. After you set a password for the `elastic`
user, the bootstrap password is no longer active and you cannot use this command.
Expand All @@ -36,7 +36,7 @@ location, ensure that the *ES_PATH_CONF* environment variable returns the
correct path before you run the `elasticsearch-setup-passwords` command. You can
override settings in your `elasticsearch.yml` file by using the `-E` command
option. For more information about debugging connection failures, see
{xpack-ref}/trb-security-setup.html[`elasticsearch-setup-passwords` command fails due to connection failure].
{stack-ov}/trb-security-setup.html[`elasticsearch-setup-passwords` command fails due to connection failure].

[float]
=== Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/docs/index_.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Another option to specify `create` is to use the following uri:

[source,js]
--------------------------------------------------
PUT twitter/_doc/1/_create
PUT twitter/_create/1
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ilm/apis/delete-lifecycle.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[role="xpack"]
[testenv="basic"]
[[ilm-delete-lifecycle]]
=== Delete Lifecycle Policy API
=== Delete lifecycle policy API
++++
<titleabbrev>Delete Policy</titleabbrev>
<titleabbrev>Delete policy</titleabbrev>
++++

beta[]
Expand Down
Loading

0 comments on commit bd2af2c

Please sign in to comment.