[ 
https://issues.apache.org/jira/browse/HDDS-14939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sreeja updated HDDS-14939:
--------------------------
    Description: 
This change implements the logic to {*}rewrite table metadata version files 
across the metadata history{*}, enabling path migration from a source prefix to 
a target prefix.

Traversal should start from the provided endMetadata (current or specified 
version) and iterate backwards through previous files until reacting the 
startVersion provided if any. We also need to collect all the snapshots from 
each traversed historical metadata version.

For each metadata version we have to rewrite file paths sourcePrefix -> 
targetPrefix and generate a new metadata file in the staging location and 
generate the copy plan.

  was:
This change implements the logic to {*}rewrite table metadata version files 
across the metadata history{*}, enabling path migration from a source prefix to 
a target prefix.

The implementation traverses metadata versions (current + previous), rewrites 
each version file, and generates a *copy plan* for staging and final file 
placement.
h3. *Key Functionality*
 * *Metadata Version Traversal*

 * 
 ** Starts from the provided {{endMetadata}} (current or specified end version).

 * 
 ** Iterates backward through {{previousFiles()}} until reaching the configured 
{{{}startVersion{}}}.

 * 
 ** Ensures each version file exists before processing.

 * *Snapshot Collection*

 * 
 ** Collects all snapshots from:

 * 
 ** 
 *** current metadata

 * 
 ** 
 *** each traversed historical metadata version

 * *Version File Rewrite*

 * 
 ** For each metadata version:

 * 
 ** 
 *** Rewrites file paths using {{sourcePrefix}} → {{{}targetPrefix{}}}.

 * 
 ** 
 *** Generates a new metadata file in the staging location.

 * *Copy Plan Generation*

 * 
 ** Builds a mapping of:

 * 
 ** 
 *** *staged file path → final target path*

h3. *Output*

Returns a {{RewriteResult<Snapshot>}} containing:
 * *Snapshots to rewrite* → all collected snapshots across versions

 * *Copy plan* → set of {{(staging path, final path)}}

 


> Implement version file rewrite logic for path migration across metadata 
> history
> -------------------------------------------------------------------------------
>
>                 Key: HDDS-14939
>                 URL: https://issues.apache.org/jira/browse/HDDS-14939
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Sreeja
>            Assignee: Sreeja
>            Priority: Major
>
> This change implements the logic to {*}rewrite table metadata version files 
> across the metadata history{*}, enabling path migration from a source prefix 
> to a target prefix.
> Traversal should start from the provided endMetadata (current or specified 
> version) and iterate backwards through previous files until reacting the 
> startVersion provided if any. We also need to collect all the snapshots from 
> each traversed historical metadata version.
> For each metadata version we have to rewrite file paths sourcePrefix -> 
> targetPrefix and generate a new metadata file in the staging location and 
> generate the copy plan.



--
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