Skip to content

Commit

Permalink
Update all instances of createComponents
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Jul 12, 2024
1 parent dc5c5a8 commit e26ac6c
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
import org.apache.lucene.analysis.tr.TurkishAnalyzer;
import org.apache.lucene.analysis.util.ElisionFilter;
import org.opensearch.Version;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.SetOnce;
Expand Down Expand Up @@ -177,7 +177,7 @@ public class CommonAnalysisModulePlugin extends Plugin implements AnalysisPlugin

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
package org.opensearch.painless;

import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -136,7 +136,7 @@ public ScriptEngine getScriptEngine(Settings settings, Collection<ScriptContext<

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -112,7 +112,7 @@ public List<RestHandler> getRestHandlers(

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.opensearch.action.support.ActionFilter;
import org.opensearch.action.support.ActionFilterChain;
import org.opensearch.action.support.WriteRequest.RefreshPolicy;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.SetOnce;
Expand Down Expand Up @@ -176,7 +176,7 @@ public static class TestPlugin extends Plugin implements ActionPlugin {

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.SetOnce;
Expand Down Expand Up @@ -90,7 +90,7 @@ Scheduler.Cancellable extender() {

@Override
public Collection<Object> createComponents(
final Client client,
final PluginAwareNodeClient client,
final ClusterService clusterService,
final ThreadPool threadPool,
final ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package org.opensearch.plugin.correlation;

import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -77,7 +77,7 @@ public EventsCorrelationPlugin() {}

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package org.opensearch.plugin.insights;

import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -57,7 +57,7 @@ public QueryInsightsPlugin() {}

@Override
public Collection<Object> createComponents(
final Client client,
final PluginAwareNodeClient client,
final ClusterService clusterService,
final ThreadPool threadPool,
final ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package org.opensearch.plugin.insights;

import org.opensearch.action.ActionRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -37,7 +37,7 @@ public class QueryInsightsPluginTests extends OpenSearchTestCase {

private QueryInsightsPlugin queryInsightsPlugin;

private final Client client = mock(Client.class);
private final PluginAwareNodeClient client = mock(PluginAwareNodeClient.class);
private ClusterService clusterService;
private final ThreadPool threadPool = mock(ThreadPool.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

package org.opensearch.repositories.s3;

import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.metadata.RepositoryMetadata;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -201,7 +201,7 @@ private static int normalPoolCount(Settings settings) {

@Override
public Collection<Object> createComponents(
final Client client,
final PluginAwareNodeClient client,
final ClusterService clusterService,
final ThreadPool threadPool,
final ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TestExecutionContextPlugin extends Plugin implements ActionPlugin {

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.opensearch.action.get.GetRequest;
import org.opensearch.action.get.GetResponse;
import org.opensearch.action.index.IndexRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.core.common.bytes.BytesArray;
Expand Down Expand Up @@ -110,7 +110,7 @@ public static class TestPlugin extends Plugin implements IngestPlugin {

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.opensearch.action.support.IndicesOptions;
import org.opensearch.client.Client;
import org.opensearch.client.Requests;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.metadata.MappingMetadata;
Expand Down Expand Up @@ -459,7 +460,7 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {

@Override
public Collection<Object> createComponents(
final Client client,
final PluginAwareNodeClient client,
final ClusterService clusterService,
final ThreadPool threadPool,
final ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -87,7 +87,7 @@ public TestPlugin(Settings settings) {

@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.opensearch.action.ingest.PutPipelineRequest;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.action.support.WriteRequest;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -363,7 +363,7 @@ public static class TestPlugin extends Plugin implements IngestPlugin {

@Override
public Collection<Object> createComponents(
final Client client,
final PluginAwareNodeClient client,
final ClusterService clusterService,
final ThreadPool threadPool,
final ResourceWatcherService resourceWatcherService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

import org.opensearch.plugins.Plugin;

/**
* Wrapper class around the ThreadContext that is used within {@link org.opensearch.client.node.PluginAwareNodeClient}
* to enable retaining information about the plugin when switching out an authenticated user context
*/
public class PluginAwareThreadContextWrapper {

private final ThreadContext threadContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.opensearch.plugins;

import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.annotation.ExperimentalApi;
Expand Down Expand Up @@ -61,7 +61,7 @@ public interface TelemetryAwarePlugin {
* @param metricsRegistry the registry for metrics instrumentation.
*/
default Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down
4 changes: 2 additions & 2 deletions server/src/test/java/org/opensearch/node/NodeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.bootstrap.BootstrapCheck;
import org.opensearch.bootstrap.BootstrapContext;
import org.opensearch.client.Client;
import org.opensearch.client.node.PluginAwareNodeClient;
import org.opensearch.cluster.ClusterName;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodeRole;
Expand Down Expand Up @@ -466,7 +466,7 @@ public MetricsRegistry getMetricsRegistry() {
public static class MockTelemetryAwarePlugin extends Plugin implements TelemetryAwarePlugin {
@Override
public Collection<Object> createComponents(
Client client,
PluginAwareNodeClient client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
Expand Down

0 comments on commit e26ac6c

Please sign in to comment.