adoroszlai commented on code in PR #4286:
URL: https://github.com/apache/ozone/pull/4286#discussion_r1112273321


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java:
##########
@@ -484,8 +486,11 @@ private void printStats(PrintStream out) {
     out.println("Number of Volumes created: " + numberOfVolumesCreated);
     out.println("Number of Buckets created: " + numberOfBucketsCreated);
     out.println("Number of Keys added: " + numberOfKeysAdded);
-    out.println("Replication: " + replicationConfig.getReplication());
-    out.println("Replication type: " + replicationConfig.getReplicationType());
+    out.println("Replication: " + (replicationConfig != null ?
+        replicationConfig.getReplication() : OZONE_REPLICATION_DEFAULT));
+    out.println("Replication type: " + (replicationConfig != null ?
+        replicationConfig.getReplicationType() :
+        OZONE_REPLICATION_TYPE_DEFAULT));

Review Comment:
   If `replicationConfig` is `null`, actual replication is set at server-side 
based on config.  It could be different from the defaults from 
`OzoneConfigKeys`.  I think it would be better to skip printing replication 
info in that case.
   
   ```suggestion
       if (replicationConfig != null) {
         out.println("Replication: " + replicationConfig.getReplication());
         out.println("Replication type: " + 
replicationConfig.getReplicationType());
       }
   ```
   
   or even:
   
   ```suggestion
       if (replicationConfig != null) {
         out.println("Replication: " + replicationConfig);
       }
   ```
   



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

Reply via email to