mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
Refactor overrides of old Plugin.createComponents method to new services method (#101381)
This commit is contained in:
parent
d52f74ff22
commit
22381fd6a7
51 changed files with 291 additions and 1565 deletions
|
@ -99,17 +99,11 @@ import org.apache.lucene.analysis.tr.ApostropheFilter;
|
|||
import org.apache.lucene.analysis.tr.TurkishAnalyzer;
|
||||
import org.apache.lucene.analysis.util.ElisionFilter;
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.DeprecationCategory;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.IndexVersions;
|
||||
import org.elasticsearch.index.analysis.AnalyzerProvider;
|
||||
|
@ -120,21 +114,15 @@ import org.elasticsearch.index.analysis.PreConfiguredTokenFilter;
|
|||
import org.elasticsearch.index.analysis.PreConfiguredTokenizer;
|
||||
import org.elasticsearch.index.analysis.TokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.TokenizerFactory;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider;
|
||||
import org.elasticsearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy;
|
||||
import org.elasticsearch.lucene.analysis.miscellaneous.DisableGraphAttribute;
|
||||
import org.elasticsearch.plugins.AnalysisPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ScriptPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptContext;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.synonyms.SynonymsManagementAPIService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.tartarus.snowball.ext.DutchStemmer;
|
||||
import org.tartarus.snowball.ext.FrenchStemmer;
|
||||
|
||||
|
@ -144,7 +132,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.plugins.AnalysisPlugin.requiresAnalysisSettings;
|
||||
|
||||
|
@ -156,24 +143,9 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
private final SetOnce<SynonymsManagementAPIService> synonymsManagementServiceHolder = new SetOnce<>();
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
this.scriptServiceHolder.set(scriptService);
|
||||
this.synonymsManagementServiceHolder.set(new SynonymsManagementAPIService(client));
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
this.scriptServiceHolder.set(services.scriptService());
|
||||
this.synonymsManagementServiceHolder.set(new SynonymsManagementAPIService(services.client()));
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,33 +9,19 @@
|
|||
package org.elasticsearch.telemetry.apm;
|
||||
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.NetworkPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.TelemetryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.telemetry.apm.internal.APMAgentSettings;
|
||||
import org.elasticsearch.telemetry.apm.internal.APMMeterService;
|
||||
import org.elasticsearch.telemetry.apm.internal.APMTelemetryProvider;
|
||||
import org.elasticsearch.telemetry.apm.internal.tracing.APMTracer;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* This module integrates Elastic's APM product with Elasticsearch. Elasticsearch has
|
||||
|
@ -73,31 +59,16 @@ public class APM extends Plugin implements NetworkPlugin, TelemetryPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider unused,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
final APMTracer apmTracer = telemetryProvider.get().getTracer();
|
||||
|
||||
apmTracer.setClusterName(clusterService.getClusterName().value());
|
||||
apmTracer.setNodeName(clusterService.getNodeName());
|
||||
apmTracer.setClusterName(services.clusterService().getClusterName().value());
|
||||
apmTracer.setNodeName(services.clusterService().getNodeName());
|
||||
|
||||
final APMAgentSettings apmAgentSettings = new APMAgentSettings();
|
||||
apmAgentSettings.syncAgentSystemProperties(settings);
|
||||
final APMMeterService apmMeter = new APMMeterService(settings);
|
||||
apmAgentSettings.addClusterSettingsListeners(clusterService, telemetryProvider.get(), apmMeter);
|
||||
apmAgentSettings.addClusterSettingsListeners(services.clusterService(), telemetryProvider.get(), apmMeter);
|
||||
|
||||
return List.of(apmTracer, apmMeter);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,9 @@ import org.elasticsearch.action.datastreams.GetDataStreamAction;
|
|||
import org.elasticsearch.action.datastreams.MigrateToDataStreamAction;
|
||||
import org.elasticsearch.action.datastreams.ModifyDataStreamsAction;
|
||||
import org.elasticsearch.action.datastreams.PromoteDataStreamAction;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.client.internal.OriginSettingClient;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
|
@ -60,20 +56,11 @@ import org.elasticsearch.datastreams.rest.RestGetDataStreamsAction;
|
|||
import org.elasticsearch.datastreams.rest.RestMigrateToDataStreamAction;
|
||||
import org.elasticsearch.datastreams.rest.RestModifyDataStreamsAction;
|
||||
import org.elasticsearch.datastreams.rest.RestPromoteDataStreamAction;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexSettingProvider;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Clock;
|
||||
|
@ -158,38 +145,27 @@ public class DataStreamsPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
|
||||
Collection<Object> components = new ArrayList<>();
|
||||
var updateTimeSeriesRangeService = new UpdateTimeSeriesRangeService(environment.settings(), threadPool, clusterService);
|
||||
var updateTimeSeriesRangeService = new UpdateTimeSeriesRangeService(
|
||||
services.environment().settings(),
|
||||
services.threadPool(),
|
||||
services.clusterService()
|
||||
);
|
||||
this.updateTimeSeriesRangeService.set(updateTimeSeriesRangeService);
|
||||
components.add(this.updateTimeSeriesRangeService.get());
|
||||
errorStoreInitialisationService.set(new DataStreamLifecycleErrorStore());
|
||||
dataLifecycleInitialisationService.set(
|
||||
new DataStreamLifecycleService(
|
||||
settings,
|
||||
new OriginSettingClient(client, DATA_STREAM_LIFECYCLE_ORIGIN),
|
||||
clusterService,
|
||||
new OriginSettingClient(services.client(), DATA_STREAM_LIFECYCLE_ORIGIN),
|
||||
services.clusterService(),
|
||||
getClock(),
|
||||
threadPool,
|
||||
threadPool::absoluteTimeInMillis,
|
||||
services.threadPool(),
|
||||
services.threadPool()::absoluteTimeInMillis,
|
||||
errorStoreInitialisationService.get(),
|
||||
allocationService
|
||||
services.allocationService()
|
||||
)
|
||||
);
|
||||
dataLifecycleInitialisationService.get().init();
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.client.internal.Client;
|
|||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
|
@ -25,9 +24,6 @@ import org.elasticsearch.common.settings.Setting;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.common.settings.SettingsModule;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.ingest.IngestService;
|
||||
import org.elasticsearch.ingest.Processor;
|
||||
|
@ -43,14 +39,10 @@ import org.elasticsearch.plugins.IngestPlugin;
|
|||
import org.elasticsearch.plugins.PersistentTaskPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xcontent.XContentBuilder;
|
||||
|
@ -107,30 +99,20 @@ public class IngestGeoIpPlugin extends Plugin implements IngestPlugin, SystemInd
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
try {
|
||||
String nodeId = nodeEnvironment.nodeId();
|
||||
databaseRegistry.get().initialize(nodeId, resourceWatcherService, ingestService.get());
|
||||
String nodeId = services.nodeEnvironment().nodeId();
|
||||
databaseRegistry.get().initialize(nodeId, services.resourceWatcherService(), ingestService.get());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
|
||||
geoIpDownloaderTaskExecutor = new GeoIpDownloaderTaskExecutor(client, new HttpClient(), clusterService, threadPool);
|
||||
geoIpDownloaderTaskExecutor = new GeoIpDownloaderTaskExecutor(
|
||||
services.client(),
|
||||
new HttpClient(),
|
||||
services.clusterService(),
|
||||
services.threadPool()
|
||||
);
|
||||
geoIpDownloaderTaskExecutor.init();
|
||||
return List.of(databaseRegistry.get(), geoIpDownloaderTaskExecutor);
|
||||
}
|
||||
|
|
|
@ -11,20 +11,13 @@ package org.elasticsearch.painless;
|
|||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.painless.action.PainlessContextAction;
|
||||
import org.elasticsearch.painless.action.PainlessExecuteAction;
|
||||
import org.elasticsearch.painless.spi.PainlessExtension;
|
||||
|
@ -36,17 +29,11 @@ import org.elasticsearch.plugins.ActionPlugin;
|
|||
import org.elasticsearch.plugins.ExtensiblePlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ScriptPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptContext;
|
||||
import org.elasticsearch.script.ScriptEngine;
|
||||
import org.elasticsearch.script.ScriptModule;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -135,22 +122,7 @@ public final class PainlessPlugin extends Plugin implements ScriptPlugin, Extens
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
// this is a hack to bind the painless script engine in guice (all components are added to guice), so that
|
||||
// the painless context api. this is a temporary measure until transport actions do no require guice
|
||||
return Collections.singletonList(painlessScriptEngine.get());
|
||||
|
|
|
@ -12,35 +12,23 @@ import org.elasticsearch.action.ActionRequest;
|
|||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollTask;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||
import org.elasticsearch.index.reindex.ReindexAction;
|
||||
import org.elasticsearch.index.reindex.UpdateByQueryAction;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -95,23 +83,10 @@ public class ReindexPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
return Collections.singletonList(new ReindexSslConfig(environment.settings(), environment, resourceWatcherService));
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return Collections.singletonList(
|
||||
new ReindexSslConfig(services.environment().settings(), services.environment(), services.resourceWatcherService())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,38 +19,25 @@ import org.elasticsearch.action.search.SearchAction;
|
|||
import org.elasticsearch.action.support.ActionFilter;
|
||||
import org.elasticsearch.action.support.ActionFilterChain;
|
||||
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.SecureString;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.http.HttpInfo;
|
||||
import org.elasticsearch.index.reindex.ReindexAction;
|
||||
import org.elasticsearch.index.reindex.ReindexRequestBuilder;
|
||||
import org.elasticsearch.index.reindex.RemoteInfo;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestHeaderDefinition;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.rest.root.MainRestPlugin;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.netty4.Netty4Plugin;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.junit.Before;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -58,7 +45,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.singletonList;
|
||||
|
@ -164,23 +150,8 @@ public class ReindexFromRemoteWithAuthTests extends ESSingleNodeTestCase {
|
|||
private final SetOnce<ReindexFromRemoteWithAuthTests.TestFilter> testFilter = new SetOnce<>();
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
testFilter.set(new ReindexFromRemoteWithAuthTests.TestFilter(threadPool));
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
testFilter.set(new ReindexFromRemoteWithAuthTests.TestFilter(services.threadPool()));
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,30 +11,19 @@ package org.elasticsearch.repositories.azure;
|
|||
import com.azure.core.util.serializer.JacksonAdapter;
|
||||
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ReloadablePlugin;
|
||||
import org.elasticsearch.plugins.RepositoryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.repositories.Repository;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -42,7 +31,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* A plugin to add a repository type that writes to and from the Azure cloud storage service.
|
||||
|
@ -84,23 +72,8 @@ public class AzureRepositoryPlugin extends Plugin implements RepositoryPlugin, R
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
AzureClientProvider azureClientProvider = AzureClientProvider.create(threadPool, settings);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
AzureClientProvider azureClientProvider = AzureClientProvider.create(services.threadPool(), settings);
|
||||
azureStoreService.set(createAzureStorageService(settings, azureClientProvider));
|
||||
return List.of(azureClientProvider);
|
||||
}
|
||||
|
|
|
@ -12,29 +12,18 @@ import com.amazonaws.util.json.Jackson;
|
|||
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.SpecialPermission;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ReloadablePlugin;
|
||||
import org.elasticsearch.plugins.RepositoryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.repositories.Repository;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.telemetry.metric.MeterRegistry;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -45,7 +34,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* A plugin to add a repository type that writes to and from the AWS S3.
|
||||
|
@ -92,25 +80,10 @@ public class S3RepositoryPlugin extends Plugin implements RepositoryPlugin, Relo
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
service.set(s3Service(environment, clusterService.getSettings()));
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
service.set(s3Service(services.environment(), services.clusterService().getSettings()));
|
||||
this.service.get().refreshAndClearCache(S3ClientSettings.load(settings));
|
||||
meterRegistry.set(telemetryProvider.getMeterRegistry());
|
||||
meterRegistry.set(services.telemetryProvider().getMeterRegistry());
|
||||
return List.of(service);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,28 +9,17 @@
|
|||
package org.elasticsearch.plugin.repository.url;
|
||||
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.blobstore.url.http.URLHttpClient;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
import org.elasticsearch.core.IOUtils;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.RepositoryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.repositories.Repository;
|
||||
import org.elasticsearch.repositories.url.URLRepository;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -39,7 +28,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class URLRepositoryPlugin extends Plugin implements RepositoryPlugin {
|
||||
private final SetOnce<URLHttpClient.Factory> httpClientFactory = new SetOnce<>();
|
||||
|
@ -76,22 +64,7 @@ public class URLRepositoryPlugin extends Plugin implements RepositoryPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
|
||||
final URLHttpClient.Factory apacheURLHttpClientFactory = new URLHttpClient.Factory();
|
||||
|
||||
|
|
|
@ -8,28 +8,13 @@
|
|||
|
||||
package org.elasticsearch.runtimefields;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* The plugin class for all the runtime fields common functionality that requires large dependencies.
|
||||
|
@ -64,23 +49,8 @@ public final class RuntimeFieldsCommonPlugin extends Plugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
grokHelper.finishInitializing(threadPool);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
grokHelper.finishInitializing(services.threadPool());
|
||||
return List.of();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,29 +12,14 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.Build;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ClusterPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.Scheduler;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class SystemdPlugin extends Plugin implements ClusterPlugin {
|
||||
|
||||
|
@ -80,22 +65,7 @@ public class SystemdPlugin extends Plugin implements ClusterPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry namedWriteableRegistry,
|
||||
final IndexNameExpressionResolver expressionResolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
if (enabled == false) {
|
||||
extender.set(null);
|
||||
return List.of();
|
||||
|
@ -107,7 +77,7 @@ public class SystemdPlugin extends Plugin implements ClusterPlugin {
|
|||
* Therefore, every fifteen seconds we send systemd a message via sd_notify to extend the timeout by thirty seconds. We will cancel
|
||||
* this scheduled task after we successfully notify systemd that we are ready.
|
||||
*/
|
||||
extender.set(threadPool.scheduleWithFixedDelay(() -> {
|
||||
extender.set(services.threadPool().scheduleWithFixedDelay(() -> {
|
||||
final int rc = sd_notify(0, "EXTEND_TIMEOUT_USEC=30000000");
|
||||
if (rc < 0) {
|
||||
logger.warn("extending startup timeout via sd_notify failed with [{}]", rc);
|
||||
|
|
|
@ -15,11 +15,9 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResp
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.MappingMetadata;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
|
@ -28,20 +26,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ClusterPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ToXContent;
|
||||
import org.elasticsearch.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xcontent.XContentFactory;
|
||||
|
@ -55,7 +44,6 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
|
@ -402,22 +390,9 @@ public class SimpleClusterStateIT extends ESIntegTestCase {
|
|||
private final AtomicBoolean installed = new AtomicBoolean();
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry namedWriteableRegistry,
|
||||
final IndexNameExpressionResolver expressionResolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
ClusterService clusterService = services.clusterService();
|
||||
|
||||
clusterService.addListener(event -> {
|
||||
final ClusterState state = event.state();
|
||||
if (state.getBlocks().hasGlobalBlock(STATE_NOT_RECOVERED_BLOCK)) {
|
||||
|
|
|
@ -11,27 +11,15 @@ package org.elasticsearch.health;
|
|||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.metrics.Counters;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.health.node.HealthInfo;
|
||||
import org.elasticsearch.health.stats.HealthApiStatsAction;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.HealthPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -40,7 +28,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.elasticsearch.common.util.CollectionUtils.appendToCopy;
|
||||
|
@ -95,25 +82,10 @@ public class GetHealthActionIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
healthIndicatorServices.add(new IlmHealthIndicatorService(clusterService));
|
||||
healthIndicatorServices.add(new SlmHealthIndicatorService(clusterService));
|
||||
healthIndicatorServices.add(new ClusterCoordinationHealthIndicatorService(clusterService));
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
healthIndicatorServices.add(new IlmHealthIndicatorService(services.clusterService()));
|
||||
healthIndicatorServices.add(new SlmHealthIndicatorService(services.clusterService()));
|
||||
healthIndicatorServices.add(new ClusterCoordinationHealthIndicatorService(services.clusterService()));
|
||||
return new ArrayList<>(healthIndicatorServices);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,37 +9,22 @@
|
|||
package org.elasticsearch.health;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.health.node.DiskHealthInfo;
|
||||
import org.elasticsearch.health.node.FetchHealthInfoCacheAction;
|
||||
import org.elasticsearch.health.node.HealthInfo;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.HealthPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.test.InternalTestCluster;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.common.util.CollectionUtils.appendToCopy;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
@ -124,22 +109,7 @@ public class HealthServiceIT extends ESIntegTestCase {
|
|||
private final List<HealthIndicatorService> healthIndicatorServices = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
healthIndicatorServices.add(new TestHealthIndicatorService());
|
||||
return new ArrayList<>(healthIndicatorServices);
|
||||
}
|
||||
|
|
|
@ -17,17 +17,9 @@ import org.elasticsearch.action.ingest.GetPipelineResponse;
|
|||
import org.elasticsearch.action.ingest.PutPipelineRequest;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.ingest.AbstractProcessor;
|
||||
import org.elasticsearch.ingest.ConfigurationUtils;
|
||||
import org.elasticsearch.ingest.IngestDocument;
|
||||
|
@ -35,14 +27,8 @@ import org.elasticsearch.ingest.PipelineConfiguration;
|
|||
import org.elasticsearch.ingest.Processor;
|
||||
import org.elasticsearch.plugins.IngestPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.XContentType;
|
||||
import org.junit.After;
|
||||
|
||||
|
@ -52,7 +38,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.endsWith;
|
||||
|
@ -392,26 +377,6 @@ public class FinalPipelineIT extends ESIntegTestCase {
|
|||
|
||||
public static class TestPlugin extends Plugin implements IngestPlugin {
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry namedWriteableRegistry,
|
||||
final IndexNameExpressionResolver expressionResolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Processor.Factory> getProcessors(Processor.Parameters parameters) {
|
||||
return Map.of(
|
||||
|
|
|
@ -7,33 +7,18 @@
|
|||
*/
|
||||
package org.elasticsearch.index;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.AbstractModule;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
|
@ -63,22 +48,7 @@ public class SettingsListenerIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return Collections.singletonList(service);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,32 +13,18 @@ import org.elasticsearch.action.get.GetRequest;
|
|||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
import org.elasticsearch.action.ingest.PutPipelineRequest;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.IngestPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.XContentType;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
|
@ -85,23 +71,8 @@ public class IngestAsyncProcessorIT extends ESSingleNodeTestCase {
|
|||
private ThreadPool threadPool;
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
this.threadPool = threadPool;
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
this.threadPool = services.threadPool();
|
||||
return List.of();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,23 +11,17 @@ import org.apache.lucene.tests.util.LuceneTestCase;
|
|||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.bootstrap.BootstrapCheck;
|
||||
import org.elasticsearch.bootstrap.BootstrapContext;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.ReferenceDocs;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||
import org.elasticsearch.core.RestApiVersion;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.gateway.PersistedClusterStateService;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexService;
|
||||
|
@ -43,18 +37,14 @@ import org.elasticsearch.plugins.ClusterCoordinationPlugin;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.PluginsServiceTests;
|
||||
import org.elasticsearch.plugins.RecoveryPlannerPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.InternalTestCluster;
|
||||
import org.elasticsearch.test.MockHttpTransport;
|
||||
import org.elasticsearch.test.rest.FakeRestRequest;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.ContextParser;
|
||||
import org.elasticsearch.xcontent.MediaType;
|
||||
import org.elasticsearch.xcontent.NamedObjectNotFoundException;
|
||||
|
@ -77,7 +67,6 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.test.NodeRoles.dataNode;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
|
@ -442,22 +431,7 @@ public class NodeTests extends ESTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
List<Object> components = new ArrayList<>();
|
||||
components.add(new PluginComponentBinding<>(MyInterface.class, getRandomBool() ? new Foo() : new Bar()));
|
||||
return components;
|
||||
|
|
|
@ -8,38 +8,24 @@
|
|||
|
||||
package org.elasticsearch.plugins;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.health.HealthIndicatorService;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.analysis.TokenFilterFactory;
|
||||
import org.elasticsearch.index.engine.EngineFactory;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.indices.breaker.BreakerSettings;
|
||||
import org.elasticsearch.indices.recovery.plan.RecoveryPlannerService;
|
||||
import org.elasticsearch.indices.recovery.plan.ShardSnapshotsService;
|
||||
import org.elasticsearch.ingest.Processor;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.PrivilegedOperations;
|
||||
import org.elasticsearch.test.compiler.InMemoryJavaCompiler;
|
||||
import org.elasticsearch.test.jar.JarUtils;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
@ -259,22 +245,7 @@ public class PluginIntrospectorTests extends ESTestCase {
|
|||
public void testOverriddenMethodsBasic() {
|
||||
class FooPlugin extends Plugin {
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,31 +11,18 @@ package org.elasticsearch.test.seektracker;
|
|||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -66,22 +53,7 @@ public class SeekTrackerPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return Collections.singletonList(seekStatsService);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,18 +7,11 @@
|
|||
*/
|
||||
package org.elasticsearch.test;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexService;
|
||||
|
@ -27,21 +20,13 @@ import org.elasticsearch.index.shard.IndexEventListener;
|
|||
import org.elasticsearch.index.shard.IndexShard;
|
||||
import org.elasticsearch.index.shard.IndexShardState;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* This is a testing plugin that registers a generic
|
||||
|
@ -76,22 +61,7 @@ public final class MockIndexEventListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return Collections.singletonList(listener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,27 +8,14 @@ package org.elasticsearch.xpack.analytics;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.mapper.Mapper;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.MapperPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SearchPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.analytics.action.AnalyticsInfoTransportAction;
|
||||
import org.elasticsearch.xpack.analytics.action.AnalyticsUsageTransportAction;
|
||||
import org.elasticsearch.xpack.analytics.action.TransportAnalyticsStatsAction;
|
||||
|
@ -64,7 +51,6 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class AnalyticsPlugin extends Plugin implements SearchPlugin, ActionPlugin, MapperPlugin {
|
||||
private final AnalyticsUsage usage = new AnalyticsUsage();
|
||||
|
@ -175,22 +161,7 @@ public class AnalyticsPlugin extends Plugin implements SearchPlugin, ActionPlugi
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return List.of(usage);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,33 +7,18 @@
|
|||
|
||||
package org.elasticsearch.xpack.async;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.client.internal.OriginSettingClient;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.async.AsyncTaskIndexService;
|
||||
import org.elasticsearch.xpack.core.async.AsyncTaskMaintenanceService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ASYNC_SEARCH_ORIGIN;
|
||||
|
||||
|
@ -61,31 +46,16 @@ public class AsyncResultsIndexPlugin extends Plugin implements SystemIndexPlugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
List<Object> components = new ArrayList<>();
|
||||
if (DiscoveryNode.canContainData(environment.settings())) {
|
||||
if (DiscoveryNode.canContainData(services.environment().settings())) {
|
||||
// only data nodes should be eligible to run the maintenance service.
|
||||
AsyncTaskMaintenanceService maintenanceService = new AsyncTaskMaintenanceService(
|
||||
clusterService,
|
||||
nodeEnvironment.nodeId(),
|
||||
services.clusterService(),
|
||||
services.nodeEnvironment().nodeId(),
|
||||
settings,
|
||||
threadPool,
|
||||
new OriginSettingClient(client, ASYNC_SEARCH_ORIGIN)
|
||||
services.threadPool(),
|
||||
new OriginSettingClient(services.client(), ASYNC_SEARCH_ORIGIN)
|
||||
);
|
||||
components.add(maintenanceService);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ package org.elasticsearch.xpack.autoscaling;
|
|||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.NamedDiff;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
|
@ -23,22 +22,14 @@ import org.elasticsearch.common.settings.IndexScopedSettings;
|
|||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicensedFeature;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.ExtensiblePlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.reservedstate.ReservedClusterStateHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xpack.autoscaling.action.DeleteAutoscalingPolicyAction;
|
||||
|
@ -109,27 +100,16 @@ public class Autoscaling extends Plugin implements ActionPlugin, ExtensiblePlugi
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
this.clusterServiceHolder.set(clusterService);
|
||||
this.allocationServiceHolder.set(allocationService);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
this.clusterServiceHolder.set(services.clusterService());
|
||||
this.allocationServiceHolder.set(services.allocationService());
|
||||
var capacityServiceHolder = new AutoscalingCalculateCapacityService.Holder(this);
|
||||
this.reservedAutoscalingPolicyAction.set(new ReservedAutoscalingPolicyAction(capacityServiceHolder));
|
||||
return List.of(capacityServiceHolder, autoscalingLicenseChecker, new AutoscalingNodeInfoService(clusterService, client));
|
||||
return List.of(
|
||||
capacityServiceHolder,
|
||||
autoscalingLicenseChecker,
|
||||
new AutoscalingNodeInfoService(services.clusterService(), services.client())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.client.internal.Client;
|
|||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
|
@ -30,11 +29,9 @@ import org.elasticsearch.common.settings.SettingsFilter;
|
|||
import org.elasticsearch.common.settings.SettingsModule;
|
||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.engine.EngineFactory;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||
import org.elasticsearch.persistent.PersistentTaskParams;
|
||||
import org.elasticsearch.persistent.PersistentTasksExecutor;
|
||||
|
@ -44,17 +41,13 @@ import org.elasticsearch.plugins.EnginePlugin;
|
|||
import org.elasticsearch.plugins.PersistentTaskPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.RepositoryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.repositories.Repository;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.FixedExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xpack.ccr.action.AutoFollowCoordinator;
|
||||
|
@ -177,44 +170,29 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("HiddenField")
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry namedWriteableRegistry,
|
||||
final IndexNameExpressionResolver expressionResolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
this.client = client;
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
this.client = services.client();
|
||||
if (enabled == false) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
CcrSettings ccrSettings = new CcrSettings(settings, clusterService.getClusterSettings());
|
||||
CcrSettings ccrSettings = new CcrSettings(settings, services.clusterService().getClusterSettings());
|
||||
this.ccrSettings.set(ccrSettings);
|
||||
CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService(threadPool, ccrSettings);
|
||||
CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService(services.threadPool(), ccrSettings);
|
||||
this.restoreSourceService.set(restoreSourceService);
|
||||
return Arrays.asList(
|
||||
return List.of(
|
||||
ccrLicenseChecker,
|
||||
restoreSourceService,
|
||||
new CcrRepositoryManager(settings, clusterService, client),
|
||||
new ShardFollowTaskCleaner(clusterService, threadPool, client),
|
||||
new CcrRepositoryManager(settings, services.clusterService(), client),
|
||||
new ShardFollowTaskCleaner(services.clusterService(), services.threadPool(), client),
|
||||
new AutoFollowCoordinator(
|
||||
settings,
|
||||
client,
|
||||
clusterService,
|
||||
services.clusterService(),
|
||||
ccrLicenseChecker,
|
||||
threadPool::relativeTimeInMillis,
|
||||
threadPool::absoluteTimeInMillis,
|
||||
threadPool.executor(Ccr.CCR_THREAD_POOL_NAME)
|
||||
services.threadPool()::relativeTimeInMillis,
|
||||
services.threadPool()::absoluteTimeInMillis,
|
||||
services.threadPool().executor(Ccr.CCR_THREAD_POOL_NAME)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,17 +13,14 @@ import org.elasticsearch.SpecialPermission;
|
|||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.support.TransportAction;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.DeprecationCategory;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
|
@ -35,12 +32,10 @@ import org.elasticsearch.common.ssl.SslConfiguration;
|
|||
import org.elasticsearch.common.util.BigArrays;
|
||||
import org.elasticsearch.core.Booleans;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexSettingProvider;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.engine.EngineFactory;
|
||||
import org.elasticsearch.index.mapper.MetadataFieldMapper;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||
import org.elasticsearch.license.ClusterStateLicenseService;
|
||||
import org.elasticsearch.license.DeleteLicenseAction;
|
||||
|
@ -83,14 +78,10 @@ import org.elasticsearch.plugins.RepositoryPlugin;
|
|||
import org.elasticsearch.protocol.xpack.XPackInfoRequest;
|
||||
import org.elasticsearch.protocol.xpack.XPackInfoResponse;
|
||||
import org.elasticsearch.protocol.xpack.XPackUsageRequest;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.repositories.Repository;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;
|
||||
|
@ -321,33 +312,24 @@ public class XPackPlugin extends XPackClientPlugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
List<Object> components = new ArrayList<>();
|
||||
|
||||
final SSLService sslService = createSSLService(environment, resourceWatcherService);
|
||||
final SSLService sslService = createSSLService(services.environment(), services.resourceWatcherService());
|
||||
|
||||
LicenseService licenseService = getLicenseService();
|
||||
if (licenseService == null) {
|
||||
licenseService = new ClusterStateLicenseService(settings, threadPool, clusterService, getClock(), getLicenseState());
|
||||
licenseService = new ClusterStateLicenseService(
|
||||
settings,
|
||||
services.threadPool(),
|
||||
services.clusterService(),
|
||||
getClock(),
|
||||
getLicenseState()
|
||||
);
|
||||
setLicenseService(licenseService);
|
||||
}
|
||||
|
||||
setEpochMillisSupplier(threadPool::absoluteTimeInMillis);
|
||||
setEpochMillisSupplier(services.threadPool()::absoluteTimeInMillis);
|
||||
|
||||
// It is useful to override these as they are what guice is injecting into actions
|
||||
components.add(sslService);
|
||||
|
|
|
@ -8,31 +8,18 @@ package org.elasticsearch.xpack.deprecation;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.RateLimitingFilter;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.deprecation.logging.DeprecationCacheResetAction;
|
||||
import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingComponent;
|
||||
import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingTemplateRegistry;
|
||||
|
@ -88,43 +75,29 @@ public class Deprecation extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
final DeprecationIndexingTemplateRegistry templateRegistry = new DeprecationIndexingTemplateRegistry(
|
||||
environment.settings(),
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.environment().settings(),
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
templateRegistry.initialize();
|
||||
|
||||
final RateLimitingFilter rateLimitingFilterForIndexing = new RateLimitingFilter();
|
||||
// enable on start.
|
||||
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.get(environment.settings()));
|
||||
clusterService.getClusterSettings()
|
||||
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.get(services.environment().settings()));
|
||||
services.clusterService()
|
||||
.getClusterSettings()
|
||||
.addSettingsUpdateConsumer(USE_X_OPAQUE_ID_IN_FILTERING, rateLimitingFilterForIndexing::setUseXOpaqueId);
|
||||
|
||||
final DeprecationIndexingComponent component = DeprecationIndexingComponent.createDeprecationIndexingComponent(
|
||||
client,
|
||||
environment.settings(),
|
||||
services.client(),
|
||||
services.environment().settings(),
|
||||
rateLimitingFilterForIndexing,
|
||||
WRITE_DEPRECATION_LOGS_TO_INDEX.get(environment.settings()), // pass the default on startup
|
||||
clusterService
|
||||
WRITE_DEPRECATION_LOGS_TO_INDEX.get(services.environment().settings()), // pass the default on startup
|
||||
services.clusterService()
|
||||
);
|
||||
|
||||
return List.of(component, rateLimitingFilterForIndexing);
|
||||
|
|
|
@ -8,13 +8,10 @@ package org.elasticsearch.xpack.enrich;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.NamedDiff;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
|
@ -22,22 +19,14 @@ import org.elasticsearch.common.settings.Setting;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.ingest.Processor;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.IngestPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
|
@ -189,44 +178,29 @@ public class EnrichPlugin extends Plugin implements SystemIndexPlugin, IngestPlu
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
EnrichPolicyLocks enrichPolicyLocks = new EnrichPolicyLocks();
|
||||
EnrichPolicyExecutor enrichPolicyExecutor = new EnrichPolicyExecutor(
|
||||
settings,
|
||||
clusterService,
|
||||
indicesService,
|
||||
client,
|
||||
threadPool,
|
||||
expressionResolver,
|
||||
services.clusterService(),
|
||||
services.indicesService(),
|
||||
services.client(),
|
||||
services.threadPool(),
|
||||
services.indexNameExpressionResolver(),
|
||||
enrichPolicyLocks,
|
||||
System::currentTimeMillis
|
||||
);
|
||||
EnrichPolicyMaintenanceService enrichPolicyMaintenanceService = new EnrichPolicyMaintenanceService(
|
||||
settings,
|
||||
client,
|
||||
clusterService,
|
||||
threadPool,
|
||||
services.client(),
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
enrichPolicyLocks
|
||||
);
|
||||
enrichPolicyMaintenanceService.initialize();
|
||||
return List.of(
|
||||
enrichPolicyLocks,
|
||||
new EnrichCoordinatorProxyAction.Coordinator(client, settings),
|
||||
new EnrichCoordinatorProxyAction.Coordinator(services.client(), settings),
|
||||
enrichPolicyMaintenanceService,
|
||||
enrichPolicyExecutor,
|
||||
enrichCache
|
||||
|
|
|
@ -9,20 +9,13 @@ package org.elasticsearch.xpack.application;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.logging.LogManager;
|
||||
|
@ -31,14 +24,8 @@ import org.elasticsearch.plugins.ActionPlugin;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SearchPlugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.application.analytics.AnalyticsTemplateRegistry;
|
||||
import org.elasticsearch.xpack.application.analytics.action.DeleteAnalyticsCollectionAction;
|
||||
import org.elasticsearch.xpack.application.analytics.action.GetAnalyticsCollectionAction;
|
||||
|
@ -197,41 +184,26 @@ public class EnterpriseSearch extends Plugin implements ActionPlugin, SystemInde
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
if (enabled == false) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// Behavioral analytics components
|
||||
final AnalyticsTemplateRegistry analyticsTemplateRegistry = new AnalyticsTemplateRegistry(
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
analyticsTemplateRegistry.initialize();
|
||||
|
||||
// Connector components
|
||||
final ConnectorTemplateRegistry connectorTemplateRegistry = new ConnectorTemplateRegistry(
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
connectorTemplateRegistry.initialize();
|
||||
|
||||
|
|
|
@ -12,32 +12,21 @@ import org.elasticsearch.action.ActionResponse;
|
|||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.breaker.BreakerSettings;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.monitor.jvm.JvmInfo;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.CircuitBreakerPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
|
@ -71,23 +60,8 @@ public class EqlPlugin extends Plugin implements ActionPlugin, CircuitBreakerPlu
|
|||
public EqlPlugin() {}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
return createComponents(client, environment.settings(), clusterService);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return createComponents(services.client(), services.environment().settings(), services.clusterService());
|
||||
}
|
||||
|
||||
private Collection<Object> createComponents(Client client, Settings settings, ClusterService clusterService) {
|
||||
|
|
|
@ -8,11 +8,8 @@ package org.elasticsearch.xpack.esql.plugin;
|
|||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
|
@ -33,21 +30,13 @@ import org.elasticsearch.compute.operator.exchange.ExchangeService;
|
|||
import org.elasticsearch.compute.operator.exchange.ExchangeSinkOperator;
|
||||
import org.elasticsearch.compute.operator.exchange.ExchangeSourceOperator;
|
||||
import org.elasticsearch.compute.operator.topn.TopNOperatorStatus;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.FixedExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
import org.elasticsearch.xpack.esql.EsqlInfoTransportAction;
|
||||
|
@ -88,28 +77,25 @@ public class EsqlPlugin extends Plugin implements ActionPlugin {
|
|||
);
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
CircuitBreaker circuitBreaker = indicesService.getBigArrays().breakerService().getBreaker("request");
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
CircuitBreaker circuitBreaker = services.indicesService().getBigArrays().breakerService().getBreaker("request");
|
||||
Objects.requireNonNull(circuitBreaker, "request circuit breaker wasn't set");
|
||||
BlockFactory blockFactory = new BlockFactory(circuitBreaker, indicesService.getBigArrays().withCircuitBreaking());
|
||||
BlockFactory blockFactory = new BlockFactory(circuitBreaker, services.indicesService().getBigArrays().withCircuitBreaking());
|
||||
return List.of(
|
||||
new PlanExecutor(new IndexResolver(client, clusterService.getClusterName().value(), EsqlDataTypeRegistry.INSTANCE, Set::of)),
|
||||
new ExchangeService(clusterService.getSettings(), threadPool, EsqlPlugin.ESQL_THREAD_POOL_NAME, blockFactory),
|
||||
new PlanExecutor(
|
||||
new IndexResolver(
|
||||
services.client(),
|
||||
services.clusterService().getClusterName().value(),
|
||||
EsqlDataTypeRegistry.INSTANCE,
|
||||
Set::of
|
||||
)
|
||||
),
|
||||
new ExchangeService(
|
||||
services.clusterService().getSettings(),
|
||||
services.threadPool(),
|
||||
EsqlPlugin.ESQL_THREAD_POOL_NAME,
|
||||
blockFactory
|
||||
),
|
||||
blockFactory
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,30 +23,19 @@ import org.elasticsearch.client.internal.Client;
|
|||
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.ExecutorNames;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemDataStreamDescriptor;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor.Type;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.XContentParser;
|
||||
import org.elasticsearch.xcontent.XContentParserConfiguration;
|
||||
import org.elasticsearch.xcontent.XContentType;
|
||||
|
@ -100,28 +89,13 @@ public class Fleet extends Plugin implements SystemIndexPlugin {
|
|||
private static final int FLEET_ACTIONS_RESULTS_MAPPINGS_VERSION = 1;
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
FleetTemplateRegistry registry = new FleetTemplateRegistry(
|
||||
environment.settings(),
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.environment().settings(),
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
registry.initialize();
|
||||
return List.of();
|
||||
|
|
|
@ -11,31 +11,18 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.security.SecurityContext;
|
||||
import org.elasticsearch.xpack.core.ssl.X509KeyPairSettings;
|
||||
|
@ -86,35 +73,24 @@ public class IdentityProviderPlugin extends Plugin implements ActionPlugin {
|
|||
private Settings settings;
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
settings = environment.settings();
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
settings = services.environment().settings();
|
||||
enabled = ENABLED_SETTING.get(settings);
|
||||
if (enabled == false) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
SamlInit.initialize();
|
||||
final SamlServiceProviderIndex index = new SamlServiceProviderIndex(client, clusterService);
|
||||
final SecurityContext securityContext = new SecurityContext(settings, threadPool.getThreadContext());
|
||||
final SamlServiceProviderIndex index = new SamlServiceProviderIndex(services.client(), services.clusterService());
|
||||
final SecurityContext securityContext = new SecurityContext(settings, services.threadPool().getThreadContext());
|
||||
|
||||
final ServiceProviderDefaults serviceProviderDefaults = ServiceProviderDefaults.forSettings(settings);
|
||||
final ApplicationActionsResolver actionsResolver = new ApplicationActionsResolver(settings, serviceProviderDefaults, client);
|
||||
final UserPrivilegeResolver userPrivilegeResolver = new UserPrivilegeResolver(client, securityContext, actionsResolver);
|
||||
final ApplicationActionsResolver actionsResolver = new ApplicationActionsResolver(
|
||||
settings,
|
||||
serviceProviderDefaults,
|
||||
services.client()
|
||||
);
|
||||
final UserPrivilegeResolver userPrivilegeResolver = new UserPrivilegeResolver(services.client(), securityContext, actionsResolver);
|
||||
|
||||
final SamlServiceProviderFactory serviceProviderFactory = new SamlServiceProviderFactory(serviceProviderDefaults);
|
||||
final SamlServiceProviderResolver registeredServiceProviderResolver = new SamlServiceProviderResolver(
|
||||
|
@ -123,13 +99,13 @@ public class IdentityProviderPlugin extends Plugin implements ActionPlugin {
|
|||
serviceProviderFactory
|
||||
);
|
||||
final WildcardServiceProviderResolver wildcardServiceProviderResolver = WildcardServiceProviderResolver.create(
|
||||
environment,
|
||||
resourceWatcherService,
|
||||
scriptService,
|
||||
services.environment(),
|
||||
services.resourceWatcherService(),
|
||||
services.scriptService(),
|
||||
serviceProviderFactory
|
||||
);
|
||||
final SamlIdentityProvider idp = SamlIdentityProvider.builder(registeredServiceProviderResolver, wildcardServiceProviderResolver)
|
||||
.fromSettings(environment)
|
||||
.fromSettings(services.environment())
|
||||
.serviceProviderDefaults(serviceProviderDefaults)
|
||||
.build();
|
||||
|
||||
|
|
|
@ -7,30 +7,18 @@
|
|||
package org.elasticsearch.xpack.ilm;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.ClusterStateObserver;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.AbstractModule;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
|
||||
import org.elasticsearch.xpack.core.ilm.UpdateSettingsStep;
|
||||
import org.junit.After;
|
||||
|
@ -39,7 +27,6 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
import static org.elasticsearch.xpack.ilm.UpdateSettingsStepTests.SettingsTestingService.INVALID_VALUE;
|
||||
|
@ -62,22 +49,7 @@ public class UpdateSettingsStepTests extends ESSingleNodeTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return List.of(service);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,37 +10,25 @@ import org.apache.lucene.util.SetOnce;
|
|||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.client.internal.OriginSettingClient;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.core.IOUtils;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.health.HealthIndicatorService;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.HealthPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.reservedstate.ReservedClusterStateHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xpack.cluster.action.MigrateToDataTiersAction;
|
||||
|
@ -154,48 +142,39 @@ public class IndexLifecycle extends Plugin implements ActionPlugin, HealthPlugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
final List<Object> components = new ArrayList<>();
|
||||
ILMHistoryTemplateRegistry ilmTemplateRegistry = new ILMHistoryTemplateRegistry(
|
||||
settings,
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
ilmTemplateRegistry.initialize();
|
||||
ilmHistoryStore.set(new ILMHistoryStore(new OriginSettingClient(client, INDEX_LIFECYCLE_ORIGIN), clusterService, threadPool));
|
||||
ilmHistoryStore.set(
|
||||
new ILMHistoryStore(
|
||||
new OriginSettingClient(services.client(), INDEX_LIFECYCLE_ORIGIN),
|
||||
services.clusterService(),
|
||||
services.threadPool()
|
||||
)
|
||||
);
|
||||
/*
|
||||
* Here we use threadPool::absoluteTimeInMillis rather than System::currentTimeInMillis because snapshot start time is set using
|
||||
* ThreadPool.absoluteTimeInMillis(). ThreadPool.absoluteTimeInMillis() returns a cached time that can be several hundred
|
||||
* milliseconds behind System.currentTimeMillis(). The result is that a snapshot taken after a policy is created can have a start
|
||||
* time that is before the policy's (or action's) start time if System::currentTimeInMillis is used here.
|
||||
*/
|
||||
LongSupplier nowSupplier = threadPool::absoluteTimeInMillis;
|
||||
LongSupplier nowSupplier = services.threadPool()::absoluteTimeInMillis;
|
||||
indexLifecycleInitialisationService.set(
|
||||
new IndexLifecycleService(
|
||||
settings,
|
||||
client,
|
||||
clusterService,
|
||||
threadPool,
|
||||
services.client(),
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
getClock(),
|
||||
nowSupplier,
|
||||
xContentRegistry,
|
||||
services.xContentRegistry(),
|
||||
ilmHistoryStore.get(),
|
||||
getLicenseState()
|
||||
)
|
||||
|
@ -204,15 +183,17 @@ public class IndexLifecycle extends Plugin implements ActionPlugin, HealthPlugin
|
|||
|
||||
ilmHealthIndicatorService.set(
|
||||
new IlmHealthIndicatorService(
|
||||
clusterService,
|
||||
services.clusterService(),
|
||||
new IlmHealthIndicatorService.StagnatingIndicesFinder(
|
||||
clusterService,
|
||||
services.clusterService(),
|
||||
IlmHealthIndicatorService.RULES_BY_ACTION_CONFIG.values(),
|
||||
System::currentTimeMillis
|
||||
)
|
||||
)
|
||||
);
|
||||
reservedLifecycleAction.set(new ReservedLifecycleAction(xContentRegistry, client, XPackPlugin.getSharedLicenseState()));
|
||||
reservedLifecycleAction.set(
|
||||
new ReservedLifecycleAction(services.xContentRegistry(), services.client(), XPackPlugin.getSharedLicenseState())
|
||||
);
|
||||
|
||||
return components;
|
||||
}
|
||||
|
|
|
@ -10,11 +10,8 @@ package org.elasticsearch.xpack.inference;
|
|||
import org.apache.lucene.util.SetOnce;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
|
@ -23,24 +20,15 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.core.IOUtils;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.InferenceServicePlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.ClientHelper;
|
||||
import org.elasticsearch.xpack.inference.action.DeleteInferenceModelAction;
|
||||
import org.elasticsearch.xpack.inference.action.GetInferenceModelAction;
|
||||
|
@ -108,25 +96,12 @@ public class InferencePlugin extends Plugin implements ActionPlugin, InferenceSe
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
httpManager.set(HttpClientManager.create(settings, threadPool, clusterService));
|
||||
httpRequestSenderFactory.set(new HttpRequestSenderFactory(threadPool, httpManager.get(), clusterService, settings));
|
||||
ModelRegistry modelRegistry = new ModelRegistry(client);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
httpManager.set(HttpClientManager.create(settings, services.threadPool(), services.clusterService()));
|
||||
httpRequestSenderFactory.set(
|
||||
new HttpRequestSenderFactory(services.threadPool(), httpManager.get(), services.clusterService(), settings)
|
||||
);
|
||||
ModelRegistry modelRegistry = new ModelRegistry(services.client());
|
||||
return List.of(modelRegistry);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata;
|
|||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
|
@ -45,12 +44,10 @@ import org.elasticsearch.common.unit.Processors;
|
|||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.analysis.CharFilterFactory;
|
||||
import org.elasticsearch.index.analysis.TokenizerFactory;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.indices.AssociatedIndexDescriptor;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider;
|
||||
import org.elasticsearch.indices.breaker.BreakerSettings;
|
||||
|
@ -73,15 +70,11 @@ import org.elasticsearch.plugins.Plugin;
|
|||
import org.elasticsearch.plugins.SearchPlugin;
|
||||
import org.elasticsearch.plugins.ShutdownAwarePlugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.ContextParser;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
|
@ -884,22 +877,14 @@ public class MachineLearning extends Plugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
Environment environment = services.environment();
|
||||
NamedXContentRegistry xContentRegistry = services.xContentRegistry();
|
||||
IndexNameExpressionResolver indexNameExpressionResolver = services.indexNameExpressionResolver();
|
||||
|
||||
if (enabled == false) {
|
||||
// Holders for @link(MachineLearningFeatureSetUsage) which needs access to job manager and ML extension,
|
||||
// both empty if ML is disabled
|
||||
|
|
|
@ -12,17 +12,12 @@ import org.elasticsearch.client.internal.Client;
|
|||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicenseService;
|
||||
import org.elasticsearch.license.LicensedFeature;
|
||||
|
@ -30,14 +25,9 @@ import org.elasticsearch.license.XPackLicenseState;
|
|||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ReloadablePlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
|
@ -118,22 +108,11 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
|
||||
final ClusterSettings clusterSettings = clusterService.getClusterSettings();
|
||||
final CleanerService cleanerService = new CleanerService(settings, clusterSettings, threadPool);
|
||||
final SSLService dynamicSSLService = getSslService().createDynamicSSLService();
|
||||
|
@ -157,7 +136,14 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
|
|||
Set<Collector> collectors = new HashSet<>();
|
||||
collectors.add(new IndexStatsCollector(clusterService, getLicenseState(), client));
|
||||
collectors.add(
|
||||
new ClusterStatsCollector(settings, clusterService, getLicenseState(), client, getLicenseService(), expressionResolver)
|
||||
new ClusterStatsCollector(
|
||||
settings,
|
||||
clusterService,
|
||||
getLicenseState(),
|
||||
client,
|
||||
getLicenseService(),
|
||||
services.indexNameExpressionResolver()
|
||||
)
|
||||
);
|
||||
collectors.add(new ShardsCollector(clusterService, getLicenseState()));
|
||||
collectors.add(new NodeStatsCollector(clusterService, getLicenseState(), client));
|
||||
|
@ -175,7 +161,7 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
|
|||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.xContentRegistry()
|
||||
);
|
||||
templateRegistry.initialize();
|
||||
|
||||
|
|
|
@ -14,23 +14,17 @@ import org.apache.lucene.util.SetOnce;
|
|||
import org.elasticsearch.Build;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.ReferenceDocs;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.lucene.Lucene;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.index.IndexVersion;
|
||||
|
@ -41,7 +35,6 @@ import org.elasticsearch.index.seqno.SequenceNumbers;
|
|||
import org.elasticsearch.index.shard.IndexEventListener;
|
||||
import org.elasticsearch.index.shard.IndexShard;
|
||||
import org.elasticsearch.index.translog.TranslogStats;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicenseUtils;
|
||||
import org.elasticsearch.license.LicensedFeature;
|
||||
|
@ -52,15 +45,10 @@ import org.elasticsearch.plugins.EnginePlugin;
|
|||
import org.elasticsearch.plugins.IndexStorePlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.RepositoryPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.snapshots.SnapshotRestoreException;
|
||||
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
|
@ -75,7 +63,6 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class OldLuceneVersions extends Plugin implements IndexStorePlugin, ClusterPlugin, RepositoryPlugin, ActionPlugin, EnginePlugin {
|
||||
|
||||
|
@ -90,24 +77,12 @@ public class OldLuceneVersions extends Plugin implements IndexStorePlugin, Clust
|
|||
private final SetOnce<FailShardsOnInvalidLicenseClusterListener> failShardsListener = new SetOnce<>();
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry registry,
|
||||
final IndexNameExpressionResolver resolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
|
||||
this.failShardsListener.set(new FailShardsOnInvalidLicenseClusterListener(getLicenseState(), clusterService.getRerouteService()));
|
||||
if (DiscoveryNode.isMasterNode(environment.settings())) {
|
||||
if (DiscoveryNode.isMasterNode(services.environment().settings())) {
|
||||
// We periodically look through the indices and identify if there are any archive indices,
|
||||
// then marking the feature as used. We do this on each master node so that if one master fails, the
|
||||
// continue reporting usage state.
|
||||
|
|
|
@ -15,30 +15,20 @@ import org.elasticsearch.action.ActionResponse;
|
|||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.XPackSettings;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
|
@ -81,24 +71,13 @@ public class ProfilingPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
|
||||
logger.info("Profiling is {}", enabled ? "enabled" : "disabled");
|
||||
registry.set(new ProfilingIndexTemplateRegistry(settings, clusterService, threadPool, client, xContentRegistry));
|
||||
registry.set(new ProfilingIndexTemplateRegistry(settings, clusterService, threadPool, client, services.xContentRegistry()));
|
||||
indexStateResolver.set(new IndexStateResolver(PROFILING_CHECK_OUTDATED_INDICES.get(settings)));
|
||||
clusterService.getClusterSettings().addSettingsUpdateConsumer(PROFILING_CHECK_OUTDATED_INDICES, this::updateCheckOutdatedIndices);
|
||||
|
||||
|
|
|
@ -23,13 +23,11 @@ import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
|||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RerouteService;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
||||
import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
|
@ -41,7 +39,6 @@ import org.elasticsearch.common.util.concurrent.EsExecutors;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
|
@ -51,7 +48,6 @@ import org.elasticsearch.index.engine.frozen.FrozenEngine;
|
|||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.translog.Translog;
|
||||
import org.elasticsearch.index.translog.TranslogStats;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.license.LicenseUtils;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
|
@ -67,15 +63,11 @@ import org.elasticsearch.repositories.RepositoryData;
|
|||
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
|
||||
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
|
@ -319,24 +311,14 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
final Client client,
|
||||
final ClusterService clusterService,
|
||||
final ThreadPool threadPool,
|
||||
final ResourceWatcherService resourceWatcherService,
|
||||
final ScriptService scriptService,
|
||||
final NamedXContentRegistry xContentRegistry,
|
||||
final Environment environment,
|
||||
final NodeEnvironment nodeEnvironment,
|
||||
final NamedWriteableRegistry registry,
|
||||
final IndexNameExpressionResolver resolver,
|
||||
final Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
NodeEnvironment nodeEnvironment = services.nodeEnvironment();
|
||||
|
||||
final List<Object> components = new ArrayList<>();
|
||||
this.repositoriesServiceSupplier = repositoriesServiceSupplier;
|
||||
this.repositoriesServiceSupplier = services.repositoriesServiceSupplier();
|
||||
this.threadPool.set(threadPool);
|
||||
this.failShardsListener.set(new FailShardsOnInvalidLicenseClusterListener(getLicenseState(), clusterService.getRerouteService()));
|
||||
if (DiscoveryNode.canContainData(settings)) {
|
||||
|
@ -364,7 +346,7 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng
|
|||
PersistentCache.cleanUp(settings, nodeEnvironment);
|
||||
}
|
||||
|
||||
if (DiscoveryNode.isMasterNode(environment.settings())) {
|
||||
if (DiscoveryNode.isMasterNode(services.environment().settings())) {
|
||||
// Tracking usage of searchable snapshots is too costly to do on each individually mounted snapshot.
|
||||
// Instead, we periodically look through the indices and identify if any are searchable snapshots,
|
||||
// then marking the feature as used. We do this on each master node so that if one master fails, the
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|||
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.CheckedBiConsumer;
|
||||
import org.elasticsearch.common.Strings;
|
||||
|
@ -53,7 +52,6 @@ import org.elasticsearch.common.util.concurrent.ThreadContext;
|
|||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.env.NodeMetadata;
|
||||
import org.elasticsearch.http.HttpPreRequest;
|
||||
import org.elasticsearch.http.HttpServerTransport;
|
||||
|
@ -61,7 +59,6 @@ import org.elasticsearch.http.netty4.Netty4HttpServerTransport;
|
|||
import org.elasticsearch.http.netty4.internal.HttpHeadersAuthenticatorUtils;
|
||||
import org.elasticsearch.http.netty4.internal.HttpValidator;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
||||
import org.elasticsearch.ingest.Processor;
|
||||
|
@ -81,7 +78,6 @@ import org.elasticsearch.plugins.ReloadablePlugin;
|
|||
import org.elasticsearch.plugins.SearchPlugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.plugins.interceptor.RestServerActionPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.reservedstate.ReservedClusterStateHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
|
@ -90,7 +86,6 @@ import org.elasticsearch.rest.RestRequest;
|
|||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.search.internal.ShardSearchRequest;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.telemetry.tracing.Tracer;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.FixedExecutorBuilder;
|
||||
|
@ -624,33 +619,18 @@ public class Security extends Plugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
try {
|
||||
return createComponents(
|
||||
client,
|
||||
threadPool,
|
||||
clusterService,
|
||||
resourceWatcherService,
|
||||
scriptService,
|
||||
xContentRegistry,
|
||||
environment,
|
||||
nodeEnvironment.nodeMetadata(),
|
||||
expressionResolver
|
||||
services.client(),
|
||||
services.threadPool(),
|
||||
services.clusterService(),
|
||||
services.resourceWatcherService(),
|
||||
services.scriptService(),
|
||||
services.xContentRegistry(),
|
||||
services.environment(),
|
||||
services.nodeEnvironment().nodeMetadata(),
|
||||
services.indexNameExpressionResolver()
|
||||
);
|
||||
} catch (final Exception e) {
|
||||
throw new IllegalStateException("security initialization failed", e);
|
||||
|
|
|
@ -21,15 +21,11 @@ import org.elasticsearch.cluster.ClusterStateListener;
|
|||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.settings.SettingsModule;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.persistent.AllocatedPersistentTask;
|
||||
import org.elasticsearch.persistent.PersistentTaskParams;
|
||||
import org.elasticsearch.persistent.PersistentTaskState;
|
||||
|
@ -38,12 +34,8 @@ import org.elasticsearch.persistent.PersistentTasksExecutor;
|
|||
import org.elasticsearch.persistent.PersistentTasksService;
|
||||
import org.elasticsearch.plugins.PersistentTaskPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ObjectParser;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
|
@ -57,7 +49,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
|
@ -134,23 +125,8 @@ public class NodeShutdownTasksIT extends ESIntegTestCase {
|
|||
TaskExecutor taskExecutor;
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
taskExecutor = new TaskExecutor(client, clusterService, threadPool);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
taskExecutor = new TaskExecutor(services.client(), services.clusterService(), services.threadPool());
|
||||
return Collections.singletonList(taskExecutor);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,29 +9,16 @@ package org.elasticsearch.xpack.shutdown;
|
|||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -41,24 +28,9 @@ import java.util.function.Supplier;
|
|||
|
||||
public class ShutdownPlugin extends Plugin implements ActionPlugin {
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
|
||||
NodeSeenService nodeSeenService = new NodeSeenService(clusterService);
|
||||
NodeSeenService nodeSeenService = new NodeSeenService(services.clusterService());
|
||||
|
||||
return Collections.singletonList(nodeSeenService);
|
||||
}
|
||||
|
|
|
@ -15,31 +15,22 @@ import org.elasticsearch.client.internal.OriginSettingClient;
|
|||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.core.IOUtils;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.health.HealthIndicatorService;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.HealthPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.reservedstate.ReservedClusterStateHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.ParseField;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
|
@ -83,6 +74,7 @@ import java.time.Clock;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
@ -123,22 +115,10 @@ public class SnapshotLifecycle extends Plugin implements ActionPlugin, HealthPlu
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
final List<Object> components = new ArrayList<>();
|
||||
|
||||
SnapshotLifecycleTemplateRegistry templateRegistry = new SnapshotLifecycleTemplateRegistry(
|
||||
|
@ -146,7 +126,7 @@ public class SnapshotLifecycle extends Plugin implements ActionPlugin, HealthPlu
|
|||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.xContentRegistry()
|
||||
);
|
||||
templateRegistry.initialize();
|
||||
snapshotHistoryStore.set(new SnapshotHistoryStore(new OriginSettingClient(client, INDEX_LIFECYCLE_ORIGIN), clusterService));
|
||||
|
@ -167,7 +147,7 @@ public class SnapshotLifecycle extends Plugin implements ActionPlugin, HealthPlu
|
|||
)
|
||||
);
|
||||
snapshotRetentionService.get().init(clusterService);
|
||||
components.addAll(Arrays.asList(snapshotLifecycleService.get(), snapshotHistoryStore.get(), snapshotRetentionService.get()));
|
||||
Collections.addAll(components, snapshotLifecycleService.get(), snapshotHistoryStore.get(), snapshotRetentionService.get());
|
||||
slmHealthIndicatorService.set(new SlmHealthIndicatorService(clusterService));
|
||||
|
||||
return components;
|
||||
|
|
|
@ -11,30 +11,20 @@ import org.elasticsearch.action.ActionResponse;
|
|||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicenseUtils;
|
||||
import org.elasticsearch.license.LicensedFeature;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
|
@ -88,24 +78,13 @@ public class SqlPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
|
||||
return createComponents(client, environment.settings(), clusterService, namedWriteableRegistry);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
return createComponents(
|
||||
services.client(),
|
||||
services.environment().settings(),
|
||||
services.clusterService(),
|
||||
services.namedWriteableRegistry()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,29 +6,14 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.stack;
|
||||
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class StackPlugin extends Plugin implements ActionPlugin {
|
||||
private final Settings settings;
|
||||
|
@ -43,36 +28,21 @@ public class StackPlugin extends Plugin implements ActionPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
LegacyStackTemplateRegistry legacyStackTemplateRegistry = new LegacyStackTemplateRegistry(
|
||||
settings,
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
legacyStackTemplateRegistry.initialize();
|
||||
StackTemplateRegistry stackTemplateRegistry = new StackTemplateRegistry(
|
||||
settings,
|
||||
clusterService,
|
||||
threadPool,
|
||||
client,
|
||||
xContentRegistry
|
||||
services.clusterService(),
|
||||
services.threadPool(),
|
||||
services.client(),
|
||||
services.xContentRegistry()
|
||||
);
|
||||
stackTemplateRegistry.initialize();
|
||||
return List.of(legacyStackTemplateRegistry, stackTemplateRegistry);
|
||||
|
|
|
@ -24,9 +24,7 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|||
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
|
@ -34,25 +32,17 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.common.settings.SettingsModule;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.AssociatedIndexDescriptor;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.persistent.PersistentTasksExecutor;
|
||||
import org.elasticsearch.plugins.PersistentTaskPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry.Entry;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.action.SetResetModeActionRequest;
|
||||
|
@ -229,27 +219,15 @@ public class Transform extends Plugin implements SystemIndexPlugin, PersistentTa
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
|
||||
TransformConfigManager configManager = new IndexBasedTransformConfigManager(
|
||||
clusterService,
|
||||
expressionResolver,
|
||||
services.indexNameExpressionResolver(),
|
||||
client,
|
||||
xContentRegistry
|
||||
services.xContentRegistry()
|
||||
);
|
||||
TransformAuditor auditor = new TransformAuditor(
|
||||
client,
|
||||
|
@ -265,12 +243,12 @@ public class Transform extends Plugin implements SystemIndexPlugin, PersistentTa
|
|||
configManager,
|
||||
auditor
|
||||
);
|
||||
TransformScheduler scheduler = new TransformScheduler(clock, threadPool, settings);
|
||||
TransformScheduler scheduler = new TransformScheduler(clock, services.threadPool(), settings);
|
||||
scheduler.start();
|
||||
|
||||
transformServices.set(new TransformServices(configManager, checkpointService, auditor, scheduler));
|
||||
|
||||
return Arrays.asList(
|
||||
return List.of(
|
||||
transformServices.get(),
|
||||
new TransformClusterStateListener(clusterService, client),
|
||||
new TransformExtensionHolder(getTransformExtension())
|
||||
|
|
|
@ -11,32 +11,22 @@ import org.apache.lucene.util.SetOnce;
|
|||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.client.internal.Client;
|
||||
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfiguration;
|
||||
import org.elasticsearch.cluster.coordination.CoordinationState.VoteCollection;
|
||||
import org.elasticsearch.cluster.coordination.ElectionStrategy;
|
||||
import org.elasticsearch.cluster.coordination.Join;
|
||||
import org.elasticsearch.cluster.coordination.PublicationTransportHandler;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.discovery.DiscoveryModule;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.ClusterCoordinationPlugin;
|
||||
import org.elasticsearch.plugins.NetworkPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.Transport;
|
||||
import org.elasticsearch.transport.TransportException;
|
||||
|
@ -45,8 +35,6 @@ import org.elasticsearch.transport.TransportRequest;
|
|||
import org.elasticsearch.transport.TransportRequestOptions;
|
||||
import org.elasticsearch.transport.TransportResponse;
|
||||
import org.elasticsearch.transport.TransportResponseHandler;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
|
||||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
|
||||
|
||||
|
@ -84,23 +72,8 @@ public class VotingOnlyNodePlugin extends Plugin implements ClusterCoordinationP
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
this.threadPool.set(threadPool);
|
||||
public Collection<?> createComponents(PluginServices services) {
|
||||
this.threadPool.set(services.threadPool());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,8 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|||
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
|
@ -39,26 +37,21 @@ import org.elasticsearch.common.util.concurrent.EsExecutors;
|
|||
import org.elasticsearch.core.IOUtils;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.IndexModule;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.ReloadablePlugin;
|
||||
import org.elasticsearch.plugins.ScriptPlugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.repositories.RepositoriesService;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestHandler;
|
||||
import org.elasticsearch.script.ScriptContext;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.script.TemplateScript;
|
||||
import org.elasticsearch.telemetry.TelemetryProvider;
|
||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.FixedExecutorBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||
import org.elasticsearch.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
|
@ -305,26 +298,18 @@ public class Watcher extends Plugin implements SystemIndexPlugin, ScriptPlugin,
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<Object> createComponents(
|
||||
Client client,
|
||||
ClusterService clusterService,
|
||||
ThreadPool threadPool,
|
||||
ResourceWatcherService resourceWatcherService,
|
||||
ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry,
|
||||
Environment environment,
|
||||
NodeEnvironment nodeEnvironment,
|
||||
NamedWriteableRegistry namedWriteableRegistry,
|
||||
IndexNameExpressionResolver expressionResolver,
|
||||
Supplier<RepositoriesService> repositoriesServiceSupplier,
|
||||
TelemetryProvider telemetryProvider,
|
||||
AllocationService allocationService,
|
||||
IndicesService indicesService
|
||||
) {
|
||||
public Collection<Object> createComponents(PluginServices services) {
|
||||
if (enabled == false) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Client client = services.client();
|
||||
ClusterService clusterService = services.clusterService();
|
||||
ThreadPool threadPool = services.threadPool();
|
||||
Environment environment = services.environment();
|
||||
ScriptService scriptService = services.scriptService();
|
||||
NamedXContentRegistry xContentRegistry = services.xContentRegistry();
|
||||
|
||||
// only initialize these classes if Watcher is enabled, and only after the plugin security policy for Watcher is in place
|
||||
BodyPartSource.init();
|
||||
Account.init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue