Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/master' into geosql
Browse files Browse the repository at this point in the history
  • Loading branch information
imotov committed Apr 30, 2019
2 parents d193922 + 217f5b9 commit 01b6c79
Show file tree
Hide file tree
Showing 177 changed files with 6,111 additions and 1,583 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def linux_common(config,
SHELL

config.vm.provision 'jdk-11', type: 'shell', inline: <<-SHELL
curl -sSL https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
curl -sSL https://download.oracle.com/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
SHELL

# This prevents leftovers from previous tests using the
Expand Down Expand Up @@ -405,7 +405,7 @@ def windows_common(config, name)

config.vm.provision 'windows-jdk-11', type: 'shell', inline: <<-SHELL
New-Item -ItemType Directory -Force -Path "C:/java"
Invoke-WebRequest "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip" -OutFile "C:/java/jdk-11.zip"
Invoke-WebRequest "https://download.oracle.com/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip" -OutFile "C:/java/jdk-11.zip"
Expand-Archive -Path "C:/java/jdk-11.zip" -DestinationPath "C:/java/"
SHELL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void testUseClusterBySkippedAndWorkingTask() {
);
}

@Ignore // https://github.com/elastic/elasticsearch/issues/41256
public void testMultiProject() {
BuildResult result = getTestClustersRunner(
"user1", "user2", "-s", "-i", "--parallel", "-Dlocal.repo.path=" + getLocalTestRepoPath()
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
elasticsearch = 8.0.0
lucene = 8.1.0-snapshot-e460356abe

bundled_jdk = 12+33
bundled_jdk = 12.0.1+12@69cfe15208a647278a19ef0990eea691

# optional dependencies
spatial4j = 0.7
Expand All @@ -20,7 +20,7 @@ slf4j = 1.6.2
# when updating the JNA version, also update the version in buildSrc/build.gradle
jna = 4.5.1

netty = 4.1.32.Final
netty = 4.1.35.Final
joda = 2.10.1

# when updating this version, you need to ensure compatibility with:
Expand Down
13 changes: 11 additions & 2 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,31 @@ xpack.subprojects.findAll { it.parent == xpack }.each { Project xpackModule ->
*****************************************************************************/
// extract the bundled jdk version, broken into elements as: [feature, interim, update, build]
// Note the "patch" version is not yet handled here, as it has not yet been used by java.
Pattern JDK_VERSION = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+)")
Pattern JDK_VERSION = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+)@([a-f0-9]{32})?")
Matcher jdkVersionMatcher = JDK_VERSION.matcher(VersionProperties.bundledJdk)
if (jdkVersionMatcher.matches() == false) {
throw new IllegalArgumentException("Malformed jdk version [" + VersionProperties.bundledJdk + "]")
}
String jdkVersion = jdkVersionMatcher.group(1) + (jdkVersionMatcher.group(2) != null ? (jdkVersionMatcher.group(2)) : "")
String jdkMajor = jdkVersionMatcher.group(1)
String jdkBuild = jdkVersionMatcher.group(3)
String hash = jdkVersionMatcher.group(4)

repositories {
// simpler legacy pattern from JDK 9 to JDK 12 that we are advocating to Oracle to bring back
ivy {
url "https://download.java.net"
url "https://download.oracle.com"
patternLayout {
artifact "java/GA/jdk${jdkMajor}/${jdkBuild}/GPL/openjdk-[revision]_[module]-x64_bin.[ext]"
}
}
// current pattern since 12.0.1
ivy {
url "https://download.oracle.com"
patternLayout {
artifact "java/GA/jdk${jdkVersion}/${hash}/${jdkBuild}/GPL/openjdk-[revision]_[module]-x64_bin.[ext]"
}
}
}
for (String platform : ['linux', 'darwin', 'windows']) {
String jdkConfigName = "jdk_${platform}"
Expand Down
3 changes: 2 additions & 1 deletion distribution/src/bin/elasticsearch-plugin
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

ES_MAIN_CLASS=org.elasticsearch.plugins.PluginCli \
ES_JAVA_OPTS="--add-opens java.base/sun.security.provider=ALL-UNNAMED $ES_JAVA_OPTS" \
ES_MAIN_CLASS=org.elasticsearch.plugins.PluginCli \
ES_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \
"`dirname "$0"`"/elasticsearch-cli \
"$@"
1 change: 1 addition & 0 deletions distribution/src/bin/elasticsearch-plugin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
setlocal enabledelayedexpansion
setlocal enableextensions

set ES_JAVA_OPTS=--add-opens java.base/sun.security.provider=ALL-UNNAMED %ES_JAVA_OPTS%
set ES_MAIN_CLASS=org.elasticsearch.plugins.PluginCli
set ES_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli
call "%~dp0elasticsearch-cli.bat" ^
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/docs/bulk.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,8 @@ POST _bulk
=== Security

See <<url-access-control>>.

[float]
[[bulk-partial-responses]]
=== Partial responses
To ensure fast responses, the multi search API will respond with partial results if one or more shards fail. See <<shard-failures, Shard failures>> for more information.
22 changes: 17 additions & 5 deletions docs/reference/docs/data-replication.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,24 @@ is as follows:
. Combine the results and respond. Note that in the case of get by ID look up, only one shard is relevant and this step can be skipped.

[float]
==== Failure handling
[[shard-failures]]
==== Shard failures

When a shard fails to respond to a read request, the coordinating node sends the
request to another shard copy in the same replication group. Repeated failures
can result in no available shard copies.

To ensure fast responses, the following APIs will
respond with partial results if one or more shards fail:

* <<search-search, Search>>
* <<search-multi-search, Multi Search>>
* <<docs-bulk, Bulk>>
* <<docs-multi-get, Multi Get>>

When a shard fails to respond to a read request, the coordinating node will select another copy from the same replication group
and send the shard level search request to that copy instead. Repetitive failures can result in no shard copies being available.
In some cases, such as `_search`, Elasticsearch will prefer to respond fast, albeit with partial results, instead of waiting
for the issue to be resolved (partial results are indicated in the `_shards` header of the response).
Responses containing partial results still provide a `200 OK` HTTP status code.
Shard failures are indicated by the `timed_out` and `_shards` fields of
the response header.

[float]
=== A few simple implications
Expand Down
7 changes: 6 additions & 1 deletion docs/reference/docs/multi-get.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[docs-multi-get]]
== Multi Get API

Multi Get API allows to get multiple documents based on an index, type,
The Multi get API returns multiple documents based on an index, type,
(optional) and id (and possibly routing). The response includes a `docs` array
with all the fetched documents in order corresponding to the original multi-get
request (if there was a failure for a specific get, an object containing this
Expand Down Expand Up @@ -212,3 +212,8 @@ document `test/_doc/1` will be fetched from the shard corresponding to routing k
=== Security

See <<url-access-control>>.

[float]
[[multi-get-partial-responses]]
=== Partial responses
To ensure fast responses, the multi get API will respond with partial results if one or more shards fail. See <<shard-failures, Shard failures>> for more information.
2 changes: 1 addition & 1 deletion docs/reference/ml/apis/get-filter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can get a single filter or all filters. For more information, see
(string) Identifier for the filter.


==== Request Body
==== Querystring Parameters

`from`:::
(integer) Skips the specified number of filters.
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/search/multi-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,8 @@ GET _msearch/template
-----------------------------------------------
// CONSOLE
// TEST[continued]

[float]
[[multi-search-partial-responses]]
=== Partial responses
To ensure fast responses, the multi search API will respond with partial results if one or more shards fail. See <<shard-failures, Shard failures>> for more information.
7 changes: 6 additions & 1 deletion docs/reference/search/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ Or we can search across all available indices using `_all`:
GET /_all/_search?q=tag:wow
---------------------------------------------------
// CONSOLE
// TEST[setup:twitter]
// TEST[setup:twitter]

[float]
[[search-partial-responses]]
=== Partial responses
To ensure fast responses, the search API will respond with partial results if one or more shards fail. See <<shard-failures, Shard failures>> for more information.
3 changes: 1 addition & 2 deletions docs/reference/settings/monitoring-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ ignored.
`xpack.monitoring.collection.interval` (<<cluster-update-settings,Dynamic>>)::

Setting to `-1` to disable data collection is no longer supported beginning with
7.0.0. deprecated[6.3.0, Use `xpack.monitoring.collection.enabled` set to
`false` instead.]
7.0.0. deprecated[6.3.0, Use `xpack.monitoring.collection.enabled` set to `false` instead.]
+
Controls how often data samples are collected. Defaults to `10s`. If you
modify the collection interval, set the `xpack.monitoring.min_interval_seconds`
Expand Down
36 changes: 23 additions & 13 deletions docs/reference/settings/notification-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ via email, see {xpack-ref}/actions-email.html#configuring-email-actions[Configur
`xpack.notification.email.account`::
Specifies account information for sending notifications via email. You
can specify the following email account attributes:

+
--
[[email-account-attributes]]

`profile` (<<cluster-update-settings,Dynamic>>);;
The {xpack-ref}/actions-email.html#configuring-email[email profile] to use to build the MIME
messages that are sent from the account. Valid values: `standard`, `gmail` and
Expand Down Expand Up @@ -157,14 +159,17 @@ can specify the following email account attributes:
`smtp.wait_on_quit` (<<cluster-update-settings,Dynamic>>);;
If set to false the QUIT command is sent and the connection closed. If set to
true, the QUIT command is sent and a reply is waited for. True by default.
--

`xpack.notification.email.html.sanitization.allow`::
Specifies the HTML elements that are allowed in email notifications. For
more information, see {xpack-ref}/actions-email.html#email-html-sanitization[Configuring HTML
Sanitization Options]. You can specify individual HTML elements
and the following HTML feature groups:

+
--
[[html-feature-groups]]

`_tables`;;
All table related elements: `<table>`, `<th>`, `<tr>`
and `<td>`.
Expand Down Expand Up @@ -196,6 +201,7 @@ and the following HTML feature groups:
`img:embedded`;;
Only embedded images. Embedded images can only use the
`cid:` URL protocol in their `src` attribute.
--

`xpack.notification.email.html.sanitization.disallow`::
Specifies the HTML elements that are NOT allowed in email notifications.
Expand All @@ -216,7 +222,8 @@ via Slack, see {xpack-ref}/actions-slack.html#configuring-slack-actions[Configu
`xpack.notification.slack` ::
Specifies account information for sending notifications
via Slack. You can specify the following Slack account attributes:

+
--
[[slack-account-attributes]]

`secure_url` (<<secure-settings,Secure>>);;
Expand Down Expand Up @@ -244,7 +251,7 @@ via Slack. You can specify the following Slack account attributes:
Specified as an array as defined in the
https://api.slack.com/docs/attachments[
Slack attachments documentation].

--

[float]
[[jira-notification-settings]]
Expand All @@ -256,7 +263,8 @@ to create issues in Jira, see {xpack-ref}/actions-jira.html#configuring-jira-ac
`xpack.notification.jira` ::
Specifies account information for using notifications to create
issues in Jira. You can specify the following Jira account attributes:

+
--
[[jira-account-attributes]]

`secure_url` (<<secure-settings,Secure>>);;
Expand All @@ -272,7 +280,7 @@ issues in Jira. You can specify the following Jira account attributes:
Default fields values for the issue created in Jira. See
{xpack-ref}/actions-jira.html#jira-action-attributes[Jira Action Attributes] for more information.
Optional.

--

[float]
[[pagerduty-notification-settings]]
Expand All @@ -286,7 +294,8 @@ via PagerDuty, see {xpack-ref}/actions-pagerduty.html#configuring-pagerduty-act
`xpack.notification.pagerduty`::
Specifies account information for sending notifications
via PagerDuty. You can specify the following PagerDuty account attributes:

+
--
`name`;;
A name for the PagerDuty account associated with the API key you
are using to access PagerDuty. Required.
Expand All @@ -299,25 +308,26 @@ via PagerDuty. You can specify the following PagerDuty account attributes:
`event_defaults`;;
Default values for {xpack-ref}/actions-pagerduty.html#pagerduty-event-trigger-incident-attributes[
PagerDuty event attributes]. Optional.

+
`description`::
A string that contains the default description for PagerDuty events.
If no default is configured, each PagerDuty action must specify a
`description`.

+
`incident_key`::
A string that contains the default incident key to use when sending
PagerDuty events.

+
`client`::
A string that specifies the default monitoring client.

+
`client_url`::
The URL of the default monitoring client.

+
`event_type`::
The default event type. Valid values: `trigger`,`resolve`, `acknowledge`.

+
`attach_payload`::
Whether or not to provide the watch payload as context for
the event by default. Valid values: `true`, `false`.
--
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public int hashCode() {
}

@Override
public <T> T visit(GeometryVisitor<T> visitor) {
public <T, E extends Exception> T visit(GeometryVisitor<T, E> visitor) throws E {
return visitor.visit(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface Geometry {

ShapeType type();

<T> T visit(GeometryVisitor<T> visitor);
<T, E extends Exception> T visit(GeometryVisitor<T, E> visitor) throws E;

boolean isEmpty();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ShapeType type() {
}

@Override
public <T> T visit(GeometryVisitor<T> visitor) {
public <T, E extends Exception> T visit(GeometryVisitor<T, E> visitor) throws E {
return visitor.visit(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@
*
* @see <a href="https://en.wikipedia.org/wiki/Visitor_pattern">Visitor Pattern</a>
*/
public interface GeometryVisitor<T> {
public interface GeometryVisitor<T, E extends Exception> {

T visit(Circle circle);
T visit(Circle circle) throws E;

T visit(GeometryCollection<?> collection);
T visit(GeometryCollection<?> collection) throws E;

T visit(Line line);
T visit(Line line) throws E;

T visit(LinearRing ring);
T visit(LinearRing ring) throws E;

T visit(MultiLine multiLine);
T visit(MultiLine multiLine) throws E;

T visit(MultiPoint multiPoint);
T visit(MultiPoint multiPoint) throws E;

T visit(MultiPolygon multiPolygon);
T visit(MultiPolygon multiPolygon) throws E;

T visit(Point point);
T visit(Point point) throws E;

T visit(Polygon polygon);
T visit(Polygon polygon) throws E;

T visit(Rectangle rectangle);
T visit(Rectangle rectangle) throws E;

}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public ShapeType type() {
}

@Override
public <T> T visit(GeometryVisitor<T> visitor) {
public <T, E extends Exception> T visit(GeometryVisitor<T, E> visitor) throws E {
return visitor.visit(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ShapeType type() {
}

@Override
public <T> T visit(GeometryVisitor<T> visitor) {
public <T, E extends Exception> T visit(GeometryVisitor<T, E> visitor) throws E {
return visitor.visit(this);
}
}
Loading

0 comments on commit 01b6c79

Please sign in to comment.