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

Add create rollup job api to high level rest client #33521

Merged

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Sep 7, 2018

This pull request adds the Create Rollup Job API to the high level REST client. It supersedes #32703 and adds dedicated request/response objects so that it does not depend on server side components.

Related #29827

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@tlrx
Copy link
Member Author

tlrx commented Sep 7, 2018

@polyfractal I'm sorry to create a new pull request for this but that was really easier as I created new classes for request, response and configurations objects. I kept the parsing logic even though it's not strictly required for this API as it simplifies the unit tests and prepare the field for other Rollup APIs.

This pull request adds the Create Rollup Job API to the high level REST
client. It supersedes elastic#32703 and adds dedicated request/response
objects so that it does not depend on server side components.

Related elastic#29827
@tlrx tlrx force-pushed the add-create-rollup-job-api-to-high-level-client-two branch from 1c55364 to f98ecf4 Compare September 12, 2018 08:28
import static org.elasticsearch.client.RequestConverters.REQUEST_BODY_CONTENT_TYPE;
import static org.elasticsearch.client.RequestConverters.createEntity;

final class RollupRequestConverters {
Copy link
Contributor

Choose a reason for hiding this comment

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

++ to a dedicated class for these Rollup converters

Copy link
Contributor

@polyfractal polyfractal left a comment

Choose a reason for hiding this comment

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

Thanks @tlrx! Sorry for the delay on getting this reviewed, busy week :)

Copy link
Contributor

@hub-cap hub-cap left a comment

Choose a reason for hiding this comment

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

LGTM, but its huge. I cant really do any proper reviewing on the sheer number of classes moving over, so I have to trust that its sane. Even breaking it up will only get u about 2k for the POJOs and like 1k for the HLRC stuff. Still huge.

Great work on the validatable stuff tho.

* the accumulating validation errors
* @param exception the {@link ValidationException} to add errors from
*/
public final void addValidationErrors(final @Nullable ValidationException exception) {
Copy link
Contributor

Choose a reason for hiding this comment

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

excellent


private final boolean acknowledged;

public PutRollupJobResponse(final boolean acknowledged) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Im ok with making a common response in client for the Ack Responses. We have a lot of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but the PR was already large enough. I think it must be done once another ack response is added to the HLRC.

@tlrx tlrx merged commit e77835c into elastic:master Sep 17, 2018
@tlrx
Copy link
Member Author

tlrx commented Sep 17, 2018

Thanks @polyfractal and @hub-cap!

I apologize for the size of the pull request; I tried to split it into multiple chunks (like I did to clean up the config objects) but did not succeed.

final String cron = "*/1 * * * * ?";
final int pageSize = randomIntBetween(numDocs, numDocs * 10);
// TODO expand this to also test with histogram and terms?
final GroupConfig groups = new GroupConfig(new DateHistogramGroupConfig("date", DateHistogramInterval.DAY));
Copy link
Member Author

Choose a reason for hiding this comment

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

@polyfractal Do you think you could improve this test? I think I borrowed it from another place and I noticed that it did not cover everything.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

<3

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @polyfractal

@tlrx tlrx deleted the add-create-rollup-job-api-to-high-level-client-two branch September 17, 2018 07:34
tlrx added a commit that referenced this pull request Sep 17, 2018
This commit adds the Create Rollup Job API to the high level REST
client. It supersedes #32703 and adds dedicated request/response
objects so that it does not depend on server side components.

Related #29827
tlrx added a commit that referenced this pull request Sep 17, 2018
tlrx added a commit that referenced this pull request Sep 17, 2018
tlrx added a commit that referenced this pull request Sep 17, 2018
tlrx added a commit that referenced this pull request Sep 17, 2018
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.

5 participants