bharatviswa504 commented on a change in pull request #2261:
URL: https://github.com/apache/ozone/pull/2261#discussion_r639908056



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -2370,4 +2387,22 @@ void sortDatanodes(String clientMachine, OmKeyInfo... 
keyInfos) {
     }
     return nodeSet;
   }
+
+  private void slimLocationVersion(OmKeyInfo... keyInfos) {
+    if (keyInfos != null) {
+      for (OmKeyInfo keyInfo : keyInfos) {
+        OmKeyLocationInfoGroup key = keyInfo.getLatestVersionLocations();
+        if (key == null) {
+          LOG.warn("No location version for key {}", keyInfo);
+          continue;
+        }
+        int keyLocationVersionLength = keyInfo.getKeyLocationVersions().size();
+        if (keyLocationVersionLength <= 1) {
+          continue;
+        }
+        keyInfo.setKeyLocationVersions(keyInfo.getKeyLocationVersions()

Review comment:
       >I think we can raise another ticket to check the design?
   
   Makes sense to me. Let us raise a new Jira and discuss this.
   
   >For subList, since setKeyLocationVersions accepts a List, seems we can't 
return the last value directly.
   Got it.
   




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

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