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] Send autodetect config updates as JSON #67721

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

edsavage
Copy link
Contributor

Send configuration updates to model plot, scheduled events, detector
rules and filters as JSON formatted strings.

Remove any now unneeded supporting code.

Note that a handful of test cases have been muted. This is only temporary and the tests will be re-enabled when the supporting C++ code is merged and available.

Send configuration updates to model plot, scheduled events, detector
rules and filters as JSON formatted strings.

Remove any now unneeded supporting code.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

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

LGTM Just a double-checking question :-)

writeMessage(stringBuilder.toString());
}

public void writeUpdateScheduledEventsMessage(List<ScheduledEvent> events, TimeValue bucketSpan) throws IOException {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(UPDATE_MESSAGE_CODE).append("[scheduledEvents]\n");
if (events.isEmpty()) {
stringBuilder.append("clear = true\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

So if we now have an empty list of events, c++ will receive an empty events array. Will this clear any existing events?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the C++ code has been adjusted such that an empty events array, generating the message u{"events":[]} will clear out any existing events.

@edsavage
Copy link
Contributor Author

jenkins retest this please

@edsavage edsavage merged commit 1e14a01 into elastic:master Jan 20, 2021
edsavage added a commit to edsavage/elasticsearch that referenced this pull request Jan 20, 2021
Send configuration updates to model plot, scheduled events, detector
rules and filters as JSON formatted strings.

Remove any now unneeded supporting code.
edsavage added a commit that referenced this pull request Jan 20, 2021
Send configuration updates to model plot, scheduled events, detector
rules and filters as JSON formatted strings.

Remove any now unneeded supporting code.

Backports #67721
edsavage added a commit to elastic/ml-cpp that referenced this pull request Jan 21, 2021
* Expect configuration update requests to be received in JSON formatted
strings. 
* Remove support for old, ini file parsing.

Relates elastic/elasticsearch#67721, #1253
edsavage added a commit to edsavage/ml-cpp that referenced this pull request Jan 21, 2021
* Expect configuration update requests to be received in JSON formatted
strings. 
* Remove support for old, ini file parsing.

Relates elastic/elasticsearch#67721, elastic#1253
edsavage added a commit to elastic/ml-cpp that referenced this pull request Jan 21, 2021
* Expect configuration update requests to be received in JSON formatted
strings. 
* Remove support for old, ini file parsing.

Relates elastic/elasticsearch#67721, #1253
Backports #1682
@edsavage edsavage deleted the autodetect_control_messages_json branch January 25, 2021 09:51
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.

4 participants