You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/10 07:14:10 UTC

[GitHub] [ozone] kuenishi commented on a change in pull request #2433: HDDS-5461. Move old objects to delete table on overwrite

kuenishi commented on a change in pull request #2433:
URL: https://github.com/apache/ozone/pull/2433#discussion_r685752616



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java
##########
@@ -143,16 +143,22 @@ public static OmKeyLocationInfoGroup getFromProtobuf(
   }
 
   /**
-   * Given a new block location, generate a new version list based upon this
-   * one.
+   * Given a new block location, generate a new version list based upon the
+   * version number of this object. Keep the blocks to when keepVersions is
+   * on for object versioning.
    *
    * @param newLocationList a list of new location to be added.
+   * @param keepVersions a knob to carry current locations to the next version.
    * @return newly generated OmKeyLocationInfoGroup
    */
   OmKeyLocationInfoGroup generateNextVersion(
-      List<OmKeyLocationInfo> newLocationList) {
-    Map<Long, List<OmKeyLocationInfo>> newMap =
-        new HashMap<>();
+      List<OmKeyLocationInfo> newLocationList, boolean keepVersions) {
+    Map<Long, List<OmKeyLocationInfo>> newMap = null;
+    if (keepVersions) {
+      newMap = new HashMap<>(locationVersionMap);

Review comment:
       Thank you for the review. I updated the commented  part so that it does keep past location version map and also added option 3 of my idea in this issue to the @symious document.
   
   I'm sorry that I don't have much time to add necessary unit tests and make integration tests passing for now, but will try in a few days.




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