-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 6.x: Mute test watcher usage stats output [Rollup] Fix FullClusterRestart test TEST: Disable soft-deletes in ParentChildTestCase TEST: Disable randomized soft-deletes settings Integrates soft-deletes into Elasticsearch (#33222) drop `index.shard.check_on_startup: fix` (#32279) Fix AwaitsFix issue number Mute SmokeTestWatcherWithSecurityIT testsi [DOCS] Moves ml folder from x-pack/docs to docs (#33248) TEST: mute more SmokeTestWatcherWithSecurityIT tests [DOCS] Move rollup APIs to docs (#31450) [DOCS] Rename X-Pack Commands section (#33005) Fixes SecurityIntegTestCase so it always adds at least one alias (#33296) TESTS: Fix Random Fail in MockTcpTransportTests (#33061) (#33307) MINOR: Remove Dead Code from PathTrie (#33280) (#33306) Fix pom for build-tools (#33300) Lazy evaluate java9home (#33301) SQL: test coverage for JdbcResultSet (#32813) Work around to be able to generate eclipse projects (#33295) Different handling for security specific errors in the CLI. Fix for #33230 (#33255) [ML] Refactor delimited file structure detection (#33233) SQL: Support multi-index format as table identifier (#33278) Enable forbiddenapis server java9 (#33245) [MUTE] SmokeTestWatcherWithSecurityIT flaky tests Add region ISO code to GeoIP Ingest plugin (#31669) (#33276) Don't be strict for 6.x Update serialization versions for custom IndexMetaData backport Replace IndexMetaData.Custom with Map-based custom metadata (#32749) Painless: Fix Bindings Bug (#33274) SQL: prevent duplicate generation for repeated aggs (#33252) TEST: Mute testMonitorClusterHealth Fix serialization of empty field capabilities response (#33263) Fix nested _source retrieval with includes/excludes (#33180) [DOCS] TLS file resources are reloadable (#33258) Watcher: Ensure TriggerEngine start replaces existing watches (#33157) Ignore module-info in jar hell checks (#33011) Fix docs build after #33241 [DOC] Repository GCS ADC not supported (#33238) Upgrade to latest Gradle 4.10 (#32801) Fix/30904 cluster formation part2 (#32877) Move file-based discovery to core (#33241) HLRC: add client side RefreshPolicy (#33209) [Kerberos] Add unsupported languages for tests (#33253) Watcher: Reload properly on remote shard change (#33167) Fix classpath security checks for external tests. (#33066) [Rollup] Only allow aggregating on multiples of configured interval (#32052) Added deprecation warning for rescore in scroll queries (#33070) Apply settings filter to get cluster settings API (#33247) [Rollup] Re-factor Rollup Indexer into a generic indexer for re-usability (#32743) HLRC: create base timed request class (#33216) HLRC: Use Optional in validation logic (#33104) Painless: Add Bindings (#33042)
- Loading branch information
Showing
272 changed files
with
6,856 additions
and
2,478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
buildSrc/src/main/java/org/elasticsearch/GradleServicesAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch; | ||
|
||
import org.gradle.api.Action; | ||
import org.gradle.api.Project; | ||
import org.gradle.api.file.CopySpec; | ||
import org.gradle.api.file.FileTree; | ||
import org.gradle.api.tasks.WorkResult; | ||
import org.gradle.process.ExecResult; | ||
import org.gradle.process.JavaExecSpec; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Facilitate access to Gradle services without a direct dependency on Project. | ||
* | ||
* In a future release Gradle will offer service injection, this adapter plays that role until that time. | ||
* It exposes the service methods that are part of the public API as the classes implementing them are not. | ||
* Today service injection is <a href="https://github.com/gradle/gradle/issues/2363">not available</a> for | ||
* extensions. | ||
* | ||
* Everything exposed here must be thread safe. That is the very reason why project is not passed in directly. | ||
*/ | ||
public class GradleServicesAdapter { | ||
|
||
public final Project project; | ||
|
||
public GradleServicesAdapter(Project project) { | ||
this.project = project; | ||
} | ||
|
||
public static GradleServicesAdapter getInstance(Project project) { | ||
return new GradleServicesAdapter(project); | ||
} | ||
|
||
public WorkResult copy(Action<? super CopySpec> action) { | ||
return project.copy(action); | ||
} | ||
|
||
public WorkResult sync(Action<? super CopySpec> action) { | ||
return project.sync(action); | ||
} | ||
|
||
public ExecResult javaexec(Action<? super JavaExecSpec> action) { | ||
return project.javaexec(action); | ||
} | ||
|
||
public FileTree zipTree(File zipPath) { | ||
return project.zipTree(zipPath); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
buildSrc/src/main/java/org/elasticsearch/gradle/Distribution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch.gradle; | ||
|
||
public enum Distribution { | ||
|
||
INTEG_TEST("integ-test-zip"), | ||
ZIP("zip"), | ||
ZIP_OSS("zip-oss"); | ||
|
||
private final String name; | ||
|
||
Distribution(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
buildSrc/src/main/java/org/elasticsearch/gradle/clusterformation/ClusterformationPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch.gradle.clusterformation; | ||
|
||
import groovy.lang.Closure; | ||
import org.elasticsearch.GradleServicesAdapter; | ||
import org.gradle.api.NamedDomainObjectContainer; | ||
import org.gradle.api.Plugin; | ||
import org.gradle.api.Project; | ||
import org.gradle.api.Task; | ||
import org.gradle.api.execution.TaskActionListener; | ||
import org.gradle.api.execution.TaskExecutionListener; | ||
import org.gradle.api.logging.Logger; | ||
import org.gradle.api.logging.Logging; | ||
import org.gradle.api.plugins.ExtraPropertiesExtension; | ||
import org.gradle.api.tasks.TaskState; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ClusterformationPlugin implements Plugin<Project> { | ||
|
||
public static final String LIST_TASK_NAME = "listElasticSearchClusters"; | ||
public static final String EXTENSION_NAME = "elasticSearchClusters"; | ||
|
||
private final Logger logger = Logging.getLogger(ClusterformationPlugin.class); | ||
|
||
@Override | ||
public void apply(Project project) { | ||
NamedDomainObjectContainer<? extends ElasticsearchConfiguration> container = project.container( | ||
ElasticsearchNode.class, | ||
(name) -> new ElasticsearchNode(name, GradleServicesAdapter.getInstance(project)) | ||
); | ||
project.getExtensions().add(EXTENSION_NAME, container); | ||
|
||
Task listTask = project.getTasks().create(LIST_TASK_NAME); | ||
listTask.setGroup("ES cluster formation"); | ||
listTask.setDescription("Lists all ES clusters configured for this project"); | ||
listTask.doLast((Task task) -> | ||
container.forEach((ElasticsearchConfiguration cluster) -> | ||
logger.lifecycle(" * {}: {}", cluster.getName(), cluster.getDistribution()) | ||
) | ||
); | ||
|
||
Map<Task, List<ElasticsearchConfiguration>> taskToCluster = new HashMap<>(); | ||
|
||
// register an extension for all current and future tasks, so that any task can declare that it wants to use a | ||
// specific cluster. | ||
project.getTasks().all((Task task) -> | ||
task.getExtensions().findByType(ExtraPropertiesExtension.class) | ||
.set( | ||
"useCluster", | ||
new Closure<Void>(this, this) { | ||
public void doCall(ElasticsearchConfiguration conf) { | ||
taskToCluster.computeIfAbsent(task, k -> new ArrayList<>()).add(conf); | ||
} | ||
}) | ||
); | ||
|
||
project.getGradle().getTaskGraph().whenReady(taskExecutionGraph -> | ||
taskExecutionGraph.getAllTasks() | ||
.forEach(task -> | ||
taskToCluster.getOrDefault(task, Collections.emptyList()).forEach(ElasticsearchConfiguration::claim) | ||
) | ||
); | ||
project.getGradle().addListener( | ||
new TaskActionListener() { | ||
@Override | ||
public void beforeActions(Task task) { | ||
// we only start the cluster before the actions, so we'll not start it if the task is up-to-date | ||
taskToCluster.getOrDefault(task, new ArrayList<>()).forEach(ElasticsearchConfiguration::start); | ||
} | ||
@Override | ||
public void afterActions(Task task) {} | ||
} | ||
); | ||
project.getGradle().addListener( | ||
new TaskExecutionListener() { | ||
@Override | ||
public void afterExecute(Task task, TaskState state) { | ||
// always un-claim the cluster, even if _this_ task is up-to-date, as others might not have been and caused the | ||
// cluster to start. | ||
taskToCluster.getOrDefault(task, new ArrayList<>()).forEach(ElasticsearchConfiguration::unClaimAndStop); | ||
} | ||
@Override | ||
public void beforeExecute(Task task) {} | ||
} | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.