From e719789fb0e8206e2d04e38431b7ade2225468f1 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Mon, 28 Oct 2024 15:18:04 -0700 Subject: [PATCH] adjust param type --- .../com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java b/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java index 949f2c2d1..d6b470f7a 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java @@ -230,7 +230,7 @@ public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp, public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp, boolean isDarkWarmupEnabled, String warmupClusterName, int warmupDuration, ScheduledExecutorService executorService, - ServiceDiscoveryEventEmitter eventEmitter, BigDecimal maxWeight, ActOnWeightBreach actOnWeightBreach) + ServiceDiscoveryEventEmitter eventEmitter, String maxWeight, ActOnWeightBreach actOnWeightBreach) { _server = server; // initialIsUp is used for delay mark up. If it's false, there won't be markup when the announcer is started. @@ -246,8 +246,7 @@ public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp, _warmupDuration = warmupDuration; _executorService = executorService; _eventEmitter = eventEmitter; - _maxWeight = maxWeight; - + _maxWeight = maxWeight == null ? null : new BigDecimal(maxWeight); if (actOnWeightBreach != null) { _actOnWeightBreach = actOnWeightBreach;