Skip to content

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

@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,

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

public FeatureIndexBuilderJobState(IndexerState state) {
public FeatureIndexBuilderJobState(IndexerState state, @Nullable Map<String, Object> position) {
this.state = state;
this.currentPosition = position == null ? null : new TreeMap<>(position);

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;

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> {

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

@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