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/04/26 05:27:42 UTC

[GitHub] [ozone] mukul1987 commented on a change in pull request #2136: HDDS-5073. Use ReplicationConfig on client side

mukul1987 commented on a change in pull request #2136:
URL: https://github.com/apache/ozone/pull/2136#discussion_r619846095



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/StorageInfo.java
##########
@@ -133,7 +133,8 @@ public void setClusterId(String clusterId) {
   }
 
   private void verifyNodeType(NodeType type)
-      throws InconsistentStorageStateException {
+      throws

Review comment:
       unintended changes ?

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ReplicationFactor.java
##########
@@ -71,6 +71,8 @@ public static ReplicationFactor fromProto(
     }
   }
 
+

Review comment:
       unintended changes ?

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/RatisReplicationConfig.java
##########
@@ -35,6 +35,16 @@ public RatisReplicationConfig(ReplicationFactor replicationFactor) {
     this.replicationFactor = replicationFactor;
   }
 
+  public RatisReplicationConfig(String factorString) {
+    ReplicationFactor factor = null;
+    try {
+      factor = ReplicationFactor.valueOf(Integer.parseInt(factorString));
+    } catch (NumberFormatException ex) {
+      factor = ReplicationFactor.valueOf(factorString);

Review comment:
       There are chances that both of these calls will throw errors? Whats the expected type of the factorString ?

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/keys/CopyKeyHandler.java
##########
@@ -82,17 +84,19 @@ protected void execute(OzoneClient client, OzoneAddress address)
     OzoneVolume vol = client.getObjectStore().getVolume(volumeName);
     OzoneBucket bucket = vol.getBucket(bucketName);
 
-    if (replicationFactor == null) {
-      replicationFactor = ReplicationFactor.valueOf(
-          getConf().getInt(OZONE_REPLICATION, OZONE_REPLICATION_DEFAULT));
-    }
-
     if (replicationType == null) {
       replicationType = ReplicationType.valueOf(
-          getConf().get(OZONE_REPLICATION_TYPE,
-              OZONE_REPLICATION_TYPE_DEFAULT));
+          getConf()
+              .get(OZONE_REPLICATION_TYPE, OZONE_REPLICATION_TYPE_DEFAULT));
     }
 
+    if (replication == null) {

Review comment:
       why, do we want to convert replication factor to a string ? What are the expected strings which we expect after EC implementation ?




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