Chung-En Lee created HDDS-16490:
-----------------------------------

             Summary: Implement GetObjectRetention API
                 Key: HDDS-16490
                 URL: https://issues.apache.org/jira/browse/HDDS-16490
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Chung-En Lee


mplement the S3 {{GetObjectRetention}} operation to retrieve the active 
retention configuration ({{{}Mode{}}} and {{{}RetainUntilDate{}}}) of an 
individual key. This task spans S3 Gateway REST routing, OM client protocol 
translation, Ranger authorization, and OM metadata lookup in {{{}KeyTable{}}}.

{*}1. S3 Gateway ({{{}hadoop-ozone/s3gateway{}}}){*}:
 * Add route handler for {{{}GET /\{bucket}/\{key}?retention{}}}.

 * Forward the request to Ozone Manager via client protocol.

 * Serialize the returned retention metadata into standard S3 {{Retention}} XML:
XML
 * Map OM exceptions to standard S3 error responses:

 ** Return {{404 NoSuchKey}} if the key does not exist.

 ** Return {{404 NoSuchObjectLockConfiguration}} ({{{}The specified object does 
not have an ObjectLock configuration{}}}) if the key exists but has no 
retention settings applied.

{*}2. Protobuf Protocol ({{{}OmClientProtocol.proto{}}}) & OM Client{*}:
 * Add RPC messages:

 ** {{GetObjectRetentionRequest}} (contains {{{}volumeName{}}}, 
{{{}bucketName{}}}, {{{}keyName{}}}).

 ** {{GetObjectRetentionResponse}} (contains {{RetentionConfig}} with 
{{retentionMode}} and {{{}retainUntilDate{}}}).

 * Register the new request type in {{OmClientProtocol}} and wire through 
{{{}OzoneManagerProtocolClientSideTranslatorPB{}}}.

{*}3. OM Read Path / Metadata Handler ({{{}hadoop-ozone/ozone-manager{}}}){*}:
 * Authorize the incoming request against Ranger action {{GetObjectRetention}} 
(requiring key-level {{READ}} permission).

 * Acquire bucket/key read lock and retrieve {{OmKeyInfo}} from 
{{{}KeyTable{}}}.

 * If key is absent, throw {{{}KEY_NOT_FOUND{}}}.

 * Inspect {{{}OmKeyInfo.getRetentionConfig(){}}}:

 ** If {{retentionConfig}} is null or unconfigured, throw 
{{OBJECT_LOCK_CONFIG_NOT_FOUND}} (mapped to S3 {{{}404 
NoSuchObjectLockConfiguration{}}}).

 ** If retention exists, return the {{RetentionConfig}} domain model containing 
{{Mode}} and calculated {{{}RetainUntilDate{}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to