amaliujia commented on code in PR #11869:
URL: https://github.com/apache/ozone/pull/11869#discussion_r4436347671
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ReplicationType.java:
##########
@@ -54,18 +63,6 @@ public static HddsProtos.ReplicationType toProto(
if (replicationType == null) {
return null;
}
- switch (replicationType) {
- case RATIS:
- return HddsProtos.ReplicationType.RATIS;
- case STAND_ALONE:
- return HddsProtos.ReplicationType.STAND_ALONE;
- case CHAINED:
- return HddsProtos.ReplicationType.CHAINED;
- case EC:
- return HddsProtos.ReplicationType.EC;
- default:
- throw new IllegalArgumentException(
- "Unsupported replication type: " + replicationType);
- }
+ return replicationType.toProto();
Review Comment:
We lose a `IllegalArgumentException` in OM and delay it to SCM as a
`IOException`:
OM would have already throw here:
https://github.com/apache/ozone/blob/20da41e535b0d7ec923d818b988fd3ea8b36f0a3/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java#L107
But now SCM later will see it:
https://github.com/apache/ozone/blob/20da41e535b0d7ec923d818b988fd3ea8b36f0a3/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableContainerFactory.java#L77
Does this consider as a behavior change? If so, we should remain the
validation here.
--
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]