Skip to content

Conversation

@hendrikmuhs
Copy link

Feature Index PR

this change enables testing as well as adds basic tests

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

Some minor initial comments.


@Override
public int hashCode() {
return Objects.hash(state);
Copy link
Member

Choose a reason for hiding this comment

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

#nit indentation

builder.field("id", id);
{
builder.field(ID, id);
}
Copy link
Member

Choose a reason for hiding this comment

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

Why are you keeping the scope if there is no longer a branch that prevents entry?

Copy link
Author

@hendrikmuhs hendrikmuhs Aug 13, 2018

Choose a reason for hiding this comment

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

I agree, took this over from another place and was wondering myself, but then thought:

As this builds a json object, it emulates the json structure. So this is rather syntactic sugar: forcing indentation to make the code more readable.

(Right now the whole config is bogus (empty). But this will be the next step.)

import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.xpack.core.XPackPlugin;
import org.elasticsearch.xpack.core.rollup.job.RollupJobConfig;
Copy link
Member

Choose a reason for hiding this comment

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

This is not used anywhere.

PARSER = new ConstructingObjectParser<>(NAME, false, (args, optionalId) -> {
String id = args[0] != null ? (String) args[0] : optionalId;
return new FeatureIndexBuilderJobConfig(id);
});
Copy link
Member

Choose a reason for hiding this comment

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

This does not necessarily need to be within a static initialization block.

Copy link
Author

Choose a reason for hiding this comment

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

do not get this, can you elaborate?

Copy link
Member

Choose a reason for hiding this comment

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

Usually, the static variable initialization is done outside of the static block.

Though this is not a strict pattern, I just don't see why you chose to initialize the value here instead of at the declaration.


private String id;
private static final String NAME = "xpack/feature_index_builder/jobconfig";
private static final String ID = "id";
Copy link
Member

Choose a reason for hiding this comment

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

Why did not remove this from being a ParseField? This seems to go against the prevailing pattern.

Copy link
Author

Choose a reason for hiding this comment

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

no strong feeling, I saw both versions in code

@hendrikmuhs hendrikmuhs changed the title [ML-FIB] Feature/fib basictests [ML-Dataframe] Feature/fib basictests Aug 13, 2018
@hendrikmuhs hendrikmuhs changed the title [ML-Dataframe] Feature/fib basictests [ML-Dataframe] Feature/dataframe basictests Aug 13, 2018
@hendrikmuhs
Copy link
Author

retest this please

@hendrikmuhs
Copy link
Author

The remaining CI issues are due to the incomplete integration. Some classes need to be moved into X-Pack core, best to do this together with the planned naming changes and best to be done in a separate PR.

@hendrikmuhs hendrikmuhs merged commit e6d58c5 into elastic:feature/fib Aug 14, 2018
@hendrikmuhs hendrikmuhs deleted the feature/fib-basictests 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