removed hack
@@ -19,8 +19,6 @@ import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
-import org.elasticsearch.env.Environment;
-import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.engine.EngineFactory;
import org.elasticsearch.license.XPackLicenseState;
@@ -32,12 +30,10 @@ import org.elasticsearch.plugins.PersistentTaskPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler;
-import org.elasticsearch.script.ScriptService;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ExecutorBuilder;
import org.elasticsearch.threadpool.FixedExecutorBuilder;
import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.watcher.ResourceWatcherService;
import org.elasticsearch.xpack.ccr.action.FollowExistingIndexAction;
import org.elasticsearch.xpack.ccr.action.ShardChangesAction;
import org.elasticsearch.xpack.ccr.action.ShardFollowTask;
@@ -52,7 +48,6 @@ import org.elasticsearch.xpack.core.XPackClientActionPlugin;
import org.elasticsearch.xpack.core.XPackPlugin;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -75,9 +70,6 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E
private final boolean tribeNode;
private final boolean tribeNodeClient;
- private Client client;
- private ThreadPool threadPool;
-
/**
* Construct an instance of the CCR container with the specified settings.
*
@@ -90,21 +82,9 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E
this.tribeNodeClient = XPackClientActionPlugin.isTribeClientNode(settings);
}
- // TODO: remove this hack when Client and ThreadPool are added to:
- // PersistentTaskPlugin#getPersistentTasksExecutor(...) signature.
- @Override
- public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
- ResourceWatcherService resourceWatcherService, ScriptService scriptService,
- NamedXContentRegistry xContentRegistry, Environment environment,
- NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {
- this.client = client;
- this.threadPool = threadPool;
- return super.createComponents(client, clusterService, threadPool, resourceWatcherService, scriptService,
- xContentRegistry, environment, nodeEnvironment, namedWriteableRegistry);
- }
-
@Override
- public List<PersistentTasksExecutor<?>> getPersistentTasksExecutor(ClusterService clusterService) {
+ public List<PersistentTasksExecutor<?>> getPersistentTasksExecutor(ClusterService clusterService,
+ ThreadPool threadPool, Client client) {
return Collections.singletonList(new ShardFollowTasksExecutor(settings, client, threadPool));
}
