[
https://issues.apache.org/jira/browse/HDDS-16490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Meng-Shuan Tsai updated HDDS-16490:
-----------------------------------
Description:
Implement 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 into the S3 {{Retention}} XML: {{{}Mode{}}}, {{RetainUntilDate}}
(ISO-8601). While the event hold is {{{}ON{}}}, also return {{EventHold=ON}}
and {{{}EventHoldDuration{}}}, and the date is the computed one. After release,
return {{EventHold=OFF}} (or omit it) without the duration.
* Map OM exceptions to standard S3 error responses:
*
** Errors: {{{}404 NoSuchKey{}}}; {{404 NoSuchObjectLockConfiguration}} if the
key has no retention; {{400 InvalidRequest}} if the bucket does not have Object
Lock enabled.
*
** 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:
*
** {{GetObjectRetentionResponse}} (contains the key's {{KeyRetention}} and the
effective retain-until date computed by OM).
*
** {{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{}}}.
was:
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{}}}.
> Implement GetObjectRetention
> ----------------------------
>
> Key: HDDS-16490
> URL: https://issues.apache.org/jira/browse/HDDS-16490
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Chung-En Lee
> Assignee: Meng-Shuan Tsai
> Priority: Major
>
> Implement 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 into the S3 {{Retention}} XML: {{{}Mode{}}}, {{RetainUntilDate}}
> (ISO-8601). While the event hold is {{{}ON{}}}, also return {{EventHold=ON}}
> and {{{}EventHoldDuration{}}}, and the date is the computed one. After
> release, return {{EventHold=OFF}} (or omit it) without the duration.
> * Map OM exceptions to standard S3 error responses:
> *
> ** Errors: {{{}404 NoSuchKey{}}}; {{404 NoSuchObjectLockConfiguration}} if
> the key has no retention; {{400 InvalidRequest}} if the bucket does not have
> Object Lock enabled.
> *
> ** 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:
> *
> ** {{GetObjectRetentionResponse}} (contains the key's {{KeyRetention}} and
> the effective retain-until date computed by OM).
> *
> ** {{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
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]