Skip to content

Commit 5fa2ab4

Browse files
committed
Merge branch 'master' into remove_thread_barrier
2 parents 5988b4b + 4ec3a6d commit 5fa2ab4

File tree

542 files changed

+8114
-7562
lines changed

Some content is hidden

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

542 files changed

+8114
-7562
lines changed

TESTING.asciidoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In order to start with a different distribution use the `-Drun.distribution` arg
4242
To for example start the open source distribution:
4343

4444
-------------------------------------
45-
./gradlew run -Drun.distribution=oss-zip
45+
./gradlew run -Drun.distribution=oss
4646
-------------------------------------
4747

4848
==== License type
@@ -631,3 +631,13 @@ inside `/etc/hosts`, e.g.:
631631
255.255.255.255 broadcasthost
632632
::1 localhost ElasticMBP.local`
633633
....
634+
635+
== Benchmarking
636+
637+
For changes that might affect the performance characteristics of Elasticsearch
638+
you should also run macrobenchmarks. We maintain a macrobenchmarking tool
639+
called https://github.com/elastic/rally[Rally]
640+
which you can use to measure the performance impact. It comes with a set of
641+
default benchmarks that we also
642+
https://elasticsearch-benchmarks.elastic.co/[run every night]. To get started,
643+
please see https://esrally.readthedocs.io/en/stable/[Rally's documentation].

benchmarks/src/main/java/org/elasticsearch/benchmark/time/DateFormatterBenchmark.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ public TemporalAccessor parseJodaDate() {
5555
return jodaFormatter.parse("1234567890");
5656
}
5757
}
58-

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class BuildPlugin implements Plugin<Project> {
392392
static void requireJavaHome(Task task, int version) {
393393
Project rootProject = task.project.rootProject // use root project for global accounting
394394
if (rootProject.hasProperty('requiredJavaVersions') == false) {
395-
rootProject.rootProject.ext.requiredJavaVersions = [:].withDefault{key -> return []}
395+
rootProject.rootProject.ext.requiredJavaVersions = [:]
396396
rootProject.gradle.taskGraph.whenReady { TaskExecutionGraph taskGraph ->
397397
List<String> messages = []
398398
for (entry in rootProject.requiredJavaVersions) {
@@ -415,7 +415,7 @@ class BuildPlugin implements Plugin<Project> {
415415
throw new GradleException("JAVA${version}_HOME required to run task:\n${task}")
416416
}
417417
} else {
418-
rootProject.requiredJavaVersions.get(version).add(task)
418+
rootProject.requiredJavaVersions.getOrDefault(version, []).add(task)
419419
}
420420
}
421421

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class DocsTestPlugin extends RestTestPlugin {
3434
project.pluginManager.apply('elasticsearch.standalone-rest-test')
3535
super.apply(project)
3636
// The distribution can be configured with -Dtests.distribution on the command line
37-
project.integTestCluster.distribution = System.getProperty('tests.distribution', 'zip')
37+
project.integTestCluster.distribution = System.getProperty('tests.distribution', 'default')
3838
// Docs are published separately so no need to assemble
3939
project.tasks.assemble.enabled = false
4040
Map<String, String> defaultSubstitutions = [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ClusterConfiguration {
2929
private final Project project
3030

3131
@Input
32-
String distribution = 'zip'
32+
String distribution = 'default'
3333

3434
@Input
3535
int numNodes = 1

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

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import org.elasticsearch.gradle.plugin.PluginPropertiesExtension
2929
import org.gradle.api.AntBuilder
3030
import org.gradle.api.DefaultTask
3131
import org.gradle.api.GradleException
32-
import org.gradle.api.InvalidUserDataException
3332
import org.gradle.api.Project
3433
import org.gradle.api.Task
3534
import org.gradle.api.artifacts.Configuration
@@ -87,7 +86,7 @@ class ClusterFormationTasks {
8786
Configuration currentDistro = project.configurations.create("${prefix}_elasticsearchDistro")
8887
Configuration bwcDistro = project.configurations.create("${prefix}_elasticsearchBwcDistro")
8988
Configuration bwcPlugins = project.configurations.create("${prefix}_elasticsearchBwcPlugins")
90-
if (System.getProperty('tests.distribution', 'oss-zip') == 'integ-test-zip') {
89+
if (System.getProperty('tests.distribution', 'oss') == 'integ-test-zip') {
9190
throw new Exception("tests.distribution=integ-test-zip is not supported")
9291
}
9392
configureDistributionDependency(project, config.distribution, currentDistro, VersionProperties.elasticsearch)
@@ -172,31 +171,31 @@ class ClusterFormationTasks {
172171

173172
/** Adds a dependency on the given distribution */
174173
static void configureDistributionDependency(Project project, String distro, Configuration configuration, String elasticsearchVersion) {
174+
// TEMP HACK
175+
// The oss docs CI build overrides the distro on the command line. This hack handles backcompat until CI is updated.
176+
if (distro.equals('oss-zip')) {
177+
distro = 'oss'
178+
}
179+
if (distro.equals('zip')) {
180+
distro = 'default'
181+
}
182+
// END TEMP HACK
183+
if (['integ-test-zip', 'oss', 'default'].contains(distro) == false) {
184+
throw new GradleException("Unknown distribution: ${distro} in project ${project.path}")
185+
}
175186
Version version = Version.fromString(elasticsearchVersion)
176187
if (version.before('6.3.0') && distro.startsWith('oss-')) {
177188
distro = distro.substring('oss-'.length())
178189
}
179-
String os = "linux"
180-
if (Os.FAMILY_WINDOWS) {
181-
os = "windows"
182-
} else if (Os.FAMILY_MAC) {
183-
os = "darwin"
184-
}
185-
String packaging = distro
186-
if (distro.contains('tar')) {
187-
packaging = 'tar.gz'\
188-
} else if (distro.contains('zip')) {
189-
packaging = 'zip'
190-
}
191-
String group = "downloads.${packaging}"
190+
String group = "downloads.zip"
192191
if (distro.equals("integ-test-zip")) {
193192
group = "org.elasticsearch.distribution.integ-test-zip"
194193
}
195194
String artifactName = 'elasticsearch'
196-
if (distro.contains('oss')) {
195+
if (distro.equals('oss') && Version.fromString(elasticsearchVersion).onOrAfter('6.3.0')) {
197196
artifactName += '-oss'
198197
}
199-
project.dependencies.add(configuration.name, "${group}:${artifactName}:${elasticsearchVersion}@${packaging}")
198+
project.dependencies.add(configuration.name, "${group}:${artifactName}:${elasticsearchVersion}@zip")
200199
}
201200

202201
/** Adds a dependency on a different version of the given plugin, which will be retrieved using gradle's dependency resolution */
@@ -319,31 +318,13 @@ class ClusterFormationTasks {
319318
elasticsearch source tree. If this is a plugin built in the elasticsearch source tree or this is a distro in
320319
the elasticsearch source tree then this should be the version of elasticsearch built by the source tree.
321320
If it isn't then Bad Things(TM) will happen. */
322-
Task extract
323-
324-
switch (node.config.distribution) {
325-
case 'integ-test-zip':
326-
case 'zip':
327-
case 'oss-zip':
328-
extract = project.tasks.create(name: name, type: Copy, dependsOn: extractDependsOn) {
329-
from {
330-
project.zipTree(configuration.singleFile)
331-
}
332-
into node.baseDir
333-
}
334-
break;
335-
case 'tar':
336-
case 'oss-tar':
337-
extract = project.tasks.create(name: name, type: Copy, dependsOn: extractDependsOn) {
338-
from {
339-
project.tarTree(project.resources.gzip(configuration.singleFile))
340-
}
341-
into node.baseDir
342-
}
343-
break;
344-
default:
345-
throw new InvalidUserDataException("Unknown distribution: ${node.config.distribution}")
321+
Task extract = project.tasks.create(name: name, type: Copy, dependsOn: extractDependsOn) {
322+
from {
323+
project.zipTree(configuration.singleFile)
324+
}
325+
into node.baseDir
346326
}
327+
347328
return extract
348329
}
349330

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

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ import org.gradle.api.Project
2929
import java.nio.file.Files
3030
import java.nio.file.Path
3131
import java.nio.file.Paths
32-
33-
import static org.elasticsearch.gradle.BuildPlugin.getJavaHome
34-
3532
/**
3633
* A container for the files and configuration associated with a single node in a test cluster.
3734
*/
@@ -125,8 +122,8 @@ class NodeInfo {
125122
baseDir = new File(project.buildDir, "cluster/${prefix} node${nodeNum}")
126123
pidFile = new File(baseDir, 'es.pid')
127124
this.nodeVersion = Version.fromString(nodeVersion)
128-
homeDir = homeDir(baseDir, config.distribution, nodeVersion)
129-
pathConf = pathConf(baseDir, config.distribution, nodeVersion)
125+
homeDir = new File(baseDir, "elasticsearch-${nodeVersion}")
126+
pathConf = new File(homeDir, 'config')
130127
if (config.dataDir != null) {
131128
dataDir = "${config.dataDir(nodeNum)}"
132129
} else {
@@ -299,41 +296,4 @@ class NodeInfo {
299296
}
300297
return dataDir
301298
}
302-
303-
/** Returns the directory elasticsearch home is contained in for the given distribution */
304-
static File homeDir(File baseDir, String distro, String nodeVersion) {
305-
String path
306-
switch (distro) {
307-
case 'integ-test-zip':
308-
case 'zip':
309-
case 'tar':
310-
case 'oss-zip':
311-
case 'oss-tar':
312-
path = "elasticsearch-${nodeVersion}"
313-
break
314-
case 'rpm':
315-
case 'deb':
316-
path = "${distro}-extracted/usr/share/elasticsearch"
317-
break
318-
default:
319-
throw new InvalidUserDataException("Unknown distribution: ${distro}")
320-
}
321-
return new File(baseDir, path)
322-
}
323-
324-
static File pathConf(File baseDir, String distro, String nodeVersion) {
325-
switch (distro) {
326-
case 'integ-test-zip':
327-
case 'zip':
328-
case 'oss-zip':
329-
case 'tar':
330-
case 'oss-tar':
331-
return new File(homeDir(baseDir, distro, nodeVersion), 'config')
332-
case 'rpm':
333-
case 'deb':
334-
return new File(baseDir, "${distro}-extracted/etc/elasticsearch")
335-
default:
336-
throw new InvalidUserDataException("Unknown distribution: ${distro}")
337-
}
338-
}
339299
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class RunTask extends DefaultTask {
1616
clusterConfig.httpPort = 9200
1717
clusterConfig.transportPort = 9300
1818
clusterConfig.daemonize = false
19-
clusterConfig.distribution = 'zip'
19+
clusterConfig.distribution = 'default'
2020
project.afterEvaluate {
2121
ClusterFormationTasks.setup(project, name, this, clusterConfig)
2222
}

buildSrc/src/main/java/org/elasticsearch/gradle/testfixtures/TestFixturesPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void apply(Project project) {
9696
if (dockerComposeSupported(project) == false) {
9797
project.getLogger().warn(
9898
"Tests for {} require docker-compose at /usr/local/bin/docker-compose or /usr/bin/docker-compose " +
99-
"but none could not be found so these will be skipped", project.getPath()
99+
"but none could be found so these will be skipped", project.getPath()
100100
);
101101
tasks.withType(getTaskClass("com.carrotsearch.gradle.junit4.RandomizedTestingTask"), task ->
102102
task.setEnabled(false)

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 7.0.0
2-
lucene = 8.0.0-snapshot-a1c6e642aa
2+
lucene = 8.0.0-snapshot-83f9835
33

44
# optional dependencies
55
spatial4j = 0.7

0 commit comments

Comments
 (0)