sodonnel commented on a change in pull request #3150:
URL: https://github.com/apache/ozone/pull/3150#discussion_r818581047
##########
File path:
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Utils.java
##########
@@ -41,4 +49,71 @@ public static String urlEncode(String str)
private S3Utils() {
// no instances
}
+
+ /**
+ * This API used to resolve the client side configuration preference for file
+ * system layer implementations.
+ *
+ * @param s3StorageTypeHeader - s3 user passed storage type
+ * header.
+ * @param clientConfiguredReplConfig - Client side configured replication
+ * config.
+ * @param bucketReplConfig - server side bucket default replication
+ * config.
+ * @return client resolved replication config.
+ */
+ public static ReplicationConfig resolveS3ClientSideReplicationConfig(
+ String s3StorageTypeHeader, ReplicationConfig clientConfiguredReplConfig,
+ ReplicationConfig bucketReplConfig)
+ throws OS3Exception {
+ ReplicationConfig clientDeterminedReplConfig = null;
+
+ // Let's map the user provided s3 storage type header to ozone s3 storage
+ // type.
+ S3StorageType s3StorageType = null;
+ if (s3StorageTypeHeader != null && !s3StorageTypeHeader.equals("")) {
+ s3StorageType = toS3StorageType(s3StorageTypeHeader);
+ }
+
+ boolean isECBucket = bucketReplConfig != null && bucketReplConfig
+ .getReplicationType() == HddsProtos.ReplicationType.EC;
+
+ // if bucket replication config configured with EC, we will give high
+ // preference to server side bucket defaults.
+ // Why we give high prefernce to EC is, there is no way for file system
Review comment:
Typo prefernce -> preference
--
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]