You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/14 17:25:21 UTC

[GitHub] [ozone] sodonnel commented on a change in pull request #2331: HDDS-5247. EC: Create ECReplicationConfig on client side based on input string

sodonnel commented on a change in pull request #2331:
URL: https://github.com/apache/ozone/pull/2331#discussion_r651138621



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java
##########
@@ -36,6 +43,29 @@ public ECReplicationConfig(int data, int parity) {
     this.parity = parity;
   }
 
+  public ECReplicationConfig(String string) {
+    final Pattern pattern = Pattern.compile("(\\d+)-(\\d+)");
+    final Matcher matcher = pattern.matcher(string);

Review comment:
       This is a question more from my own interest point of view, as I know this is not a performance critical piece of code.
   
   These two variables are effectively constants, but they are defined at the method level. Do you know if Java is smart enough to realise these are constants and evaluate the expression only once? Compared to defining these as "private static final" at the class level, will this perform the same or worse?
   
   I will try to answer this myself with a quick benchmark if I get some time.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org