2016-12-14 18:02:07 -05:00
|
|
|
String dirName = rootProject.projectDir.name
|
|
|
|
rootProject.name = dirName
|
2015-10-29 14:40:19 -04:00
|
|
|
|
2015-11-05 01:28:57 -05:00
|
|
|
List projects = [
|
2016-05-07 01:22:38 -04:00
|
|
|
'build-tools',
|
2015-10-29 14:40:19 -04:00
|
|
|
'rest-api-spec',
|
2016-04-29 10:42:03 -04:00
|
|
|
'docs',
|
2016-06-22 13:40:01 -04:00
|
|
|
'client:rest',
|
2016-12-29 12:16:04 -05:00
|
|
|
'client:rest-high-level',
|
2016-06-22 13:40:01 -04:00
|
|
|
'client:sniffer',
|
2016-07-18 09:42:24 -04:00
|
|
|
'client:transport',
|
2016-06-22 13:40:01 -04:00
|
|
|
'client:test',
|
2016-08-26 03:05:47 -04:00
|
|
|
'client:client-benchmark-noop-api-plugin',
|
2016-07-26 05:01:22 -04:00
|
|
|
'client:benchmark',
|
2016-06-15 10:48:02 -04:00
|
|
|
'benchmarks',
|
2015-12-03 17:52:51 -05:00
|
|
|
'distribution:integ-test-zip',
|
2015-10-29 14:40:19 -04:00
|
|
|
'distribution:zip',
|
|
|
|
'distribution:tar',
|
|
|
|
'distribution:deb',
|
|
|
|
'distribution:rpm',
|
2017-12-06 18:03:13 -05:00
|
|
|
'distribution:tools:launchers',
|
2017-04-21 12:25:58 -04:00
|
|
|
'distribution:tools:plugin-cli',
|
2018-01-11 13:30:43 -05:00
|
|
|
'server',
|
|
|
|
'server:cli',
|
2015-12-17 19:57:39 -05:00
|
|
|
'test:framework',
|
2015-12-15 23:14:37 -05:00
|
|
|
'test:fixtures:example-fixture',
|
2015-12-20 16:00:37 -05:00
|
|
|
'test:fixtures:hdfs-fixture',
|
2017-05-10 17:42:20 -04:00
|
|
|
'test:fixtures:krb5kdc-fixture',
|
2017-05-11 10:06:20 -04:00
|
|
|
'test:fixtures:old-elasticsearch',
|
2016-02-16 18:32:21 -05:00
|
|
|
'test:logger-usage',
|
2017-12-20 17:29:16 -05:00
|
|
|
'libs:elasticsearch-nio',
|
2016-05-12 13:39:51 -04:00
|
|
|
'modules:aggs-matrix-stats',
|
2017-04-19 18:51:34 -04:00
|
|
|
'modules:analysis-common',
|
2016-05-27 13:37:53 -04:00
|
|
|
'modules:ingest-common',
|
2015-12-03 17:18:26 -05:00
|
|
|
'modules:lang-expression',
|
2015-12-08 22:45:21 -05:00
|
|
|
'modules:lang-mustache',
|
2016-02-21 19:50:33 -05:00
|
|
|
'modules:lang-painless',
|
2017-09-13 11:58:53 -04:00
|
|
|
'modules:mapper-extras',
|
2017-05-12 09:58:06 -04:00
|
|
|
'modules:parent-join',
|
2016-05-20 17:53:51 -04:00
|
|
|
'modules:percolator',
|
2017-05-18 10:47:47 -04:00
|
|
|
'modules:rank-eval',
|
2017-04-19 18:51:34 -04:00
|
|
|
'modules:reindex',
|
2017-01-25 18:09:25 -05:00
|
|
|
'modules:repository-url',
|
2017-04-19 18:51:34 -04:00
|
|
|
'modules:transport-netty4',
|
2017-07-28 05:23:50 -04:00
|
|
|
'modules:tribe',
|
2015-10-29 14:40:19 -04:00
|
|
|
'plugins:analysis-icu',
|
|
|
|
'plugins:analysis-kuromoji',
|
|
|
|
'plugins:analysis-phonetic',
|
|
|
|
'plugins:analysis-smartcn',
|
|
|
|
'plugins:analysis-stempel',
|
2016-10-27 16:53:52 -04:00
|
|
|
'plugins:analysis-ukrainian',
|
2016-06-30 08:39:23 -04:00
|
|
|
'plugins:discovery-azure-classic',
|
2015-10-29 14:40:19 -04:00
|
|
|
'plugins:discovery-ec2',
|
2016-09-13 20:52:39 -04:00
|
|
|
'plugins:discovery-file',
|
2015-10-29 14:40:19 -04:00
|
|
|
'plugins:discovery-gce',
|
2016-01-08 16:44:47 -05:00
|
|
|
'plugins:ingest-geoip',
|
2016-02-09 08:57:05 -05:00
|
|
|
'plugins:ingest-attachment',
|
2016-07-05 03:42:29 -04:00
|
|
|
'plugins:ingest-user-agent',
|
2015-10-29 14:40:19 -04:00
|
|
|
'plugins:mapper-murmur3',
|
|
|
|
'plugins:mapper-size',
|
|
|
|
'plugins:repository-azure',
|
2015-09-15 11:35:10 -04:00
|
|
|
'plugins:repository-gcs',
|
2015-11-24 18:04:40 -05:00
|
|
|
'plugins:repository-hdfs',
|
2015-10-29 14:40:19 -04:00
|
|
|
'plugins:repository-s3',
|
|
|
|
'plugins:jvm-example',
|
|
|
|
'plugins:store-smb',
|
2018-01-05 11:41:29 -05:00
|
|
|
'plugins:transport-nio',
|
2017-04-21 18:56:04 -04:00
|
|
|
'qa:auto-create-index',
|
Cross Cluster Search: make remote clusters optional (#27182)
Today Cross Cluster Search requires at least one node in each remote cluster to be up once the cross cluster search is run. Otherwise the whole search request fails despite some of the data (either local and/or remote) is available. This happens when performing the _search/shards calls to find out which remote shards the query has to be executed on. This scenario is different from shard failures that may happen later on when the query is actually executed, in case e.g. remote shards are missing, which is not going to fail the whole request but rather yield partial results, and the _shards section in the response will indicate that.
This commit introduces a boolean setting per cluster called search.remote.$cluster_alias.skip_if_disconnected, set to false by default, which allows to skip certain clusters if they are down when trying to reach them through a cross cluster search requests. By default all clusters are mandatory.
Scroll requests support such setting too when they are first initiated (first search request with scroll parameter), but subsequent scroll rounds (_search/scroll endpoint) will fail if some of the remote clusters went down meanwhile.
The search API response contains now a new _clusters section, similar to the _shards section, that gets returned whenever one or more clusters were disconnected and got skipped:
"_clusters" : {
"total" : 3,
"successful" : 2,
"skipped" : 1
}
Such section won't be part of the response if no clusters have been skipped.
The per cluster skip_unavailable setting value has also been added to the output of the remote/info API.
2017-11-21 05:41:47 -05:00
|
|
|
'qa:ccs-unavailable-clusters',
|
2015-11-03 21:42:22 -05:00
|
|
|
'qa:evil-tests',
|
2017-05-26 14:07:48 -04:00
|
|
|
'qa:full-cluster-restart',
|
2017-09-13 11:58:53 -04:00
|
|
|
'qa:integration-bwc',
|
2017-05-18 17:20:23 -04:00
|
|
|
'qa:mixed-cluster',
|
2017-04-21 18:56:04 -04:00
|
|
|
'qa:multi-cluster-search',
|
2016-11-17 04:58:09 -05:00
|
|
|
'qa:no-bootstrap-tests',
|
2017-05-11 10:06:20 -04:00
|
|
|
'qa:reindex-from-old',
|
2016-08-31 19:45:03 -04:00
|
|
|
'qa:rolling-upgrade',
|
2015-10-29 14:40:19 -04:00
|
|
|
'qa:smoke-test-client',
|
2016-11-13 17:27:18 -05:00
|
|
|
'qa:smoke-test-http',
|
2016-02-01 15:53:52 -05:00
|
|
|
'qa:smoke-test-ingest-with-all-dependencies',
|
|
|
|
'qa:smoke-test-ingest-disabled',
|
2016-06-10 17:20:04 -04:00
|
|
|
'qa:smoke-test-multinode',
|
2016-11-01 06:36:22 -04:00
|
|
|
'qa:smoke-test-rank-eval-with-mustache',
|
2016-06-10 17:20:04 -04:00
|
|
|
'qa:smoke-test-plugins',
|
2017-05-12 09:58:06 -04:00
|
|
|
'qa:smoke-test-reindex-with-all-modules',
|
2016-11-13 17:27:18 -05:00
|
|
|
'qa:smoke-test-tribe-node',
|
2015-11-02 12:40:47 -05:00
|
|
|
'qa:vagrant',
|
2017-05-27 15:46:16 -04:00
|
|
|
'qa:verify-version-constants',
|
2017-06-28 15:43:59 -04:00
|
|
|
'qa:wildfly',
|
|
|
|
'qa:query-builder-bwc'
|
2015-10-29 14:40:19 -04:00
|
|
|
]
|
|
|
|
|
2018-01-03 14:12:43 -05:00
|
|
|
projects.add("libs")
|
|
|
|
File libsDir = new File(rootProject.projectDir, 'libs')
|
|
|
|
for (File libDir : new File(rootProject.projectDir, 'libs').listFiles()) {
|
|
|
|
if (libDir.isDirectory() == false) continue;
|
|
|
|
if (libDir.name.startsWith('build') || libDir.name.startsWith('.')) continue;
|
|
|
|
projects.add("libs:${libDir.name}".toString())
|
|
|
|
}
|
|
|
|
|
2017-11-21 03:26:45 -05:00
|
|
|
/* Create projects for building BWC snapshot distributions from the heads of other branches */
|
|
|
|
final List<String> branches = ['5.6', '6.0', '6.1', '6.x']
|
|
|
|
for (final String branch : branches) {
|
|
|
|
projects.add("distribution:bwc-snapshot-${branch}".toString())
|
|
|
|
}
|
|
|
|
|
2015-11-05 01:28:57 -05:00
|
|
|
boolean isEclipse = System.getProperty("eclipse.launcher") != null || gradle.startParameter.taskNames.contains('eclipse') || gradle.startParameter.taskNames.contains('cleanEclipse')
|
|
|
|
if (isEclipse) {
|
|
|
|
// eclipse cannot handle an intermediate dependency between main and test, so we must create separate projects
|
2018-01-11 13:30:43 -05:00
|
|
|
// for server-src and server-tests
|
|
|
|
projects << 'server-tests'
|
2017-12-21 09:34:15 -05:00
|
|
|
projects << 'libs:elasticsearch-nio-tests'
|
2015-11-05 01:28:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
include projects.toArray(new String[0])
|
|
|
|
|
2016-05-07 01:22:38 -04:00
|
|
|
project(':build-tools').projectDir = new File(rootProject.projectDir, 'buildSrc')
|
|
|
|
|
2017-11-21 03:26:45 -05:00
|
|
|
/* The BWC snapshot projects share the same build directory and build file,
|
|
|
|
* but apply to different backwards compatibility branches. */
|
|
|
|
for (final String branch : branches) {
|
|
|
|
project(":distribution:bwc-snapshot-${branch}").projectDir = new File(rootProject.projectDir, 'distribution/bwc')
|
|
|
|
}
|
2017-05-29 10:22:32 -04:00
|
|
|
|
2015-11-05 01:28:57 -05:00
|
|
|
if (isEclipse) {
|
2018-01-11 13:30:43 -05:00
|
|
|
project(":server").projectDir = new File(rootProject.projectDir, 'server/src/main')
|
|
|
|
project(":server").buildFileName = 'eclipse-build.gradle'
|
|
|
|
project(":server-tests").projectDir = new File(rootProject.projectDir, 'server/src/test')
|
|
|
|
project(":server-tests").buildFileName = 'eclipse-build.gradle'
|
2017-12-21 09:34:15 -05:00
|
|
|
project(":libs:elasticsearch-nio").projectDir = new File(rootProject.projectDir, 'libs/elasticsearch-nio/src/main')
|
|
|
|
project(":libs:elasticsearch-nio").buildFileName = 'eclipse-build.gradle'
|
|
|
|
project(":libs:elasticsearch-nio-tests").projectDir = new File(rootProject.projectDir, 'libs/elasticsearch-nio/src/test')
|
|
|
|
project(":libs:elasticsearch-nio-tests").buildFileName = 'eclipse-build.gradle'
|
2015-10-29 14:40:19 -04:00
|
|
|
}
|
|
|
|
|
2015-11-20 14:58:50 -05:00
|
|
|
/**
|
|
|
|
* Iterates over sub directories, looking for build.gradle, and adds a project if found
|
|
|
|
* for that dir with the given path prefix. Note that this requires each level
|
2016-12-14 18:02:07 -05:00
|
|
|
* of the dir hierarchy to have a build.gradle. Otherwise we would have to iterate
|
2015-11-20 14:58:50 -05:00
|
|
|
* all files/directories in the source tree to find all projects.
|
|
|
|
*/
|
2017-11-21 03:26:45 -05:00
|
|
|
void addSubProjects(String path, File dir, List<String> projects, List<String> branches) {
|
2015-11-20 14:58:50 -05:00
|
|
|
if (dir.isDirectory() == false) return;
|
2015-11-23 17:11:32 -05:00
|
|
|
if (dir.name == 'buildSrc') return;
|
2015-11-20 14:58:50 -05:00
|
|
|
if (new File(dir, 'build.gradle').exists() == false) return;
|
|
|
|
|
2017-11-21 03:26:45 -05:00
|
|
|
final String projectName = "${path}:${dir.name}"
|
2015-11-23 18:15:40 -05:00
|
|
|
include projectName
|
2017-11-21 03:26:45 -05:00
|
|
|
|
|
|
|
if (dir.name == 'bwc-snapshot-dummy-projects') {
|
|
|
|
for (final String branch : branches) {
|
|
|
|
final String snapshotProjectName = "${projectName}:bwc-snapshot-${branch}"
|
|
|
|
projects.add(snapshotProjectName)
|
|
|
|
include snapshotProjectName
|
|
|
|
project("${snapshotProjectName}").projectDir = dir
|
|
|
|
}
|
|
|
|
// TODO do we want to assert that there's nothing else in the bwc directory?
|
|
|
|
} else {
|
2018-01-09 12:28:43 -05:00
|
|
|
if (path.isEmpty() || path.startsWith(':example-plugins')) {
|
2017-11-21 03:26:45 -05:00
|
|
|
project(projectName).projectDir = dir
|
|
|
|
}
|
|
|
|
for (File subdir : dir.listFiles()) {
|
|
|
|
addSubProjects(projectName, subdir, projects, branches)
|
|
|
|
}
|
2015-11-20 14:58:50 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-09 12:28:43 -05:00
|
|
|
// include example plugins
|
|
|
|
File examplePluginsDir = new File(rootProject.projectDir, 'plugins/examples')
|
|
|
|
for (File example : examplePluginsDir.listFiles()) {
|
|
|
|
if (example.isDirectory() == false) continue;
|
|
|
|
if (example.name.startsWith('build') || example.name.startsWith('.')) continue;
|
|
|
|
addSubProjects(':example-plugins', example, projects, [])
|
|
|
|
}
|
|
|
|
project(':example-plugins').projectDir = new File(rootProject.projectDir, 'plugins/examples')
|
|
|
|
|
2015-11-23 17:44:37 -05:00
|
|
|
// look for extra plugins for elasticsearch
|
2016-12-14 18:02:07 -05:00
|
|
|
File extraProjects = new File(rootProject.projectDir.parentFile, "${dirName}-extra")
|
|
|
|
if (extraProjects.exists()) {
|
|
|
|
for (File extraProjectDir : extraProjects.listFiles()) {
|
2017-11-21 03:26:45 -05:00
|
|
|
addSubProjects('', extraProjectDir, projects, branches)
|
2015-11-23 17:44:37 -05:00
|
|
|
}
|
2015-11-20 14:58:50 -05:00
|
|
|
}
|
2017-12-20 17:29:16 -05:00
|
|
|
include 'libs'
|
|
|
|
|