From 78be3dde255b5899dd48c08cb74927b69486bc2c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 4 Jun 2019 20:51:58 -0400 Subject: [PATCH] Enable testing against JDK 13 EA builds (#40829) This commit adds JDK 13 to the CI rotation for testing. For now, we will be testing against JDK 13 EA builds. --- .ci/java-versions.properties | 1 + .ci/matrix-build-javas.yml | 1 + .ci/matrix-runtime-javas.yml | 1 + .../java/org/elasticsearch/bootstrap/Security.java | 6 +++--- .../java/org/elasticsearch/common/inject/Binder.java | 2 +- .../inject/assistedinject/FactoryProvider.java | 2 +- .../common/lucene/search/XMoreLikeThis.java | 2 +- .../org/elasticsearch/snapshots/package-info.java | 6 +++--- .../org/elasticsearch/bootstrap/security.policy | 2 ++ .../org/elasticsearch/xpack/sql/package-info.java | 12 ++++++------ 10 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index df205e4868c..9df8850c301 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -8,3 +8,4 @@ ES_BUILD_JAVA=openjdk12 ES_RUNTIME_JAVA=java8 GRADLE_TASK=build + diff --git a/.ci/matrix-build-javas.yml b/.ci/matrix-build-javas.yml index 202fd60edea..85813a01a9d 100644 --- a/.ci/matrix-build-javas.yml +++ b/.ci/matrix-build-javas.yml @@ -7,3 +7,4 @@ ES_BUILD_JAVA: - openjdk12 + - openjdk13 diff --git a/.ci/matrix-runtime-javas.yml b/.ci/matrix-runtime-javas.yml index 0f945376ee4..a865f33710b 100644 --- a/.ci/matrix-runtime-javas.yml +++ b/.ci/matrix-runtime-javas.yml @@ -11,6 +11,7 @@ ES_RUNTIME_JAVA: - java11 - java12 - openjdk12 + - openjdk13 - zulu8 - zulu11 - zulu12 diff --git a/server/src/main/java/org/elasticsearch/bootstrap/Security.java b/server/src/main/java/org/elasticsearch/bootstrap/Security.java index 2a537186f6a..b477e45ba37 100644 --- a/server/src/main/java/org/elasticsearch/bootstrap/Security.java +++ b/server/src/main/java/org/elasticsearch/bootstrap/Security.java @@ -61,7 +61,7 @@ import static org.elasticsearch.bootstrap.FilePermissionUtils.addSingleFilePath; /** * Initializes SecurityManager with necessary permissions. *
- *

Initialization

+ *

Initialization

* The JVM is not initially started with security manager enabled, * instead we turn it on early in the startup process. This is a tradeoff * between security and ease of use: @@ -72,7 +72,7 @@ import static org.elasticsearch.bootstrap.FilePermissionUtils.addSingleFilePath; * otherwise be permitted. * *
- *

Permissions

+ *

Permissions

* Permissions use a policy file packaged as a resource, this file is * also used in tests. File permissions are generated dynamically and * combined with this policy file. @@ -92,7 +92,7 @@ import static org.elasticsearch.bootstrap.FilePermissionUtils.addSingleFilePath; * cleanups to the scripting apis). But still it can provide some defense for users * that enable dynamic scripting without being fully aware of the consequences. *
- *

Debugging Security

+ *

Debugging Security

* A good place to start when there is a problem is to turn on security debugging: *
  * ES_JAVA_OPTS="-Djava.security.debug=access,failure" bin/elasticsearch
diff --git a/server/src/main/java/org/elasticsearch/common/inject/Binder.java b/server/src/main/java/org/elasticsearch/common/inject/Binder.java
index 03d164bcbaa..55e219047c2 100644
--- a/server/src/main/java/org/elasticsearch/common/inject/Binder.java
+++ b/server/src/main/java/org/elasticsearch/common/inject/Binder.java
@@ -31,7 +31,7 @@ import java.lang.annotation.Annotation;
  * used to create an {@link Injector}. Guice provides this object to your
  * application's {@link Module} implementors so they may each contribute
  * their own bindings and other registrations.
- * 

The Guice Binding EDSL

+ *

The Guice Binding EDSL

*

* Guice uses an embedded domain-specific language, or EDSL, to help you * create bindings simply and readably. This approach is great for overall diff --git a/server/src/main/java/org/elasticsearch/common/inject/assistedinject/FactoryProvider.java b/server/src/main/java/org/elasticsearch/common/inject/assistedinject/FactoryProvider.java index 9e2d0e37986..2ef0b89fb15 100644 --- a/server/src/main/java/org/elasticsearch/common/inject/assistedinject/FactoryProvider.java +++ b/server/src/main/java/org/elasticsearch/common/inject/assistedinject/FactoryProvider.java @@ -39,7 +39,7 @@ import static java.util.Collections.unmodifiableSet; /** * Provides a factory that combines the caller's arguments with injector-supplied values to * construct objects. - *

Defining a factory

+ *

Defining a factory

* Create an interface whose methods return the constructed type, or any of its supertypes. The * method's parameters are the arguments required to build the constructed type. *
public interface PaymentFactory {
diff --git a/server/src/main/java/org/elasticsearch/common/lucene/search/XMoreLikeThis.java b/server/src/main/java/org/elasticsearch/common/lucene/search/XMoreLikeThis.java
index 1010c917eca..b958b293183 100644
--- a/server/src/main/java/org/elasticsearch/common/lucene/search/XMoreLikeThis.java
+++ b/server/src/main/java/org/elasticsearch/common/lucene/search/XMoreLikeThis.java
@@ -97,7 +97,7 @@ import java.util.Set;
  * above.  The frequency and length thresholds could be parameters, etc.
  * Doug
  * 
- *

Initial Usage

+ *

Initial Usage

*

* This class has lots of options to try to make it efficient and flexible. * The simplest possible usage is as follows. The bold diff --git a/server/src/main/java/org/elasticsearch/snapshots/package-info.java b/server/src/main/java/org/elasticsearch/snapshots/package-info.java index d5149c9bd35..010e63eae6b 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/package-info.java +++ b/server/src/main/java/org/elasticsearch/snapshots/package-info.java @@ -20,7 +20,7 @@ /** *

This package exposes the Elasticsearch Snapshot functionality.

* - *

Preliminaries

+ *

Preliminaries

* *

There are two communication channels between all nodes and master in the snapshot functionality:

* * - *

Snapshot Creation

+ *

Snapshot Creation

*

Snapshots are created by the following sequence of events:

*
    *
  1. An invocation of {@link org.elasticsearch.snapshots.SnapshotsService#createSnapshot} enqueues a cluster state update to create @@ -68,7 +68,7 @@ *
  2. *
* - *

Deleting a Snapshot

+ *

Deleting a Snapshot

* *

Deleting a snapshot can take the form of either simply deleting it from the repository or (if it has not completed yet) aborting it * and subsequently deleting it from the repository.

diff --git a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy index fbfa0f39b16..415828b8a53 100644 --- a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy +++ b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy @@ -55,6 +55,8 @@ grant codeBase "${codebase.elasticsearch-plugin-classloader}" { //// Everything else: grant { + // needed by vendored Guice + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.annotation"; // checked by scripting engines, and before hacks and other issues in // third party code, to safeguard these against unprivileged code like scripts. diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/package-info.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/package-info.java index 9528df0332d..2a55be6e816 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/package-info.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/package-info.java @@ -13,14 +13,14 @@ * if possible, to one (at the moment) query DSL. Of course, this means * not all SQL queries are supported.
* - *

Premise

+ *

Premise

* Since Elasticsearch is not a database nor does it supports arbitrary * {@code JOIN}s (a cornerstone of SQL), SQL module is built from the * ground-up with Elasticsearch in mind first and SQL second. In fact, * even the grammar introduces Elasticsearch specific components that * have no concept in ANSI SQL. * - *

Architecture

+ *

Architecture

* SQL module is roughly based on the Volcano project (by Graefe * {@code &} co) * [1] @@ -53,7 +53,7 @@ * (to different degrees) by the majority of SQL engines out there such * as Apache Calcite, Apache Impala, Apache Spark and Facebook Presto. * - *

Concepts

+ *

Concepts

* * The building operation of the SQL engine is defined by an action, * namely a rule (defined in {@link org.elasticsearch.xpack.sql.rule rule} @@ -112,8 +112,8 @@ *
  • The Elasticsearch query gets executed
  • * * - *

    Digression - Visitors, pattern matching, {@code instanceof} and - * Java 10/11/12

    + *

    Digression - Visitors, pattern matching, {@code instanceof} and + * Java 10/11/12

    * * To implement the above concepts, several choices have been made in the * engine (which are not common in the rest of the XPack code base). In @@ -146,7 +146,7 @@ * {@link org.elasticsearch.xpack.sql.tree.Node#transformDown(java.util.function.Function, Class) * pre-order transformation}). * - *

    Components

    + *

    Components

    * * The SQL engine is made up of the following components: *