Merged
Conversation
Member
Author
|
Pinging @elastic/ml-core Since this was not done automatically |
| * 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 { |
Contributor
There was a problem hiding this comment.
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() { |
Contributor
There was a problem hiding this comment.
rename to jobs()
| this.jobs.setCount(count); | ||
| } | ||
|
|
||
| public long getCount() { |
Contributor
There was a problem hiding this comment.
rename to count()
| this.jobs.setResults(jobs.stream().map(Job.Builder::build).collect(Collectors.toList())); | ||
| } | ||
|
|
||
| void setCount(long count) { |
Contributor
There was a problem hiding this comment.
We shouldn't need setters ones we change the response to not use a QueryPage.
…icsearch into feature/hlrc-ml-job-info
benwtrent
added a commit
that referenced
this pull request
Aug 22, 2018
* 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
98 tasks
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 the GET ML Job endpoint to the HLRC.
Relates to #29827