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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]