From fc86a7a97fe887fba73df3ad19aaa8cc50e422a2 Mon Sep 17 00:00:00 2001 From: Maytas Monsereenusorn Date: Tue, 31 Aug 2021 14:04:00 +0700 Subject: [PATCH] fix custom coordinator duty (#11641) --- .../environment-configs/common-custom-coordinator-duties | 9 +++++---- .../main/java/org/apache/druid/cli/CliCoordinator.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/integration-tests/docker/environment-configs/common-custom-coordinator-duties b/integration-tests/docker/environment-configs/common-custom-coordinator-duties index 5f8c0421b59..e6bddd658f6 100644 --- a/integration-tests/docker/environment-configs/common-custom-coordinator-duties +++ b/integration-tests/docker/environment-configs/common-custom-coordinator-duties @@ -74,7 +74,8 @@ druid_request_logging_type=slf4j druid_indexer_task_ignoreTimestampSpecForDruidInputSource=true #Testing kill supervisor custom coordinator duty -druid.coordinator.dutyGroups=["cleanupMetadata"] -druid.coordinator.cleanupMetadata.duties=["killSupervisors"] -druid.coordinator.cleanupMetadata.duty.killSupervisors.retainDuration=PT0M -druid.coordinator.cleanupMetadata.period=PT10S \ No newline at end of file +druid_coordinator_kill_supervisor_on=false +druid_coordinator_dutyGroups=["cleanupMetadata"] +druid_coordinator_cleanupMetadata_duties=["killSupervisors"] +druid_coordinator_cleanupMetadata_duty_killSupervisors_retainDuration=PT0M +druid_coordinator_cleanupMetadata_period=PT10S \ No newline at end of file diff --git a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java index 4853c196499..08f7a866a6b 100644 --- a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java +++ b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java @@ -435,7 +435,7 @@ public class CliCoordinator extends ServerRunnable if (Strings.isNullOrEmpty(props.getProperty(groupPeriodPropKey))) { throw new IAE("Run period for coordinator custom duty group must be set for group %s", coordinatorCustomDutyGroupName); } - Duration groupPeriod = jsonMapper.readValue(props.getProperty(groupPeriodPropKey), Duration.class); + Duration groupPeriod = new Duration(props.getProperty(groupPeriodPropKey)); coordinatorCustomDutyGroups.add(new CoordinatorCustomDutyGroup(coordinatorCustomDutyGroupName, groupPeriod, coordinatorCustomDuties)); } return new CoordinatorCustomDutyGroups(coordinatorCustomDutyGroups);