sodonnel commented on code in PR #11884:
URL: https://github.com/apache/ozone/pull/11884#discussion_r4603017451
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java:
##########
@@ -80,24 +149,40 @@ public ECReplicationConfig(int data, int parity, EcCodec
codec,
}
/**
- * Create an ECReplicationConfig object from a string representing the
- * various parameters. Acceptable patterns are like:
- * rs-3-2-1024k
- * RS-3-2-2048k
- * XOR-10-4-4096K
- * IllegalArgumentException will be thrown if the passed string does not
- * match the defined pattern.
- * @param string Parameters used to create ECReplicationConfig instances.
- * Format: <codec>-<data>-<parity>-<chunksize>
+ * Creates an ECReplicationConfig from a string in the form {@code
<codec>-<data>-<parity>-<chunk size>}, usually
+ * as {@link #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 the same config as
+ * rs-6-3-1024k.
+ * <p>
+ * This always creates a new object; {@link #getInstance(String)} returns a
shared one.
+ *
+ * @param string the EC replication config
+ * @throws IllegalArgumentException if the string is not in this form, or
the codec, data, parity or chunk size is
+ * invalid
*/
public ECReplicationConfig(String string) {
+ this(parse(string));
Review Comment:
Does this need to be wrapped in `this(...)` - `parse` returns an
ECReplicationConfig:
```
return new ECReplicationConfig(data, parity, codec, chunkSize);
```
And the call to this just seemed to copy the fields into a new object?
--
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]