[ML] Use same CS for validating job
Original commit: elastic/x-pack-elasticsearch@00b593e8c2
This commit is contained in:
parent
a1cb22836c
commit
0c2ef5608e
|
@ -61,14 +61,10 @@ public abstract class TransportJobTaskAction<OperationTask extends OpenJobAction
|
||||||
// We need to check whether there is at least an assigned task here, otherwise we cannot redirect to the
|
// We need to check whether there is at least an assigned task here, otherwise we cannot redirect to the
|
||||||
// node running the job task.
|
// node running the job task.
|
||||||
Set<String> executorNodes = new HashSet<>();
|
Set<String> executorNodes = new HashSet<>();
|
||||||
|
|
||||||
for (String resolvedJobId : request.getResolvedJobIds()) {
|
for (String resolvedJobId : request.getResolvedJobIds()) {
|
||||||
JobManager.getJobOrThrowIfUnknown(state, resolvedJobId);
|
JobManager.getJobOrThrowIfUnknown(state, resolvedJobId);
|
||||||
PersistentTasksCustomMetaData tasks = clusterService.state().getMetaData()
|
PersistentTasksCustomMetaData tasks = state.metaData().custom(PersistentTasksCustomMetaData.TYPE);
|
||||||
.custom(PersistentTasksCustomMetaData.TYPE);
|
PersistentTasksCustomMetaData.PersistentTask<?> jobTask = MlMetadata.getJobTask(resolvedJobId, tasks);
|
||||||
PersistentTasksCustomMetaData.PersistentTask<?> jobTask = MlMetadata
|
|
||||||
.getJobTask(resolvedJobId, tasks);
|
|
||||||
|
|
||||||
if (jobTask == null || jobTask.isAssigned() == false) {
|
if (jobTask == null || jobTask.isAssigned() == false) {
|
||||||
String message = "Cannot perform requested action because job [" + resolvedJobId
|
String message = "Cannot perform requested action because job [" + resolvedJobId
|
||||||
+ "] is not open";
|
+ "] is not open";
|
||||||
|
|
Loading…
Reference in New Issue