kfaraz commented on code in PR #15705:
URL: https://github.com/apache/druid/pull/15705#discussion_r1577174184
##########
server/src/main/java/org/apache/druid/server/coordinator/duty/KillSupervisorsCustomDuty.java:
##########
@@ -38,43 +37,32 @@
* <p>
* This duty is only an example to demostrate the usage of coordinator custom
* duties. All production clusters should continue using {@link
KillSupervisors}.
- * <p>
- * In the future, we might migrate all metadata management coordinator duties
to
- * {@link CoordinatorCustomDuty} but until then this class will remain
undocumented.
*/
@UnstableApi
-public class KillSupervisorsCustomDuty extends MetadataCleanupDuty implements
CoordinatorCustomDuty
+public class KillSupervisorsCustomDuty implements CoordinatorCustomDuty
{
private static final Logger log = new
Logger(KillSupervisorsCustomDuty.class);
- private final MetadataSupervisorManager metadataSupervisorManager;
+ private final KillSupervisors delegate;
@JsonCreator
public KillSupervisorsCustomDuty(
@JsonProperty("durationToRetain") Duration retainDuration,
- @JacksonInject MetadataSupervisorManager metadataSupervisorManager,
- @JacksonInject DruidCoordinatorConfig coordinatorConfig
+ @JacksonInject MetadataSupervisorManager metadataSupervisorManager
)
{
- super(
- "supervisors",
- "KillSupervisorsCustomDuty",
- true,
- // Use the same period as metadata store management so that validation
passes
- // Actual period of custom duties is configured by the user
- coordinatorConfig.getCoordinatorMetadataStoreManagementPeriod(),
- retainDuration,
- Stats.Kill.SUPERVISOR_SPECS,
- coordinatorConfig
+ this.delegate = new KillSupervisors(
+ // Pass period as zero here, actual period of custom duties is
configured at the duty group level
+ new MetadataCleanupConfig(true, Duration.ZERO, retainDuration),
+ metadataSupervisorManager
);
- this.metadataSupervisorManager = metadataSupervisorManager;
log.warn("This is only an example implementation of a custom duty and"
Review Comment:
Yeah, I actually wanted to get rid of this duty altogether and have a
simpler `DummyCustomCoordinatorDuty` which just logged something in every run
rather than doing something meaningful. What do you think?
--
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]