devmadhuu commented on code in PR #11229:
URL: https://github.com/apache/ozone/pull/11229#discussion_r4119636546
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Consts.java:
##########
@@ -131,6 +131,11 @@ public final class S3Consts {
/** Request header carrying the list of object attributes to return. */
public static final String OBJECT_ATTRIBUTES_HEADER =
"x-amz-object-attributes";
+ // S3 storage class values passed via the `x-amz-storage-class` request
header.
+ public static final String S3_STORAGE_CLASS_STANDARD = "STANDARD";
+ public static final String S3_STORAGE_CLASS_STANDARD_IA = "STANDARD_IA";
+ public static final String S3_STORAGE_CLASS_GLACIER = "GLACIER";
+
Review Comment:
@F64116045 Yes, agreed. After combining the mappings, the reverse lookup
should use both `ReplicationConfig` and `StoragePolicy`, since HOT alone cannot
distinguish `REDUCED_REDUNDANCY` from `STANDARD`. `COLD` uniquely identifies
`GLACIER`, so null is not needed. In the follow-up S3 write PR, the PUT path
will use this unified mapping to resolve both values from the same
`x-amz-storage-class` header—for example, `GLACIER` will map to `RATIS` `THREE`
and `COLD`. I’ll update the enum and tests accordingly. So I am trying to
propose below enum structure :
```
REDUCED_REDUNDANCY(
RatisReplicationConfig.getInstance(ReplicationFactor.ONE),
OzoneStoragePolicy.HOT),
STANDARD(
RatisReplicationConfig.getInstance(ReplicationFactor.THREE),
OzoneStoragePolicy.HOT),
STANDARD_IA(
new ECReplicationConfig(3, 2),
OzoneStoragePolicy.WARM),
GLACIER(
RatisReplicationConfig.getInstance(ReplicationFactor.THREE),
OzoneStoragePolicy.COLD);
```
Kindly advise. I think this keeps backward compatibility for existing
objects that do not yet have a storage policy, while future PUT requests use
one enum and one header parse.
--
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]