Skip to content

Commit dcddd25

Browse files
Merge branch 'master' into repository-encrypted-client-side
2 parents 0888442 + 400cfe2 commit dcddd25

File tree

2,534 files changed

+76070
-24163
lines changed

Some content is hidden

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

2,534 files changed

+76070
-24163
lines changed

.ci/dockerOnLinuxExclusions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# (as is the case on centos-6, for example) then that OS will again be
66
# excluded.
77
debian-8
8-
opensuse-15-1
8+
opensuse-leap-15.1
99
ol-7.7
1010
sles-12.3 # older version used in Vagrant image
1111
sles-12.5

.ci/java-versions.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# build and test Elasticsearch for this branch. Valid Java versions
55
# are 'java' or 'openjdk' followed by the major release number.
66

7-
ES_BUILD_JAVA=openjdk13
7+
ES_BUILD_JAVA=openjdk14
88
ES_RUNTIME_JAVA=openjdk11
99
GRADLE_TASK=build

.ci/jobs.t/defaults.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
JAVA11_HOME=$HOME/.java/java11
5050
JAVA12_HOME=$HOME/.java/openjdk12
5151
JAVA13_HOME=$HOME/.java/openjdk13
52+
JAVA14_HOME=$HOME/.java/openjdk14
5253
GRADLE_OPTS=-XX:+HeapDumpOnOutOfMemoryError -Xmx128m -Xms128m
5354
properties:
5455
- github:

.ci/packer_cache.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export JAVA8_HOME="${HOME}"/.java/java8
2222
export JAVA11_HOME="${HOME}"/.java/java11
2323
export JAVA12_HOME="${HOME}"/.java/openjdk12
2424
export JAVA13_HOME="${HOME}"/.java/openjdk13
25+
export JAVA14_HOME="${HOME}"/.java/openjdk14
2526
./gradlew --parallel clean -s resolveAllDependencies
2627

.idea/runConfigurations/Debug_Elasticsearch.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ Contributing to the Elasticsearch codebase
9292

9393
**Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch)
9494

95-
JDK 13 is required to build Elasticsearch. You must have a JDK 13 installation
95+
JDK 14 is required to build Elasticsearch. You must have a JDK 14 installation
9696
with the environment variable `JAVA_HOME` referencing the path to Java home for
97-
your JDK 13 installation. By default, tests use the same runtime as `JAVA_HOME`.
97+
your JDK 14 installation. By default, tests use the same runtime as `JAVA_HOME`.
9898
However, since Elasticsearch supports JDK 11, the build supports compiling with
99-
JDK 13 and testing on a JDK 11 runtime; to do this, set `RUNTIME_JAVA_HOME`
99+
JDK 14 and testing on a JDK 11 runtime; to do this, set `RUNTIME_JAVA_HOME`
100100
pointing to the Java home of a JDK 11 installation. Note that this mechanism can
101101
be used to test against other JDKs as well, this is not only limited to JDK 11.
102102

@@ -109,8 +109,7 @@ script on Windows in the root of the repository. The examples below show the
109109
usage on Unix.
110110

111111
We support development in IntelliJ versions IntelliJ 2019.2 and
112-
onwards. We would like to support Eclipse, but few of us use it and has fallen
113-
into [disrepair][eclipse].
112+
onwards and Eclipse 2020-3 and onwards.
114113

115114
[Docker](https://docs.docker.com/install/) is required for building some Elasticsearch artifacts and executing certain test suites. You can run Elasticsearch without building all the artifacts with:
116115

@@ -122,9 +121,9 @@ You can access Elasticsearch with:
122121

123122
### Importing the project into IntelliJ IDEA
124123

125-
Elasticsearch builds using Java 13. When importing into IntelliJ you will need
124+
Elasticsearch builds using Java 14. When importing into IntelliJ you will need
126125
to define an appropriate SDK. The convention is that **this SDK should be named
127-
"13"** so that the project import will detect it automatically. For more details
126+
"14"** so that the project import will detect it automatically. For more details
128127
on defining an SDK in IntelliJ please refer to [their documentation](https://www.jetbrains.com/help/idea/sdk.html#define-sdk).
129128
SDK definitions are global, so you can add the JDK from any project, or after
130129
project import. Importing with a missing JDK will still work, IntelliJ will
@@ -136,6 +135,62 @@ You can import the Elasticsearch project into IntelliJ IDEA via:
136135
- In the subsequent dialog navigate to the root `build.gradle` file
137136
- In the subsequent dialog select **Open as Project**
138137

138+
### Importing the project into Eclipse
139+
140+
Elasticsearch builds using Gradle and Java 13. When importing into Eclipse you
141+
will either need to use an appropriate JDK to run Eclipse itself (e.g. by
142+
specifying the VM in [eclipse.ini](https://wiki.eclipse.org/Eclipse.ini) or by
143+
defining the JDK Gradle uses by setting **Prefercences** > **Gradle** >
144+
**Advanced Options** > **Java home** to an appropriate version.
145+
146+
IMPORTANT: If you have previously imported the project by running `./gradlew eclipse`
147+
then you must build an entirely new workspace and `git clean -xdf` to
148+
blow away *everything* that the gradle eclipse plugin made.
149+
150+
- Select **File > Import...**
151+
- Select **Existing Gradle Project**
152+
- Select **Next** then **Next** again
153+
- Set the **Project root directory** to the root of your elasticsearch clone
154+
- Click **Finish**
155+
156+
This will spin for a long, long time but you'll see many errors about circular
157+
dependencies. Fix them:
158+
159+
- Select **Window > Preferences**
160+
- Select **Java > Compiler > Building**
161+
- Look under **Build Path Problems**
162+
- Set **Circular dependencies** to **Warning**
163+
- Apply that and let the build spin away for a while
164+
165+
Next you'll want to import our auto-formatter:
166+
167+
- Select **Window > Preferences**
168+
- Select **Java > Code Style > Formater**
169+
- Click **Import**
170+
- Import the file at **buildSrc/formatterConfig.xml**
171+
- Make sure it is the **Active profile**
172+
173+
Finally, set up import order:
174+
175+
- Select **Window > Preferences**
176+
- Select **Java > Code Style > Organize Imports**
177+
- Click **Import...**
178+
- Import the file at **buildSrc/elastic.importorder**
179+
- Set the **Number of imports needed for `.*`** to ***9999***
180+
- Set the **Number of static imports needed for `.*`** to ***9999*** as well
181+
- Apply that
182+
183+
IMPORTANT: There is an option in **Gradle** for **Automatic Project Synchronization**.
184+
As convenient as it'd be for the projects to always be perfect this
185+
tends to add many many seconds to every branch change. Instead, you
186+
should manually right click on a project and
187+
**Gradle > Refresh Gradle Project** if the configuration is out of
188+
date.
189+
190+
As we add more subprojects you might have to re-import the gradle project (the
191+
first step) again. There is no need to blow away the existing projects before
192+
doing that.
193+
139194
### REST Endpoint Conventions
140195

141196
Elasticsearch typically uses singular nouns rather than plurals in URLs.
@@ -551,4 +606,3 @@ non-documentation contribution. This is mentioned above, but it is worth
551606
repeating in this section because it has come up in this context.
552607

553608
[intellij]: https://blog.jetbrains.com/idea/2017/07/intellij-idea-2017-2-is-here-smart-sleek-and-snappy/
554-
[eclipse]: https://github.com/elastic/elasticsearch/issues/53664

Vagrantfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ end
329329

330330
def sles_common(config, name)
331331
extra = <<-SHELL
332-
zypper rr systemsmanagement_puppet puppetlabs-pc1
332+
zypper rr systemsmanagement_puppet puppetlabs-pc1 devel_tools_scm
333+
zypper ar http://download.opensuse.org/distribution/12.3/repo/oss/ oss
334+
zypper --non-interactive --gpg-auto-import-keys refresh
333335
zypper --non-interactive install git-core
336+
# choose to "ignore some dependencies" of expect, which has a problem with tcl...
337+
zypper --non-interactive install --force-resolution expect
334338
SHELL
335339
suse_common config, name, extra: extra
336340
end

benchmarks/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ compileJava.options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generato
4848
run.executable = "${BuildParams.runtimeJavaHome}/bin/java"
4949

5050
// classes generated by JMH can use all sorts of forbidden APIs but we have no influence at all and cannot exclude these classes
51-
forbiddenApisMain.enabled = false
51+
disableTasks('forbiddenApisMain')
5252

5353
// No licenses for our benchmark deps (we don't ship benchmarks)
5454
dependencyLicenses.enabled = false

benchmarks/src/main/java/org/elasticsearch/benchmark/routing/allocation/Allocators.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,21 @@ private static class NoopGatewayAllocator extends GatewayAllocator {
4747
public static final NoopGatewayAllocator INSTANCE = new NoopGatewayAllocator();
4848

4949
@Override
50-
public void applyStartedShards(RoutingAllocation allocation, List<ShardRouting> startedShards) {
50+
public void applyStartedShards(List<ShardRouting> startedShards, RoutingAllocation allocation) {
5151
// noop
5252
}
5353

5454
@Override
55-
public void applyFailedShards(RoutingAllocation allocation, List<FailedShard> failedShards) {
55+
public void applyFailedShards(List<FailedShard> failedShards, RoutingAllocation allocation) {
5656
// noop
5757
}
5858

5959
@Override
60-
public void allocateUnassigned(RoutingAllocation allocation) {
60+
public void allocateUnassigned(
61+
ShardRouting shardRouting,
62+
RoutingAllocation allocation,
63+
UnassignedAllocationHandler unassignedAllocationHandler
64+
) {
6165
// noop
6266
}
6367
}

build.gradle

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import org.elasticsearch.gradle.BuildPlugin
2525
import org.elasticsearch.gradle.BwcVersions
2626
import org.elasticsearch.gradle.Version
2727
import org.elasticsearch.gradle.VersionProperties
28+
import org.elasticsearch.gradle.info.BuildParams
2829
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
2930
import org.gradle.plugins.ide.eclipse.model.AccessRule
3031
import org.gradle.plugins.ide.eclipse.model.SourceFolder
@@ -37,10 +38,9 @@ plugins {
3738
id 'lifecycle-base'
3839
id 'elasticsearch.docker-support'
3940
id 'elasticsearch.global-build-info'
40-
id "com.diffplug.gradle.spotless" version "3.24.2" apply false
41+
id "com.diffplug.gradle.spotless" version "3.28.0" apply false
4142
}
4243

43-
apply plugin: 'nebula.info-scm'
4444
apply from: 'gradle/build-scan.gradle'
4545
apply from: 'gradle/build-complete.gradle'
4646
apply from: 'gradle/runtime-jdk-provision.gradle'
@@ -59,7 +59,7 @@ BuildPlugin.configureRepositories(project)
5959

6060
String licenseCommit
6161
if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) {
62-
licenseCommit = scminfo.change ?: "master" // leniency for non git builds
62+
licenseCommit = BuildParams.gitRevision ?: "master" // leniency for non git builds
6363
} else {
6464
licenseCommit = "v${version}"
6565
}
@@ -405,6 +405,14 @@ class Run extends DefaultTask {
405405
public void setDataDir(String dataDirStr) {
406406
project.project(':distribution').run.dataDir = dataDirStr
407407
}
408+
409+
@Option(
410+
option = "keystore-password",
411+
description = "Set the elasticsearch keystore password"
412+
)
413+
public void setKeystorePassword(String password) {
414+
project.project(':distribution').run.keystorePassword = password
415+
}
408416
}
409417

410418
task run(type: Run) {
@@ -518,3 +526,11 @@ subprojects {
518526
}
519527
}
520528
}
529+
530+
subprojects {
531+
project.ext.disableTasks = { String... tasknames ->
532+
for (String taskname : tasknames) {
533+
project.tasks.named(taskname).configure { onlyIf { false } }
534+
}
535+
}
536+
}

buildSrc/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,14 @@ dependencies {
114114

115115
compile 'com.netflix.nebula:gradle-extra-configurations-plugin:3.0.3'
116116
compile 'com.netflix.nebula:nebula-publishing-plugin:4.4.4'
117-
compile 'com.netflix.nebula:gradle-info-plugin:5.1.0'
118-
compile 'org.eclipse.jgit:org.eclipse.jgit:5.5.0.201909110433-r'
119-
compile 'com.netflix.nebula:gradle-info-plugin:3.0.3'
120-
compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE....
117+
compile 'com.netflix.nebula:gradle-info-plugin:7.1.3'
121118
compile 'org.apache.rat:apache-rat:0.11'
122119
compile "org.elasticsearch:jna:4.5.1"
123120
compile 'com.github.jengelman.gradle.plugins:shadow:5.1.0'
124121
compile 'de.thetaphi:forbiddenapis:2.7'
125122
compile 'com.avast.gradle:gradle-docker-compose-plugin:0.8.12'
123+
compile 'org.apache.maven:maven-model:3.6.2'
124+
compile 'com.networknt:json-schema-validator:1.0.36'
126125
compileOnly "com.puppycrawl.tools:checkstyle:${props.getProperty('checkstyle')}"
127126
testCompile "com.puppycrawl.tools:checkstyle:${props.getProperty('checkstyle')}"
128127
testCompile "junit:junit:${props.getProperty('junit')}"
@@ -161,17 +160,14 @@ if (project == rootProject) {
161160
if (project != rootProject) {
162161
apply plugin: 'elasticsearch.build'
163162
apply plugin: 'nebula.maven-base-publish'
164-
apply plugin: 'nebula.maven-scm'
165163

166164
// groovydoc succeeds, but has some weird internal exception...
167165
groovydoc.enabled = false
168166

169167
// build-tools is not ready for primetime with these...
170168
dependencyLicenses.enabled = false
171169
dependenciesInfo.enabled = false
172-
forbiddenApisMain.enabled = false
173-
forbiddenApisMinimumRuntime.enabled = false
174-
forbiddenApisTest.enabled = false
170+
disableTasks('forbiddenApisMain', 'forbiddenApisMinimumRuntime', 'forbiddenApisTest')
175171
jarHell.enabled = false
176172
thirdPartyAudit.enabled = false
177173
if (Boolean.parseBoolean(System.getProperty("tests.fips.enabled"))){

buildSrc/elastic.importorder

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Eclipse configuration for import order for Elasticsearch
2+
0=
3+
1=com
4+
2=org
5+
3=java
6+
4=javax
7+
5=\#

0 commit comments

Comments
 (0)