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 BrokerClient implementation #17382

Merged
merged 7 commits into from
Oct 21, 2024

Conversation

abhishekrb19
Copy link
Contributor

@abhishekrb19 abhishekrb19 commented Oct 19, 2024

This patch is extracted from 17353 to make reviewing easier. It includes additional test coverage and javadocs compared to the original patch.

Changes:

  • Added BrokerClient and BrokerClientImpl to the sql package that leverages the ServiceClient functionality; similar to OverlordClient and CoordinatorClient implementations in the server module.
  • For now, only two broker API stubs are added: submitSqlTask() and fetchExplainPlan().
  • Note that there is already a org.apache.druid.discovery.BrokerClient in the server module that's used by MSQE for a specific use case. This client has a weird contract though, and its retry mechanism is not robust. We should plan to remove it in the future, but for now, it has been marked as deprecated in favor of the new BrokerClient added in this patch.
  • Added a new POJO class ExplainPlan that encapsulates explain plan info.
  • Clean up ExplainAttributesTest a bit and added serde verification.

In this patch, the BrokerClient and the related BrokerServiceModule that injects it is unused. It will be used by the scheduled batch supervisor running on the Overlord to interact with the Broker.

This PR has:

  • been self-reviewed.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • 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.
  • been tested in a test Druid cluster.

…lan.

- Add BrokerClient that leverages the ServiceClient functionality. Add a couple of
client APIs that are useful to the scheduled batch supervisor implementation.

- Add ExplainPlanInformation class that contains information about a single plan.
  The BrokerClient leverages this.
Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise looks good.

@abhishekrb19 abhishekrb19 merged commit 187e21a into apache:master Oct 21, 2024
90 checks passed
@abhishekrb19 abhishekrb19 deleted the broker_client_explain_plan branch October 21, 2024 18:05
kirangadhave-imply pushed a commit to kirangadhave-imply/druid that referenced this pull request Oct 22, 2024
This patch is extracted from PR 17353.

Changes:

- Added BrokerClient and BrokerClientImpl to the sql package that leverages the ServiceClient functionality; similar to OverlordClient and CoordinatorClient implementations in the server module.
- For now, only two broker API stubs are added: submitSqlTask() and fetchExplainPlan().
- Added a new POJO class ExplainPlan that encapsulates explain plan info.
- Deprecated org.apache.druid.discovery.BrokerClient in favor of the new BrokerClient in this patch.
- Clean up ExplainAttributesTest a bit and added serde verification.
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.

2 participants