Skip to content

Commit 362d6fa

Browse files
committed
Merge branch 'master' into feature/extensible-values-source
Conflicts: server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java
2 parents a8a35dc + 445655f commit 362d6fa

File tree

1,238 files changed

+38691
-13977
lines changed

Some content is hidden

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

1,238 files changed

+38691
-13977
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ BWC_VERSION:
1616
- "7.5.2"
1717
- "7.5.3"
1818
- "7.6.0"
19+
- "7.7.0"
1920
- "8.0.0"

.ci/matrix-runtime-javas.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ES_RUNTIME_JAVA:
99
- java11
1010
- openjdk13
1111
- openjdk14
12+
- openjdk15
1213
- zulu11
1314
- corretto11
1415
- adoptopenjdk11

.eclipseformat.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
5252
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
5353
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
54-
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
54+
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/>
5555
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
5656
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
5757
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
@@ -101,7 +101,7 @@
101101
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_if_empty"/>
102102
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
103103
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
104-
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
104+
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
105105
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
106106
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
107107
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
@@ -286,7 +286,7 @@
286286
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
287287
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
288288
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
289-
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
289+
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="true"/>
290290
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
291291
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="48"/>
292292
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ JAVA
475475
ensure curl
476476
ensure unzip
477477
ensure rsync
478+
ensure expect
478479
479480
installed bats || {
480481
# Bats lives in a git repository....

buildSrc/build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,17 @@ class VersionPropertiesLoader {
273273
}
274274
elasticsearch += "-" + qualifier
275275
}
276-
if ("true".equals(systemProperties.getProperty("build.snapshot", "true"))) {
277-
elasticsearch += "-SNAPSHOT"
276+
final String buildSnapshotSystemProperty = systemProperties.getProperty("build.snapshot", "true");
277+
switch (buildSnapshotSystemProperty) {
278+
case "true":
279+
elasticsearch += "-SNAPSHOT"
280+
break;
281+
case "false":
282+
// do nothing
283+
break;
284+
default:
285+
throw new IllegalArgumentException(
286+
"build.snapshot was set to [" + buildSnapshotSystemProperty + "] but can only be unset or [true|false]");
278287
}
279288
loadedProps.put("elasticsearch", elasticsearch)
280289
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import org.elasticsearch.gradle.precommit.PrecommitTasks
3232
import org.elasticsearch.gradle.test.ErrorReportingTestListener
3333
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
3434
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
35+
import org.elasticsearch.gradle.testclusters.TestDistribution
3536
import org.elasticsearch.gradle.tool.Boilerplate
3637
import org.gradle.api.Action
3738
import org.gradle.api.GradleException
@@ -424,7 +425,7 @@ class BuildPlugin implements Plugin<Project> {
424425
dependencyNode.appendNode('groupId', dependency.group)
425426
dependencyNode.appendNode('artifactId', dependency.getDependencyProject().convention.getPlugin(BasePluginConvention).archivesBaseName)
426427
dependencyNode.appendNode('version', dependency.version)
427-
dependencyNode.appendNode('scope', 'runtime')
428+
dependencyNode.appendNode('scope', 'compile')
428429
}
429430
}
430431
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ class RestIntegTestTask extends DefaultTask {
4545
runner = project.tasks.create("${name}Runner", RestTestRunnerTask.class)
4646
super.dependsOn(runner)
4747

48-
project.testClusters {
49-
"$name" {
50-
javaHome = BuildParams.runtimeJavaHome
51-
}
52-
}
53-
runner.useCluster project.testClusters."$name"
48+
ElasticsearchCluster cluster = project.testClusters.create(name)
49+
runner.useCluster cluster
5450

5551
runner.include('**/*IT.class')
5652
runner.systemProperty('tests.rest.load_packaged', 'false')
@@ -60,7 +56,6 @@ class RestIntegTestTask extends DefaultTask {
6056
throw new IllegalArgumentException("tests.rest.cluster, tests.cluster, and tests.clustername must all be null or non-null")
6157
}
6258

63-
ElasticsearchCluster cluster = project.testClusters."${name}"
6459
runner.nonInputProperties.systemProperty('tests.rest.cluster', "${-> cluster.allHttpSocketURI.join(",")}")
6560
runner.nonInputProperties.systemProperty('tests.cluster', "${-> cluster.transportPortURI}")
6661
runner.nonInputProperties.systemProperty('tests.clustername', "${-> cluster.getName()}")

buildSrc/src/main/java/org/elasticsearch/GradleServicesAdapter.java

Lines changed: 0 additions & 84 deletions
This file was deleted.

buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
import java.util.concurrent.Callable;
4949
import java.util.function.Supplier;
5050

51+
import static org.elasticsearch.gradle.Util.capitalize;
52+
5153
/**
5254
* A plugin to manage getting and extracting distributions of Elasticsearch.
5355
*
@@ -309,10 +311,6 @@ private static String configName(String prefix, ElasticsearchDistribution distri
309311
);
310312
}
311313

312-
private static String capitalize(String s) {
313-
return s.substring(0, 1).toUpperCase(Locale.ROOT) + s.substring(1);
314-
}
315-
316314
private static String extractTaskName(ElasticsearchDistribution distribution) {
317315
String taskName = "extractElasticsearch";
318316
if (distribution.getType() != Type.INTEG_TEST_ZIP) {

buildSrc/src/main/java/org/elasticsearch/gradle/Jdk.java

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,41 @@
2020
package org.elasticsearch.gradle;
2121

2222
import org.gradle.api.Buildable;
23-
import org.gradle.api.Project;
2423
import org.gradle.api.artifacts.Configuration;
24+
import org.gradle.api.model.ObjectFactory;
2525
import org.gradle.api.provider.Property;
2626
import org.gradle.api.tasks.TaskDependency;
2727

2828
import java.io.File;
29-
import java.util.Arrays;
30-
import java.util.Collections;
3129
import java.util.Iterator;
3230
import java.util.List;
31+
import java.util.regex.Matcher;
3332
import java.util.regex.Pattern;
3433

3534
public class Jdk implements Buildable, Iterable<File> {
3635

3736
private static final List<String> ALLOWED_VENDORS = List.of("adoptopenjdk", "openjdk");
38-
static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?");
39-
private static final List<String> ALLOWED_PLATFORMS = Collections.unmodifiableList(Arrays.asList("darwin", "linux", "windows", "mac"));
37+
private static final List<String> ALLOWED_PLATFORMS = List.of("darwin", "linux", "windows", "mac");
38+
private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?");
39+
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?");
4040

4141
private final String name;
4242
private final Configuration configuration;
4343

4444
private final Property<String> vendor;
4545
private final Property<String> version;
4646
private final Property<String> platform;
47+
private String baseVersion;
48+
private String major;
49+
private String build;
50+
private String hash;
4751

48-
Jdk(String name, Project project) {
52+
Jdk(String name, Configuration configuration, ObjectFactory objectFactory) {
4953
this.name = name;
50-
this.configuration = project.getConfigurations().create("jdk_" + name);
51-
this.vendor = project.getObjects().property(String.class);
52-
this.version = project.getObjects().property(String.class);
53-
this.platform = project.getObjects().property(String.class);
54+
this.configuration = configuration;
55+
this.vendor = objectFactory.property(String.class);
56+
this.version = objectFactory.property(String.class);
57+
this.platform = objectFactory.property(String.class);
5458
}
5559

5660
public String getName() {
@@ -73,9 +77,10 @@ public String getVersion() {
7377
}
7478

7579
public void setVersion(String version) {
76-
if (VERSION_PATTERN.matcher(version).matches() == false) {
80+
if (VERSION_PATTERN.matcher(version).matches() == false && LEGACY_VERSION_PATTERN.matcher(version).matches() == false) {
7781
throw new IllegalArgumentException("malformed version [" + version + "] for jdk [" + name + "]");
7882
}
83+
parseVersion(version);
7984
this.version.set(version);
8085
}
8186

@@ -92,15 +97,30 @@ public void setPlatform(String platform) {
9297
this.platform.set(platform);
9398
}
9499

95-
// pkg private, for internal use
96-
Configuration getConfiguration() {
97-
return configuration;
100+
public String getBaseVersion() {
101+
return baseVersion;
102+
}
103+
104+
public String getMajor() {
105+
return major;
106+
}
107+
108+
public String getBuild() {
109+
return build;
110+
}
111+
112+
public String getHash() {
113+
return hash;
98114
}
99115

100116
public String getPath() {
101117
return configuration.getSingleFile().toString();
102118
}
103119

120+
public String getConfigurationName() {
121+
return configuration.getName();
122+
}
123+
104124
@Override
105125
public String toString() {
106126
return getPath();
@@ -143,4 +163,23 @@ public Iterator<File> iterator() {
143163
return configuration.iterator();
144164
}
145165

166+
private void parseVersion(String version) {
167+
// decompose the bundled jdk version, broken into elements as: [feature, interim, update, build]
168+
// Note the "patch" version is not yet handled here, as it has not yet been used by java.
169+
Matcher jdkVersionMatcher = VERSION_PATTERN.matcher(version);
170+
if (jdkVersionMatcher.matches() == false) {
171+
// Try again with the pre-Java9 version format
172+
jdkVersionMatcher = LEGACY_VERSION_PATTERN.matcher(version);
173+
174+
if (jdkVersionMatcher.matches() == false) {
175+
throw new IllegalArgumentException("Malformed jdk version [" + version + "]");
176+
}
177+
}
178+
179+
baseVersion = jdkVersionMatcher.group(1) + (jdkVersionMatcher.group(2) != null ? (jdkVersionMatcher.group(2)) : "");
180+
major = jdkVersionMatcher.group(1);
181+
build = jdkVersionMatcher.group(3);
182+
hash = jdkVersionMatcher.group(5);
183+
}
184+
146185
}

0 commit comments

Comments
 (0)