kfaraz opened a new pull request, #16752:
URL: https://github.com/apache/druid/pull/16752

   ### Description
   
   Overlord guice dependencies are currently a little difficult to plug into.
   This was encountered while working on a separate PR where a class needed to 
depend
   on `TaskMaster.getTaskQueue()`  to query some task related info but this 
class itself
   needs to be a dependency of `TaskMaster` so that it can be registered to the 
leader lifecycle.
   
   The approach taken here is to simply decouple the leadership lifecycle of 
the overlord from manipulation
   or querying of its state.
   
   ### Changes
   - Add new class `DruidOverlord` to contain leadership logic after the model 
of `DruidCoordinator`
   - The new class `DruidOverlord` should not be a dependency of any class with 
the exception of REST endpoint
   `*Resource` classes.
   - All classes that need to listen to leadership changes must be a dependency 
of `DruidOverlord` so
   that they can be registered to the leadership lifecycle.
   - Move all querying logic from `OverlordResource` to `TaskQueryTool` so that 
other classes can leverage this
   logic too (required for follow up PR).
   - Update tests
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] 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](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] 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](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to