eolivelli commented on code in PR #3794:
URL: https://github.com/apache/bookkeeper/pull/3794#discussion_r1113262055


##########
bookkeeper-common-allocator/src/main/java/org/apache/bookkeeper/common/allocator/LeakDetectionPolicy.java:
##########
@@ -43,5 +43,15 @@ public enum LeakDetectionPolicy {
      * stack traces of places where the buffer was used. Introduce very
      * significant overhead.
      */
-    Paranoid,
+    Paranoid;
+
+    public static LeakDetectionPolicy parseLevel(String levelStr) {
+        String trimmedLevelStr = levelStr.trim();
+        for (LeakDetectionPolicy policy : values()) {
+            if (trimmedLevelStr.equalsIgnoreCase(policy.name())) {
+                return policy;
+            }
+        }
+        return LeakDetectionPolicy.Disabled;

Review Comment:
   we should throw an error, otherwise it is possible that you configure it and 
you set a wrong value.
   
   if you don't want to throw then we should at least log something at ERROR 
level



-- 
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]

Reply via email to