You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/30 10:23:11 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request #11171: Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean

Technoboy- opened a new pull request #11171:
URL: https://github.com/apache/pulsar/pull/11171


   ### Motivation
   1. Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean.
   2. Fix typos.


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] sijie merged pull request #11171: Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #11171:
URL: https://github.com/apache/pulsar/pull/11171


   


-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] eolivelli commented on a change in pull request #11171: Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #11171:
URL: https://github.com/apache/pulsar/pull/11171#discussion_r661330131



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
##########
@@ -317,29 +316,11 @@ private String getDynamicConfigurationFromStore(String path, String settingName,
     }
 
     private double getDynamicConfigurationDouble(String path, String settingName, double defaultValue) {
-        double result = defaultValue;
-        try {
-            String setting = this.getDynamicConfigurationFromStore(path, settingName, null);
-            if (setting != null) {
-                result = Double.parseDouble(setting);
-            }
-        } catch (Exception e) {
-            log.warn("Got exception when parsing configuration from path [{}]:", path, e);
-        }
-        return result;
+        return Double.parseDouble(getDynamicConfigurationFromStore(path, settingName, String.valueOf(defaultValue)));

Review comment:
       with this new code if there is something wrong written on the store we will throw a NumberFormatException
   we should keep the "catch" statement

##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageTracker.java
##########
@@ -150,7 +150,7 @@ public void run(Timeout t) throws Exception {
         }, this.tickDurationInMs, TimeUnit.MILLISECONDS);
     }
 
-    public static void addChunkedMessageIdsAndRemoveFromSequnceMap(MessageId messageId, Set<MessageId> messageIds,
+    public static void addChunkedMessageIdsAndRemoveFromSequenceMap(MessageId messageId, Set<MessageId> messageIds,

Review comment:
       I am not sure it is a good practice to change this unrelated code with this patch.
   this patch is focused on LoadBalancer.
   it is better to still to change things only in one module




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] Technoboy- commented on a change in pull request #11171: Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #11171:
URL: https://github.com/apache/pulsar/pull/11171#discussion_r661338369



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
##########
@@ -317,29 +316,11 @@ private String getDynamicConfigurationFromStore(String path, String settingName,
     }
 
     private double getDynamicConfigurationDouble(String path, String settingName, double defaultValue) {
-        double result = defaultValue;
-        try {
-            String setting = this.getDynamicConfigurationFromStore(path, settingName, null);
-            if (setting != null) {
-                result = Double.parseDouble(setting);
-            }
-        } catch (Exception e) {
-            log.warn("Got exception when parsing configuration from path [{}]:", path, e);
-        }
-        return result;
+        return Double.parseDouble(getDynamicConfigurationFromStore(path, settingName, String.valueOf(defaultValue)));

Review comment:
       yes,I will rollback.




-- 
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-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] Technoboy- commented on a change in pull request #11171: Adjust the implementation of getDynamicConfigurationDouble and DynamicConfigurationBoolean

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #11171:
URL: https://github.com/apache/pulsar/pull/11171#discussion_r661337804



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageTracker.java
##########
@@ -150,7 +150,7 @@ public void run(Timeout t) throws Exception {
         }, this.tickDurationInMs, TimeUnit.MILLISECONDS);
     }
 
-    public static void addChunkedMessageIdsAndRemoveFromSequnceMap(MessageId messageId, Set<MessageId> messageIds,
+    public static void addChunkedMessageIdsAndRemoveFromSequenceMap(MessageId messageId, Set<MessageId> messageIds,

Review comment:
       Ok, I will update later.




-- 
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-unsubscribe@pulsar.apache.org

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