From 0c2ef5608efe1ab6f636711ea7902b87a8344ccc Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 10 Apr 2017 10:32:42 +0200 Subject: [PATCH] [ML] Use same CS for validating job Original commit: elastic/x-pack-elasticsearch@00b593e8c2013babf9e3f12402aa502dba0724b0 --- .../xpack/ml/action/TransportJobTaskAction.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/TransportJobTaskAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/TransportJobTaskAction.java index 92259fb9561..216c6e7faf0 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/TransportJobTaskAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/TransportJobTaskAction.java @@ -61,14 +61,10 @@ public abstract class TransportJobTaskAction executorNodes = new HashSet<>(); - for (String resolvedJobId : request.getResolvedJobIds()) { JobManager.getJobOrThrowIfUnknown(state, resolvedJobId); - PersistentTasksCustomMetaData tasks = clusterService.state().getMetaData() - .custom(PersistentTasksCustomMetaData.TYPE); - PersistentTasksCustomMetaData.PersistentTask jobTask = MlMetadata - .getJobTask(resolvedJobId, tasks); - + PersistentTasksCustomMetaData tasks = state.metaData().custom(PersistentTasksCustomMetaData.TYPE); + PersistentTasksCustomMetaData.PersistentTask jobTask = MlMetadata.getJobTask(resolvedJobId, tasks); if (jobTask == null || jobTask.isAssigned() == false) { String message = "Cannot perform requested action because job [" + resolvedJobId + "] is not open";