[ML-Dataframe] add stop and delete endpoints#33597
[ML-Dataframe] add stop and delete endpoints#33597hendrikmuhs merged 3 commits intoelastic:feature/fibfrom
Conversation
|
Pinging @elastic/ml-core |
droberts195
left a comment
There was a problem hiding this comment.
Looks good apart from a few minor nits
| public TransportDeleteFeatureIndexBuilderJobAction(Settings settings, TransportService transportService, ThreadPool threadPool, | ||
| ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, | ||
| PersistentTasksService persistentTasksService, ClusterService clusterService) { | ||
| super(settings, DeleteFeatureIndexBuilderJobAction.NAME, transportService, clusterService, threadPool, actionFilters, |
There was a problem hiding this comment.
This has changed on master. threadpool and indexNameExpressionResolver are no longer passed to super. When you are in between PRs it's probably a good idea to merge master into your feature branch and resolve these differences.
There was a problem hiding this comment.
👍 will merge master and repair the code after merging this PR
| public FeatureIndexBuilderJobState(IndexerState state) { | ||
| public FeatureIndexBuilderJobState(IndexerState state, @Nullable Map<String, Object> position) { | ||
| this.state = state; | ||
| this.currentPosition = position == null ? null : new TreeMap<>(position); |
There was a problem hiding this comment.
If the intention is for this to be immutable then you should wrap the new TreeMap with Collections.unmodifiableSortedMap(), because otherwise a caller can modify it via the getter.
|
|
||
| public FeatureIndexBuilderJobState(StreamInput in) throws IOException { | ||
| state = IndexerState.fromStream(in); | ||
| currentPosition = in.readBoolean() ? new TreeMap<>(in.readMap()) : null; |
There was a problem hiding this comment.
Similar to above, new TreeMap should be wrapped with Collections.unmodifiableSortedMap().
| import org.elasticsearch.xpack.ml.featureindexbuilder.action.StopFeatureIndexBuilderJobAction.Request; | ||
| import java.io.IOException; | ||
|
|
||
| public class StopFeatureIndexBuilderJobActionRequestTests extends AbstractXContentTestCase<Request> { |
There was a problem hiding this comment.
I think it should extend AbstractStreamableTestCase instead of AbstractXContentTestCase. As it stands at the moment this test is not testing that the wire streaming read/write methods are consistent.
FEATURE BRANCH PR
add rest endpoints to stop and delete feature build indexer tasks and fix task saving/reloading