Skip to content

Commit d52ca33

Browse files
committed
Merge branch 'master' into ccr
* master: (68 commits) [DOCS] Removes X-Pack Elasticsearch release notes (#30272) Correct an example in the top-level suggester documentation. (#30224) [DOCS] Removes broken link [DOCS] Adds file realm configuration details (#30221) [DOCS] Adds PKI realm configuration details (#30225) Fix a reference to match_phrase_prefix in the match query docs. (#30282) Fix failure for validate API on a terms query (#29483) [DOCS] Fix 6.4-specific link in changelog (#30314) Remove RepositoriesMetaData variadic constructor (#29569) Test: increase authentication logging for debugging [DOCS] Removes redundant SAML realm settings (#30196) REST Client: Add Request object flavored methods (#29623) [DOCS] Adds changelog to Elasticsearch Reference (#30271) [DOCS] Fixes section error SQL: Teach the CLI to ignore empty commands (#30265) [DOCS] Adds Active Directory realm configuration details (#30223) [DOCS] Removes redundant file realm settings (#30192) [DOCS] Fixes users command name (#30275) Build: Move gradle wrapper jar to a dot dir (#30146) Build: Log a warning if disabling reindex-from-old (#30304)
2 parents 8a2df6c + 092dd6c commit d52ca33

File tree

219 files changed

+5488
-4337
lines changed

Some content is hidden

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

219 files changed

+5488
-4337
lines changed
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
4-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
54
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
66
distributionSha256Sum=203f4537da8b8075e38c036a6d14cb71b1149de5bf0a8f6db32ac2833a1d1294

Vagrantfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export BATS=/project/build/bats
337337
export BATS_UTILS=/project/build/packaging/bats/utils
338338
export BATS_TESTS=/project/build/packaging/bats/tests
339339
export PACKAGING_ARCHIVES=/project/build/packaging/archives
340+
export PACKAGING_TESTS=/project/build/packaging/tests
340341
VARS
341342
cat \<\<SUDOERS_VARS > /etc/sudoers.d/elasticsearch_vars
342343
Defaults env_keep += "ZIP"
@@ -347,6 +348,7 @@ Defaults env_keep += "BATS"
347348
Defaults env_keep += "BATS_UTILS"
348349
Defaults env_keep += "BATS_TESTS"
349350
Defaults env_keep += "PACKAGING_ARCHIVES"
351+
Defaults env_keep += "PACKAGING_TESTS"
350352
SUDOERS_VARS
351353
chmod 0440 /etc/sudoers.d/elasticsearch_vars
352354
SHELL

build.gradle

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -440,25 +440,18 @@ task run(type: Run) {
440440
impliesSubProjects = true
441441
}
442442

443-
task wrapper(type: Wrapper)
444-
445-
gradle.projectsEvaluated {
446-
447-
allprojects {
448-
tasks.withType(Wrapper) { Wrapper wrapper ->
449-
wrapper.distributionType = DistributionType.ALL
450-
451-
wrapper.doLast {
452-
final DistributionLocator locator = new DistributionLocator()
453-
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
454-
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
455-
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
456-
final String sha256Sum = new String(sha256Uri.toURL().bytes)
457-
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
458-
}
459-
}
443+
task wrapper(type: Wrapper) {
444+
distributionType = DistributionType.ALL
445+
jarFile = file('.gradle-wrapper/gradle-wrapper.jar')
446+
doLast {
447+
final DistributionLocator locator = new DistributionLocator()
448+
final GradleVersion version = GradleVersion.version(gradleVersion)
449+
final URI distributionUri = locator.getDistributionFor(version, distributionType.name().toLowerCase(Locale.ENGLISH))
450+
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
451+
final String sha256Sum = new String(sha256Uri.toURL().bytes)
452+
final String existingProperties = getPropertiesFile().getText('UTF-8')
453+
getPropertiesFile().setText("${existingProperties}distributionSha256Sum=${sha256Sum}\n", 'UTF-8')
460454
}
461-
462455
}
463456

464457
static void assertLinesInFile(final Path path, final List<String> expectedLines) {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,22 @@ class BuildPlugin implements Plugin<Project> {
549549
javadoc.classpath = javadoc.getClasspath().filter { f ->
550550
return classes.contains(f) == false
551551
}
552+
/*
553+
* Force html5 on projects that support it to silence the warning
554+
* that `javadoc` will change its defaults in the future.
555+
*
556+
* But not all of our javadoc is actually valid html5. So we
557+
* have to become valid incrementally. We only set html5 on the
558+
* projects we have converted so that we still get the annoying
559+
* warning on the unconverted ones. That will give us an
560+
* incentive to convert them....
561+
*/
562+
List html4Projects = [
563+
':server',
564+
]
565+
if (false == html4Projects.contains(project.path)) {
566+
javadoc.options.addBooleanOption('html5', true)
567+
}
552568
}
553569
configureJavadocJar(project)
554570
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantPropertiesExtension.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class VagrantPropertiesExtension {
4141
@Input
4242
Boolean inheritTestUtils
4343

44+
@Input
45+
String testClass
46+
4447
VagrantPropertiesExtension(List<String> availableBoxes) {
4548
this.boxes = availableBoxes
4649
this.batsDir = 'src/test/resources/packaging'

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class VagrantTestPlugin implements Plugin<Project> {
5151
static List<String> UPGRADE_FROM_ARCHIVES = ['rpm', 'deb']
5252

5353
private static final PACKAGING_CONFIGURATION = 'packaging'
54+
private static final PACKAGING_TEST_CONFIGURATION = 'packagingTest'
5455
private static final BATS = 'bats'
5556
private static final String BATS_TEST_COMMAND ="cd \$PACKAGING_ARCHIVES && sudo bats --tap \$BATS_TESTS/*.$BATS"
5657
private static final String PLATFORM_TEST_COMMAND ="rm -rf ~/elasticsearch && rsync -r /elasticsearch/ ~/elasticsearch && cd ~/elasticsearch && ./gradlew test integTest"
@@ -66,6 +67,7 @@ class VagrantTestPlugin implements Plugin<Project> {
6667

6768
// Creates custom configurations for Bats testing files (and associated scripts and archives)
6869
createPackagingConfiguration(project)
70+
project.configurations.create(PACKAGING_TEST_CONFIGURATION)
6971

7072
// Creates all the main Vagrant tasks
7173
createVagrantTasks(project)
@@ -144,10 +146,12 @@ class VagrantTestPlugin implements Plugin<Project> {
144146
}
145147

146148
private static void createCleanTask(Project project) {
147-
project.tasks.create('clean', Delete.class) {
148-
description 'Clean the project build directory'
149-
group 'Build'
150-
delete project.buildDir
149+
if (project.tasks.findByName('clean') == null) {
150+
project.tasks.create('clean', Delete.class) {
151+
description 'Clean the project build directory'
152+
group 'Build'
153+
delete project.buildDir
154+
}
151155
}
152156
}
153157

@@ -174,6 +178,18 @@ class VagrantTestPlugin implements Plugin<Project> {
174178
from project.configurations[PACKAGING_CONFIGURATION]
175179
}
176180

181+
File testsDir = new File(packagingDir, 'tests')
182+
Copy copyPackagingTests = project.tasks.create('copyPackagingTests', Copy) {
183+
into testsDir
184+
from project.configurations[PACKAGING_TEST_CONFIGURATION]
185+
}
186+
187+
Task createTestRunnerScript = project.tasks.create('createTestRunnerScript', FileContentsTask) {
188+
dependsOn copyPackagingTests
189+
file "${testsDir}/run-tests.sh"
190+
contents "java -cp \"\$PACKAGING_TESTS/*\" org.junit.runner.JUnitCore ${-> project.extensions.esvagrant.testClass}"
191+
}
192+
177193
Task createVersionFile = project.tasks.create('createVersionFile', FileContentsTask) {
178194
dependsOn copyPackagingArchives
179195
file "${archivesDir}/version"
@@ -234,7 +250,8 @@ class VagrantTestPlugin implements Plugin<Project> {
234250

235251
Task vagrantSetUpTask = project.tasks.create('setupPackagingTest')
236252
vagrantSetUpTask.dependsOn 'vagrantCheckVersion'
237-
vagrantSetUpTask.dependsOn copyPackagingArchives, createVersionFile, createUpgradeFromFile, createUpgradeIsOssFile
253+
vagrantSetUpTask.dependsOn copyPackagingArchives, copyPackagingTests, createTestRunnerScript
254+
vagrantSetUpTask.dependsOn createVersionFile, createUpgradeFromFile, createUpgradeIsOssFile
238255
vagrantSetUpTask.dependsOn copyBatsTests, copyBatsUtils
239256
}
240257

@@ -393,20 +410,29 @@ class VagrantTestPlugin implements Plugin<Project> {
393410
packagingTest.dependsOn(batsPackagingTest)
394411
}
395412

396-
// This task doesn't do anything yet. In the future it will execute a jar containing tests on the vm
397-
Task groovyPackagingTest = project.tasks.create("vagrant${boxTask}#groovyPackagingTest")
398-
groovyPackagingTest.dependsOn(up)
399-
groovyPackagingTest.finalizedBy(halt)
413+
Task javaPackagingTest = project.tasks.create("vagrant${boxTask}#javaPackagingTest", VagrantCommandTask) {
414+
command 'ssh'
415+
boxName box
416+
environmentVars vagrantEnvVars
417+
dependsOn up, setupPackagingTest
418+
finalizedBy halt
419+
args '--command', "bash \"\$PACKAGING_TESTS/run-tests.sh\""
420+
}
421+
422+
// todo remove this onlyIf after all packaging tests are consolidated
423+
javaPackagingTest.onlyIf {
424+
project.extensions.esvagrant.testClass != null
425+
}
400426

401-
TaskExecutionAdapter groovyPackagingReproListener = createReproListener(project, groovyPackagingTest.path)
402-
groovyPackagingTest.doFirst {
403-
project.gradle.addListener(groovyPackagingReproListener)
427+
TaskExecutionAdapter javaPackagingReproListener = createReproListener(project, javaPackagingTest.path)
428+
javaPackagingTest.doFirst {
429+
project.gradle.addListener(javaPackagingReproListener)
404430
}
405-
groovyPackagingTest.doLast {
406-
project.gradle.removeListener(groovyPackagingReproListener)
431+
javaPackagingTest.doLast {
432+
project.gradle.removeListener(javaPackagingReproListener)
407433
}
408434
if (project.extensions.esvagrant.boxes.contains(box)) {
409-
packagingTest.dependsOn(groovyPackagingTest)
435+
packagingTest.dependsOn(javaPackagingTest)
410436
}
411437

412438
Task platform = project.tasks.create("vagrant${boxTask}#platformTest", VagrantCommandTask) {

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ public NoopBulkRequestBuilder setWaitForActiveShards(final int waitForActiveShar
129129
}
130130

131131
/**
132-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
132+
* A timeout to wait if the index operation can't be performed immediately.
133+
* Defaults to {@code 1m}.
133134
*/
134135
public final NoopBulkRequestBuilder setTimeout(TimeValue timeout) {
135136
request.timeout(timeout);
136137
return this;
137138
}
138139

139140
/**
140-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
141+
* A timeout to wait if the index operation can't be performed immediately.
142+
* Defaults to {@code 1m}.
141143
*/
142144
public final NoopBulkRequestBuilder setTimeout(String timeout) {
143145
request.timeout(timeout);
@@ -151,4 +153,3 @@ public int numberOfActions() {
151153
return request.numberOfActions();
152154
}
153155
}
154-

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public NoopSearchRequestBuilder setRouting(String... routing) {
142142

143143
/**
144144
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
145-
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
145+
* {@code _local} to prefer local shards or a custom value, which guarantees that the same order
146146
* will be used across different requests.
147147
*/
148148
public NoopSearchRequestBuilder setPreference(String preference) {
@@ -188,15 +188,15 @@ public NoopSearchRequestBuilder setMinScore(float minScore) {
188188
}
189189

190190
/**
191-
* From index to start the search from. Defaults to <tt>0</tt>.
191+
* From index to start the search from. Defaults to {@code 0}.
192192
*/
193193
public NoopSearchRequestBuilder setFrom(int from) {
194194
sourceBuilder().from(from);
195195
return this;
196196
}
197197

198198
/**
199-
* The number of search hits to return. Defaults to <tt>10</tt>.
199+
* The number of search hits to return. Defaults to {@code 10}.
200200
*/
201201
public NoopSearchRequestBuilder setSize(int size) {
202202
sourceBuilder().size(size);
@@ -349,7 +349,7 @@ public NoopSearchRequestBuilder slice(SliceBuilder builder) {
349349

350350
/**
351351
* Applies when sorting, and controls if scores will be tracked as well. Defaults to
352-
* <tt>false</tt>.
352+
* {@code false}.
353353
*/
354354
public NoopSearchRequestBuilder setTrackScores(boolean trackScores) {
355355
sourceBuilder().trackScores(trackScores);

client/rest-high-level/src/main/java/org/elasticsearch/client/ClusterClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public final class ClusterClient {
4848
*/
4949
public ClusterUpdateSettingsResponse putSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, Header... headers)
5050
throws IOException {
51-
return restHighLevelClient.performRequestAndParseEntity(clusterUpdateSettingsRequest, Request::clusterPutSettings,
51+
return restHighLevelClient.performRequestAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings,
5252
ClusterUpdateSettingsResponse::fromXContent, emptySet(), headers);
5353
}
5454

@@ -60,7 +60,7 @@ public ClusterUpdateSettingsResponse putSettings(ClusterUpdateSettingsRequest cl
6060
*/
6161
public void putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest,
6262
ActionListener<ClusterUpdateSettingsResponse> listener, Header... headers) {
63-
restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest, Request::clusterPutSettings,
63+
restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings,
6464
ClusterUpdateSettingsResponse::fromXContent, listener, emptySet(), headers);
6565
}
6666
}

0 commit comments

Comments
 (0)