You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "swamirishi (via GitHub)" <gi...@apache.org> on 2024/08/06 18:06:13 UTC

Re: [PR] HDDS-9198. Changed snapshot purge to single purge instead of batch purge [ozone]

swamirishi commented on PR #6491:
URL: https://github.com/apache/ozone/pull/6491#issuecomment-2271856999

   @hemantk-12 Can't we just lookup the object in the maps updatedPathPreviousAndGlobalSnapshots & updatedSnapInfos instead of just getting a fresh copy of 
   Can't we have a single map like updateSnapshotInfoMap which has all the keys that have been updated?
   ```
   SnapshotInfo updatedSnapshotInfo = omMetadataManager.getSnapshotInfoTable().get(snapInfo.getTableKey()); & SnapshotInfo nextPathSnapInfo =
           nextPathSnapshotKey != null ? metadataManager.getSnapshotInfoTable().get(nextPathSnapshotKey) : null;
   
       SnapshotInfo nextGlobalSnapInfo =
           nextGlobalSnapshotKey != null ? metadataManager.getSnapshotInfoTable().get(nextGlobalSnapshotKey) : null;
   ``` in  the functions updateSnapshotInfoAndCache & updateSnapshotChainAndCache instead of this we could have a function like:
   `private SnapshotInfo getLatestSnapshotInfo(String key, Map<String, SnapshotInfo> updatedMap) {
        if (updatedMap.containsKey(key)) {
              return updatedMap.get(key);
        } 
       return metadataManager.getSnapshotInfoTable().get(nextPathSnapshotKey);
   }`
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org