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: [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]

Reply via email to