Applying changes required for ccr after moving ccr code to elasticsearch
This commit is contained in:
parent
cbd38983f4
commit
5a67a0f78f
|
@ -57,6 +57,7 @@ subprojects {
|
|||
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-security:${version}": xpackModule('security')]
|
||||
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-upgrade:${version}": xpackModule('upgrade')]
|
||||
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": xpackModule('watcher')]
|
||||
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ccr:${version}": xpackModule('ccr')]
|
||||
|
||||
bwcVersions.snapshotProjectNames.each { snapshotName ->
|
||||
Version snapshot = bwcVersions.getSnapshotForProject(snapshotName)
|
||||
|
|
|
@ -15,7 +15,7 @@ archivesBaseName = 'x-pack'
|
|||
es_meta_plugin {
|
||||
name = 'x-pack'
|
||||
description = 'Elasticsearch Expanded Pack Plugin'
|
||||
plugins = ['core', 'deprecation', 'graph', 'logstash',
|
||||
plugins = ['ccr', 'core', 'deprecation', 'graph', 'logstash',
|
||||
'ml', 'monitoring', 'security', 'upgrade', 'watcher', 'sql', 'rollup']
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
|
||||
import org.elasticsearch.gradle.BuildPlugin
|
||||
|
||||
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
|
||||
evaluationDependsOn(xpackModule('core'))
|
||||
|
||||
apply plugin: 'elasticsearch.esplugin'
|
||||
esplugin {
|
||||
|
@ -11,8 +11,6 @@ esplugin {
|
|||
hasNativeController false
|
||||
requiresKeystore true
|
||||
extendedPlugins = ['x-pack-core']
|
||||
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
|
||||
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
|
||||
}
|
||||
archivesBaseName = 'x-pack-ccr'
|
||||
|
||||
|
@ -48,5 +46,5 @@ dependencyLicenses {
|
|||
}
|
||||
|
||||
run {
|
||||
plugin ':x-pack-elasticsearch:plugin:core'
|
||||
plugin xpackModule('core')
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ task leaderClusterTest(type: RestIntegTestTask) {
|
|||
leaderClusterTestCluster {
|
||||
numNodes = 1
|
||||
clusterName = 'leader-cluster'
|
||||
plugin xpackProject('plugin').path
|
||||
}
|
||||
|
||||
leaderClusterTestRunner {
|
||||
|
@ -27,7 +26,6 @@ followClusterTestCluster {
|
|||
dependsOn leaderClusterTestRunner
|
||||
numNodes = 1
|
||||
clusterName = 'follow-cluster'
|
||||
plugin xpackProject('plugin').path
|
||||
setting 'search.remote.leader_cluster.seeds', "\"${-> leaderClusterTest.nodes.get(0).transportUri()}\""
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,9 @@ import org.elasticsearch.env.Environment;
|
|||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.http.HttpServerTransport;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.analysis.TokenizerFactory;
|
||||
import org.elasticsearch.index.engine.EngineFactory;
|
||||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
||||
import org.elasticsearch.ingest.Processor;
|
||||
|
@ -42,6 +44,7 @@ import org.elasticsearch.plugins.ActionPlugin;
|
|||
import org.elasticsearch.plugins.AnalysisPlugin;
|
||||
import org.elasticsearch.plugins.ClusterPlugin;
|
||||
import org.elasticsearch.plugins.DiscoveryPlugin;
|
||||
import org.elasticsearch.plugins.EnginePlugin;
|
||||
import org.elasticsearch.plugins.IngestPlugin;
|
||||
import org.elasticsearch.plugins.MapperPlugin;
|
||||
import org.elasticsearch.plugins.NetworkPlugin;
|
||||
|
@ -68,6 +71,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
@ -78,7 +82,7 @@ import java.util.stream.Collectors;
|
|||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
public class LocalStateCompositeXPackPlugin extends XPackPlugin implements ScriptPlugin, ActionPlugin, IngestPlugin, NetworkPlugin,
|
||||
ClusterPlugin, DiscoveryPlugin, MapperPlugin, AnalysisPlugin, PersistentTaskPlugin {
|
||||
ClusterPlugin, DiscoveryPlugin, MapperPlugin, AnalysisPlugin, PersistentTaskPlugin, EnginePlugin {
|
||||
|
||||
private XPackLicenseState licenseState;
|
||||
private SSLService sslService;
|
||||
|
@ -391,6 +395,21 @@ public class LocalStateCompositeXPackPlugin extends XPackPlugin implements Scrip
|
|||
.collect(toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings) {
|
||||
List<Optional<EngineFactory>> enginePlugins = filterPlugins(EnginePlugin.class).stream()
|
||||
.map(p -> p.getEngineFactory(indexSettings))
|
||||
.collect(Collectors.toList());
|
||||
if (enginePlugins.size() == 0) {
|
||||
return Optional.empty();
|
||||
} else if (enginePlugins.size() == 1) {
|
||||
return enginePlugins.stream().findFirst().get();
|
||||
} else {
|
||||
throw new IllegalStateException("Only one EngineFactory plugin allowed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private <T> List<T> filterPlugins(Class<T> type) {
|
||||
return plugins.stream().filter(x -> type.isAssignableFrom(x.getClass())).map(p -> ((T)p))
|
||||
.collect(Collectors.toList());
|
||||
|
|
Loading…
Reference in New Issue