-
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
HLRC: Add ML Get Job #32960
HLRC: Add ML Get Job #32960
Conversation
Pinging @elastic/ml-core Since this was not done automatically |
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.
LGTM
* not be equal to the actual length of the {@linkplain #results()} list if from | ||
* & take or some cursor was used in the database query. | ||
*/ | ||
public final class QueryPage<T extends ToXContent> implements ToXContentObject { |
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 we do not need this class in the client. In the server side, it saves us from duplicating the structure count, List<T>
from a number of responses. But on the client side, it doesn't seem like it's saving us a lot. I think it would be simpler to have the count and the List in the GetJobResponse
directly. I've been doing the same for the get buckets API. Let me know what you think.
jobs = new QueryPage<>(RESULTS_FIELD); | ||
} | ||
|
||
public List<Job> getJobs() { |
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.
rename to jobs()
this.jobs.setCount(count); | ||
} | ||
|
||
public long getCount() { |
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.
rename to count()
this.jobs.setResults(jobs.stream().map(Job.Builder::build).collect(Collectors.toList())); | ||
} | ||
|
||
void setCount(long count) { |
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.
We shouldn't need setters ones we change the response to not use a QueryPage
.
…icsearch into feature/hlrc-ml-job-info
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.
LGTM
* HLRC: Adding GET ML Job info API * HLRC: Adding GET Job ML API * Fixing QueryPage license header * Adding serialization tests, addressing minor issues * Renaming querypage, changing the dependency on it * Making things immutable * Fixing build failure due to method rename
This adds the GET ML Job endpoint to the HLRC.
Relates to #29827