-
Notifications
You must be signed in to change notification settings - Fork 25k
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] Data Frame HLRC start & stop APIs #40154
Conversation
Pinging @elastic/es-core-features |
Pinging @elastic/ml-core |
3ac70af
to
679a44d
Compare
I pushed a change to add a teardown stopping and deleting transforms to the docs tests. Also I added parsing the @benwtrent can you look over the latest 2 commits please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor things, looks good though .
StartDataFrameTransformAction.Request request = new StartDataFrameTransformAction.Request(id); | ||
|
||
if (restRequest.hasParam(DataFrameField.TIMEOUT.getPreferredName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this hasParam
check is redundant, though it is not hurting anything.
"timeout": { | ||
"type": "time", | ||
"required": false, | ||
"description": "Controls the time to wait for the transform to start" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to know the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having second thoughts about this timeout parameter. Get Stats, Preview and Put could all take a timeout parameter as ActionRequests or BaseTasksRequests. Should we actually expose it? Is it helpful to offer this option or confusing? I think it makes sense for Stop and Start (start datafeed and open job both have a timeout parameter). I don't know anymore I'm over-thinking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET stats
_preview
and PUT
should not really have a timeout option (IMO).
_start
could be take a long time as it needs to wait for a Node to start executing the task, thus a timeout sort of makes sense.
Addendum, if we include timeout
we may also want to include a wait_for_completion
or a sync/async
option, but that could be another PR and discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that _start
and _stop
should take a timeout parameter and the others shouldn't. For _start
and _stop
there will be occasions when the caller wants to know when the state change is complete before they move on to the next operation, yet they probably don't want to wait forever if something goes wrong. Our integration tests are a good example of this need but any user trying to automate an end-to-end process that involves data frames will be in a similar situation. Having a timeout on the _start
and _stop
endpoints is also consistent with what we do for datafeeds and anomaly detectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks for the 2nd review @benwtrent
On the server side both these APIs inherit
BaseTasksResponse
which returns node failures etc. This PR adds aAcknowledgedTasksResponse
for parsing the response.The
TaskOperationFailure
class was added in #29546 and the decision was made there not to implementequals
&hashcode
as the serialisation of ElasticsearchExceptions changes them wrapping the error in an outer exception. This made writing the unit tests a little bit more complicated as a custom equals method was required.