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] Refactor ProcessCtrl into Autodetect and Normalizer builders #32720

Conversation

dimitris-athanasiou
Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou commented Aug 8, 2018

This moves the helper functionality for creating the autodetect
and mormalizer processes into corresponding builders.

This moves the helper functionality for creating the autodetect
and mormalizer processes into corresponding builders.
@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.

LGTM

I just left a couple of nits about Prelert vintage log messages that could be reformatted.

command.add(timeFieldArg);

int intervalStagger = calculateStaggeringInterval(job.getId());
logger.debug("Periodic operations staggered by " + intervalStagger +" seconds for job '" + job.getId() + "'");
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you've only moved this message between files but it might be worth making the format more consistent with others, i.e. [job_id] message.

// Supply a URL for persisting/restoring model state unless model
// persistence has been explicitly disabled.
if (DONT_PERSIST_MODEL_STATE_SETTING.get(settings)) {
logger.info("Will not persist model state - " + DONT_PERSIST_MODEL_STATE_SETTING + " setting was set");
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, [job_id] message.

import java.nio.file.Path;
import java.util.List;

public class ProcessBuilderUtils {
Copy link
Member

Choose a reason for hiding this comment

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

final with a private constructor

static final String AUTODETECT_PATH = "./" + AUTODETECT;

/*
* Arguments used by both autodetect and normalize
Copy link
Member

Choose a reason for hiding this comment

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

Consider moving the common options to ProcessBuilderUtils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that. I ended up favouring keeping them at AutodetectBuilder because I think the normalizer is an add-on process that is designed to run on top of autodetect. So it is reusing some of its parameters. However, new processes will be completely unrelated. So, ProcessBuilderUtils should have things that could be common for all process builders. Does it make sense?

@dimitris-athanasiou dimitris-athanasiou merged commit c7b1ba3 into elastic:master Aug 10, 2018
@dimitris-athanasiou dimitris-athanasiou deleted the refactor-process-ctrl-into-autodetect-and-normalizer-builders branch August 10, 2018 16:28
dimitris-athanasiou added a commit that referenced this pull request Aug 10, 2018
…2720)

This moves the helper functionality for creating the autodetect
and mormalizer processes into corresponding builders.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Aug 13, 2018
…listeners

* elastic/master: (58 commits)
  [ML] Partition-wise maximum scores (elastic#32748)
  [DOCS] XContentBuilder#bytes method removed, using BytesReference.bytes(docBuilder) (elastic#32771)
  HLRC: migration get assistance API (elastic#32744)
  Add a task to run forbiddenapis using cli (elastic#32076)
  [Kerberos] Add debug log statement for exceptions (elastic#32663)
  Make x-pack core pull transport-nio (elastic#32757)
  Painless: Clean Up Whitelist Names (elastic#32791)
  Cat apis: Fix index creation time to use strict date format (elastic#32510)
  Clear Job#finished_time when it is opened (elastic#32605) (elastic#32755)
  Test: Only sniff host metadata for node_selectors (elastic#32750)
  Update scripted metric docs to use `state` variable (elastic#32695)
  Painless: Clean up PainlessCast (elastic#32754)
  [TEST] Certificate NONE not allowed in FIPS JVM (elastic#32753)
  [ML] Refactor ProcessCtrl into Autodetect and Normalizer builders (elastic#32720)
  Access build tools resources (elastic#32201)
  Tests: Disable rolling upgrade tests with system key on fips JVM (elastic#32775)
  HLRC: Ban LoggingDeprecationHandler (elastic#32756)
  Fix test reproducability in AbstractBuilderTestCase setup (elastic#32403)
  Only require java<version>_home env var if needed
  Tests: Muted ScriptDocValuesDatesTests.testJodaTimeBwc
  ...
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants