sodonnel commented on code in PR #4013:
URL: https://github.com/apache/ozone/pull/4013#discussion_r1041090571
##########
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:
If we use null for "don't overwrite" and also "clear" I am not sure how we
can make the distinction.
To clear the replicationConfig, I think you will need:
1. A new parameter on OMBucketArgs - reset or clearReplicationConfig
2. Adjust RpcClient.setReplicationConfig, so that if a null
ReplicationConfig is passed into it, it sets the new flag on OMBucketArgs.
3. Handle the new flag in the code where it saves the bucket args.
4. Change SetReplicationConfigHandler to either accept a "--reset" flag to
indicate it need to clear the repConfig, or a new handler
ResetReplicationConfigHandler to do the same, passing a null as
ReplicationConfig to `bucket.setReplicationConfig(...)`
We can be fairly sure someone will come asking to clear the
replicationConfig on a bucket some day, so it would be good to fix this.
However I would do it in another Jira than this one, as I think this one is
good now.
--
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]