Skip to content

Commit 410e28f

Browse files
committed
Merge branch 'master' into long_sort_optimization
2 parents 567a739 + c171f9a commit 410e28f

File tree

923 files changed

+12646
-8871
lines changed

Some content is hidden

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

923 files changed

+12646
-8871
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.cluster.ClusterModule;
2323
import org.elasticsearch.cluster.EmptyClusterInfoService;
2424
import org.elasticsearch.cluster.node.DiscoveryNode;
25+
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
2526
import org.elasticsearch.cluster.routing.ShardRouting;
2627
import org.elasticsearch.cluster.routing.allocation.AllocationService;
2728
import org.elasticsearch.cluster.routing.allocation.FailedShard;
@@ -92,7 +93,7 @@ public static AllocationDeciders defaultAllocationDeciders(Settings settings, Cl
9293

9394
public static DiscoveryNode newNode(String nodeId, Map<String, String> attributes) {
9495
return new DiscoveryNode("", nodeId, new TransportAddress(TransportAddress.META_ADDRESS,
95-
portGenerator.incrementAndGet()), attributes, Sets.newHashSet(DiscoveryNode.Role.MASTER,
96-
DiscoveryNode.Role.DATA), Version.CURRENT);
96+
portGenerator.incrementAndGet()), attributes, Sets.newHashSet(DiscoveryNodeRole.MASTER_ROLE,
97+
DiscoveryNodeRole.DATA_ROLE), Version.CURRENT);
9798
}
9899
}

buildSrc/build.gradle

+31-6
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,26 @@ if (JavaVersion.current() < JavaVersion.VERSION_11) {
6767
}
6868

6969
// Keep compatibility with Java 8 for external users of build-tools that haven't migrated to Java 11
70-
targetCompatibility = '8'
71-
sourceCompatibility = '8'
70+
targetCompatibility = '11'
71+
sourceCompatibility = '11'
72+
73+
sourceSets {
74+
// We have a few classes that need to be compiled for older java versions
75+
minimumRuntime { }
76+
}
77+
78+
compileMinimumRuntimeJava {
79+
targetCompatibility = 8
80+
sourceCompatibility = 8
81+
}
82+
83+
jar {
84+
from sourceSets.minimumRuntime.output
85+
}
86+
87+
javadoc {
88+
source sourceSets.minimumRuntime.allSource
89+
}
7290

7391
/*****************************************************************************
7492
* Dependencies used by the entire build *
@@ -79,8 +97,15 @@ repositories {
7997
}
8098

8199
dependencies {
100+
if (project.ext.has("isEclipse") == false || project.ext.isEclipse == false) {
101+
// eclipse is confused if this is set explicitly
102+
compile sourceSets.minimumRuntime.output
103+
}
104+
82105
compile localGroovy()
83106

107+
compile 'commons-codec:commons-codec:1.12'
108+
84109
compile 'com.netflix.nebula:gradle-extra-configurations-plugin:3.0.3'
85110
compile 'com.netflix.nebula:nebula-publishing-plugin:4.4.4'
86111
compile 'com.netflix.nebula:gradle-info-plugin:3.0.3'
@@ -94,6 +119,9 @@ dependencies {
94119
testCompile "junit:junit:${props.getProperty('junit')}"
95120
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}"
96121
testCompile 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2'
122+
minimumRuntimeCompile "junit:junit:${props.getProperty('junit')}"
123+
minimumRuntimeCompile localGroovy()
124+
minimumRuntimeCompile gradleApi()
97125
}
98126

99127
/*****************************************************************************
@@ -121,17 +149,14 @@ if (project != rootProject) {
121149
apply plugin: 'nebula.maven-base-publish'
122150
apply plugin: 'nebula.maven-scm'
123151

124-
// we need to apply these again to override the build plugin
125-
targetCompatibility = "10"
126-
sourceCompatibility = "10"
127-
128152
// groovydoc succeeds, but has some weird internal exception...
129153
groovydoc.enabled = false
130154

131155
// build-tools is not ready for primetime with these...
132156
dependencyLicenses.enabled = false
133157
dependenciesInfo.enabled = false
134158
forbiddenApisMain.enabled = false
159+
forbiddenApisMinimumRuntime.enabled = false
135160
forbiddenApisTest.enabled = false
136161
jarHell.enabled = false
137162
thirdPartyAudit.enabled = false

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

+28-22
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import org.elasticsearch.gradle.precommit.DependencyLicensesTask
3333
import org.elasticsearch.gradle.precommit.PrecommitTasks
3434
import org.elasticsearch.gradle.test.ErrorReportingTestListener
3535
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
36+
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
3637
import org.gradle.api.Action
3738
import org.gradle.api.GradleException
3839
import org.gradle.api.InvalidUserDataException
@@ -99,13 +100,17 @@ class BuildPlugin implements Plugin<Project> {
99100
project.rootProject.pluginManager.apply(GlobalBuildInfoPlugin)
100101

101102
if (project.pluginManager.hasPlugin('elasticsearch.standalone-rest-test')) {
102-
throw new InvalidUserDataException('elasticsearch.standalone-test, '
103-
+ 'elasticsearch.standalone-rest-test, and elasticsearch.build '
104-
+ 'are mutually exclusive')
103+
throw new InvalidUserDataException('elasticsearch.standalone-test, '
104+
+ 'elasticsearch.standalone-rest-test, and elasticsearch.build '
105+
+ 'are mutually exclusive')
105106
}
106107
String minimumGradleVersion = null
107108
InputStream is = getClass().getResourceAsStream("/minimumGradleVersion")
108-
try { minimumGradleVersion = IOUtils.toString(is, StandardCharsets.UTF_8.toString()) } finally { is.close() }
109+
try {
110+
minimumGradleVersion = IOUtils.toString(is, StandardCharsets.UTF_8.toString())
111+
} finally {
112+
is.close()
113+
}
109114
if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion.trim())) {
110115
throw new GradleException(
111116
"Gradle ${minimumGradleVersion}+ is required to use elasticsearch.build plugin"
@@ -139,31 +144,32 @@ class BuildPlugin implements Plugin<Project> {
139144
configurePrecommit(project)
140145
configureDependenciesInfo(project)
141146

142-
// Common config when running with a FIPS-140 runtime JVM
147+
148+
configureFips140(project)
149+
}
150+
151+
public static void configureFips140(Project project) {
143152
// Need to do it here to support external plugins
144-
if (project == project.rootProject) {
145-
GlobalInfoExtension globalInfo = project.extensions.getByType(GlobalInfoExtension)
146-
147-
// wait until global info is populated because we don't know if we are running in a fips jvm until execution time
148-
globalInfo.ready {
149-
project.subprojects { Project subproject ->
150-
ExtraPropertiesExtension ext = subproject.extensions.getByType(ExtraPropertiesExtension)
151-
// Common config when running with a FIPS-140 runtime JVM
152-
if (ext.has('inFipsJvm') && ext.get('inFipsJvm')) {
153-
subproject.tasks.withType(Test) { Test task ->
154-
task.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
155-
task.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
156-
}
157-
project.pluginManager.withPlugin("elasticsearch.testclusters") {
158-
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = subproject.extensions.getByName('testClusters') as NamedDomainObjectContainer<ElasticsearchCluster>
153+
GlobalInfoExtension globalInfo = project.rootProject.extensions.getByType(GlobalInfoExtension)
154+
// wait until global info is populated because we don't know if we are running in a fips jvm until execution time
155+
globalInfo.ready {
156+
ExtraPropertiesExtension ext = project.extensions.getByType(ExtraPropertiesExtension)
157+
// Common config when running with a FIPS-140 runtime JVM
158+
if (ext.has('inFipsJvm') && ext.get('inFipsJvm')) {
159+
project.tasks.withType(Test) { Test task ->
160+
task.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
161+
task.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
162+
}
163+
project.pluginManager.withPlugin("elasticsearch.testclusters") {
164+
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = project.extensions.findByName(TestClustersPlugin.EXTENSION_NAME) as NamedDomainObjectContainer<ElasticsearchCluster>
165+
if (testClusters != null) {
159166
testClusters.all { ElasticsearchCluster cluster ->
160167
cluster.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
161168
cluster.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
162169
}
163170
}
164171
}
165172
}
166-
}
167173
}
168174
}
169175

@@ -260,7 +266,7 @@ class BuildPlugin implements Plugin<Project> {
260266
}
261267

262268
protected static void checkDockerVersionRecent(String dockerVersion) {
263-
final Matcher matcher = dockerVersion =~ /Docker version (\d+\.\d+)\.\d+(?:-ce)?, build [0-9a-f]{7,40}/
269+
final Matcher matcher = dockerVersion =~ /Docker version (\d+\.\d+)\.\d+(?:-[a-zA-Z0-9]+)?, build [0-9a-f]{7,40}/
264270
assert matcher.matches(): dockerVersion
265271
final dockerMajorMinorVersion = matcher.group(1)
266272
final String[] majorMinor = dockerMajorMinorVersion.split("\\.")

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class SnippetsTask extends DefaultTask {
4343
private static final String SKIP = /skip:([^\]]+)/
4444
private static final String SETUP = /setup:([^ \]]+)/
4545
private static final String WARNING = /warning:(.+)/
46-
private static final String CAT = /(_cat)/
46+
private static final String NON_JSON = /(non_json)/
4747
private static final String TEST_SYNTAX =
4848
/(?:$CATCH|$SUBSTITUTION|$SKIP|(continued)|$SETUP|$WARNING|(skip_shard_failures)) ?/
4949

@@ -255,12 +255,12 @@ public class SnippetsTask extends DefaultTask {
255255
substitutions = []
256256
}
257257
String loc = "$file:$lineNumber"
258-
parse(loc, matcher.group(2), /(?:$SUBSTITUTION|$CAT|$SKIP) ?/) {
258+
parse(loc, matcher.group(2), /(?:$SUBSTITUTION|$NON_JSON|$SKIP) ?/) {
259259
if (it.group(1) != null) {
260260
// TESTRESPONSE[s/adsf/jkl/]
261261
substitutions.add([it.group(1), it.group(2)])
262262
} else if (it.group(3) != null) {
263-
// TESTRESPONSE[_cat]
263+
// TESTRESPONSE[non_json]
264264
substitutions.add(['^', '/'])
265265
substitutions.add(['\n$', '\\\\s*/'])
266266
substitutions.add(['( +)', '$1\\\\s+'])

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginPropertiesExtension.groovy

-90
This file was deleted.

0 commit comments

Comments
 (0)