[ML] Add lazy parsing for DatafeedConfig:Aggs,Query#36117
Merged
benwtrent merged 9 commits intoelastic:masterfrom Dec 4, 2018
Merged
[ML] Add lazy parsing for DatafeedConfig:Aggs,Query#36117benwtrent merged 9 commits intoelastic:masterfrom
benwtrent merged 9 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/ml-core |
benwtrent
commented
Nov 30, 2018
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
benwtrent
commented
Nov 30, 2018
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
I'd definitely like to see this in 6.7, because then a mixed version cluster of 7.x and 6.last is guaranteed not to fail due to search or aggs syntax that's been removed in 7.0. I don't think it would hurt to introduce this into 6.x while it's still 6.6. Since this work is nearly complete I think we should do this, then merge master and 6.x into the corresponding jindex branches and make sure it works in those branches too before merging them to master and 6.x. |
benwtrent
added a commit
that referenced
this pull request
Dec 4, 2018
* Lazily parsing aggs and query in DatafeedConfigs * Adding parser tests * Fixing exception types && unneccessary checked ex * Adding semi aggregation parser * Adding tests, fixing up semi-parser * Reverting semi-parsing * Moving agg validations * Making bad configs throw badRequestException
benwtrent
added a commit
that referenced
this pull request
Dec 4, 2018
This was referenced Dec 5, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds lazy parsing for DatafeedConfig Aggregations and Queries.
When creating a NEW Datafeed, the STRICT parser is used, which eagerly parses both to catch any formatting errors.
When an already stored config is read in, the LENIENT parser is used and simply pulls in the aggs and datafeed as maps. When serializing on the wire or to XContent, the maps are used directly. However, if the in/out streams are of an earlier version, they are fully parsed before sending over the wire.
Right now the BWC checks are for
Version.CURRENTas I am not sure if we want to put this in 6.x. Let me know what you think.When a lazy parsing issue occurs, I am currently throwing a
UNPROCESSABLE_ENTITYREST error. However, the argument could be made that they should just beIllegalArgumentexceptions or aXContentParseException, need feedback :).