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 03:15:58 UTC

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

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



##########
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:
       We don‘t need to include the locationVersionMap to the new  OmKeyLocationInfoGroup even when version is true.  
   The current OmKeyLocationInfoGroup design actually has one point to improve.   You can refer to @symious document https://docs.google.com/document/d/1UYVETpSHyVppNPjHq8VuXj2t2Y0LYQNRYa6awSTCROA/edit#heading=h.h2k2ovrsrw33 for more detail information. 




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