maytasm opened a new pull request #11601:
URL: https://github.com/apache/druid/pull/11601
Support custom coordinator duties
### Description
The coordinator periodically runs jobs, so-called `CoordinatoryDuties` which
include loading new segments, segment balancing, etc. These are essential for
keeping the druid cluster operating in production. Currently, these duties are
hard-coded and thus hard to write custom duties. However, Druid users may want
to add custom duties which are not part of Core Druid. This PR makes the
coordinator duty pluggable so that users can register their own duties.
In the new system for pluggable Coordinator duties, similar to what
coordinator already does today, the duties can be grouped into
`CoordinatorDutyGroups`. All duties in the same group will have the same run
period. Currently, there is a single thread running the duties sequentially for
each group. However, in the future each group may use a different thread to run
its duties.
Note that you will now be able to add custom coordinator duties without
having to modify any Core Druid classes.
The configuration for this pluggable Coordinator duty system is as follows:
```
druid.coordinator.dutyGroups=[<GROUP_NAME>]
druid.coordinator.<GROUP_NAME>.duties=[<DUTY_NAME_MATCHING_JSON_TYPE_NAME>]
druid.coordinator.<GROUP_NAME>.duty.<DUTY_NAME_MATCHING_JSON_TYPE_NAME>.<SOME_CONFIG_1>=100
druid.coordinator.<GROUP_NAME>.duty.<DUTY_NAME_MATCHING_JSON_TYPE_NAME>.<SOME_CONFIG_2>=200
druid.coordinator.<GROUP_NAME>.period="P1D"
```
The duties can be grouped into multiple groups as per the elements in list
druid.coordinator.dutyGroups.
All duties in the same group will have the same run period configured by
druid.coordinator.<GROUP_NAME>.period.
This PR has:
- [x] 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.)
- [x] added documentation for new or modified features or behaviors.
- [x] 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)
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] 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.
- [x] added integration tests.
- [x] 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]