Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML-Dataframe] add stop and delete endpoints #33597

Merged
merged 3 commits into from
Sep 12, 2018

Conversation

hendrikmuhs
Copy link

FEATURE BRANCH PR

add rest endpoints to stop and delete feature build indexer tasks and fix task saving/reloading

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will merge master and repair the code after merging this PR

this.state = state;
this.currentPosition = position == null ? null : new TreeMap<>(position);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hendrikmuhs hendrikmuhs merged commit b13cca3 into elastic:feature/fib Sep 12, 2018
@hendrikmuhs hendrikmuhs deleted the feature/fib-endpoints branch October 18, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :ml Machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants