sodonnel commented on code in PR #11884:
URL: https://github.com/apache/ozone/pull/11884#discussion_r4454645605
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java:
##########
@@ -34,12 +36,45 @@ public class ECReplicationConfig implements
ReplicationConfig {
public static final String EC_REPLICATION_PARAMS_DELIMITER = "-";
- // Acceptable patterns are like:
- // rs-3-2-1024k
- // RS-3-2-2048
- // XOR-10-4-4096K
+ // <codec>-<data>-<parity>-<chunk size>, usually as getReplication() prints
it, such as rs-6-3-1024k. The codec and
+ // the "k" suffix are case-insensitive, and without "k" the chunk size is in
bytes, so RS-6-3-1024K and
+ // rs-6-3-1048576 are accepted too.
private static final Pattern STRING_FORMAT =
Pattern.compile("([a-zA-Z]+)-(\\d+)-(\\d+)-(\\d+)([kK])?");
+ /** The data-parity schemes allowed by default by
ozone.replication.allowed-configs. */
+ private static final int[][] PREDEFINED_SCHEMES = {{3, 2}, {6, 3}, {10, 4}};
Review Comment:
Its a concern that the defaults are defined here and somewhere else. If
anyone adds a new allowed scheme "somewhere else", then its unlikely this will
get updated and then a single instance won't be used. However also see my
comment below around the getInstance method before changing this. I wonder if
we need to pre-compute all the combinations at all?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]