From abd263fca914699495be6864e1742ed5485220e2 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 27 Nov 2017 12:47:31 -0500 Subject: [PATCH] Merge branch 'master' into ccr * master: [DOCS] Fixed cross cluster search docs issue (#3113) Watcher: Add transform input for chained input (#2861) [DOCS] Fix cleaning up ML resources after tests [ML] Specify ML_ORIGIN when calling the job update endpoint internally (#3110) Refactor CLI commands as logging-aware commands [ML] Stop datafeed when job fails (#3107) --- .../src/main/java/org/elasticsearch/xpack/ccr/Ccr.java | 7 +++---- .../xpack/ccr/action/FollowExistingIndexAction.java | 6 +++--- .../xpack/ccr/action/ShardFollowTasksExecutor.java | 6 +++--- .../xpack/ccr/action/UnfollowIndexAction.java | 6 +++--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java index d31aa533b50..e58b9640ea1 100644 --- a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java +++ b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.ccr; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.client.Client; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; @@ -32,10 +33,8 @@ import org.elasticsearch.xpack.ccr.rest.RestFollowExistingIndexAction; import org.elasticsearch.xpack.ccr.rest.RestUnfollowIndexAction; import org.elasticsearch.xpack.persistent.PersistentTaskParams; import org.elasticsearch.xpack.persistent.PersistentTasksExecutor; -import org.elasticsearch.xpack.security.InternalClient; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -68,8 +67,8 @@ public final class Ccr { this.tribeNodeClient = XPackPlugin.isTribeClientNode(settings); } - public List> createPersistentTasksExecutors(InternalClient internalClient, ThreadPool threadPool) { - return Collections.singletonList(new ShardFollowTasksExecutor(settings, internalClient, threadPool)); + public List> createPersistentTasksExecutors(Client client, ThreadPool threadPool) { + return Collections.singletonList(new ShardFollowTasksExecutor(settings, client, threadPool)); } public List> getActions() { diff --git a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/FollowExistingIndexAction.java b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/FollowExistingIndexAction.java index ea711fb4e6d..1c960841179 100644 --- a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/FollowExistingIndexAction.java +++ b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/FollowExistingIndexAction.java @@ -15,6 +15,7 @@ import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; +import org.elasticsearch.client.Client; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; @@ -27,7 +28,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.persistent.PersistentTasksCustomMetaData; import org.elasticsearch.xpack.persistent.PersistentTasksService; -import org.elasticsearch.xpack.security.InternalClient; import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; @@ -107,12 +107,12 @@ public class FollowExistingIndexAction extends Action { - private final InternalClient client; + private final Client client; private final PersistentTasksService persistentTasksService; @Inject public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver, InternalClient client, + IndexNameExpressionResolver indexNameExpressionResolver, Client client, PersistentTasksService persistentTasksService) { super(settings, NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, Request::new); this.client = client; diff --git a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java index faba0287714..e8fc839884c 100644 --- a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java +++ b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ccr.action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; import org.elasticsearch.action.admin.indices.stats.ShardStats; +import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.common.settings.Settings; @@ -22,7 +23,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.ccr.Ccr; import org.elasticsearch.xpack.persistent.AllocatedPersistentTask; import org.elasticsearch.xpack.persistent.PersistentTasksExecutor; -import org.elasticsearch.xpack.security.InternalClient; import java.util.Arrays; import java.util.Optional; @@ -37,10 +37,10 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor { - private final InternalClient client; + private final Client client; private final PersistentTasksService persistentTasksService; @Inject public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver, InternalClient client, + IndexNameExpressionResolver indexNameExpressionResolver, Client client, PersistentTasksService persistentTasksService) { super(settings, NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, Request::new); this.client = client;