sodonnel commented on code in PR #4013:
URL: https://github.com/apache/ozone/pull/4013#discussion_r1038592355


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketArgs.java:
##########
@@ -150,11 +151,20 @@ public DefaultReplicationConfig 
getDefaultReplicationConfig() {
     return defaultReplicationConfig;
   }
 
+  /**
+   * Returns true if defaultReplicationConfig has been set
+   * to a non default value.
+   */
+  public boolean hasDefaultReplicationConfig() {

Review Comment:
   Do we actually need this method in this case? In #3975 the problem was a 
little different. The values there were longs, which in Java cannot be null and 
default to zero. Therefore it was impossible to tell if zero was passed or it 
was just the default value. The value here is an object and can be null, so 
maybe its enought to check it for non null?
   
   In OMBucketSetProperty, we have:
   
   ```
         if (defaultReplicationConfig != null) {
           // Resetting the default replication config.
           
bucketInfoBuilder.setDefaultReplicationConfig(defaultReplicationConfig);
         } else if (dbBucketInfo.getDefaultReplicationConfig() != null) {
           // Retaining existing default replication config
           bucketInfoBuilder.setDefaultReplicationConfig(
                     dbBucketInfo.getDefaultReplicationConfig());
         }
   ```
   So we don't use this method there.
   
   One thing that comes to mind - is it possible to remove a default rep config 
from a bucket, so it would then use the server default? Would we be able to?



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