Skip to content

Add sample method to IndexingServiceClient#10729

Merged
jon-wei merged 3 commits intoapache:masterfrom
jon-wei:samplemethod
Jan 5, 2021
Merged

Add sample method to IndexingServiceClient#10729
jon-wei merged 3 commits intoapache:masterfrom
jon-wei:samplemethod

Conversation

@jon-wei
Copy link
Contributor

@jon-wei jon-wei commented Jan 5, 2021

This PR adds a sample method to IndexingServiceClient which allows the caller to access the sample API on the overlord. To support this the payload and response classes for the API call (SamplerSpec and SamplerResponse) have been moved to server from the indexing-service module.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@jon-wei
Copy link
Contributor Author

jon-wei commented Jan 5, 2021

Adding a test now for the new method, will update shortly

SamplerResponse that = (SamplerResponse) o;
return getNumRowsRead() == that.getNumRowsRead() &&
getNumRowsIndexed() == that.getNumRowsIndexed() &&
Objects.equals(getData(), that.getData());
Copy link
Contributor

Choose a reason for hiding this comment

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

this may not do the correct thing always.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What case did you have in mind where this would break down?

Copy link
Contributor

Choose a reason for hiding this comment

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

Never mind. I was thinking if, for some List implementations, the equals may not have been implemented correctly. But that is unlikely to happen. was also wondering if we care about the order too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, IMO responses that have different orders should be considered non-equal

@lgtm-com
Copy link

lgtm-com bot commented Jan 5, 2021

This pull request introduces 1 alert when merging 6f0325d into 045b29f - view on LGTM.com

new alerts:

  • 1 for Unused format argument

@jon-wei jon-wei merged commit 769c21c into apache:master Jan 5, 2021
JulianJaffePinterest pushed a commit to JulianJaffePinterest/druid that referenced this pull request Jan 22, 2021
* Add sample method to IndexingServiceClient

* Add unit test

* Fix LGTM
@jihoonson jihoonson added this to the 0.21.0 milestone Jul 15, 2021
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.

4 participants