As a `BaseTasksRequest`, `StopDataFrameAnalyticsAction.Request` should implement a `match` method that makes sure only df-analytics tasks are applied.
This commit is contained in:
parent
504a43d43a
commit
a1a62fded3
|
@ -22,6 +22,7 @@ import org.elasticsearch.common.xcontent.ObjectParser;
|
|||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig;
|
||||
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
|
@ -125,6 +126,11 @@ public class StopDataFrameAnalyticsAction extends ActionType<StopDataFrameAnalyt
|
|||
this.expandedIds = Objects.requireNonNull(expandedIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Task task) {
|
||||
return expandedIds.stream().anyMatch(expandedId -> StartDataFrameAnalyticsAction.TaskMatcher.match(task, expandedId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue