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/07/13 04:25:32 UTC

[GitHub] [ozone] jojochuang commented on a change in pull request #2367: HDDS-5384 OM refreshPipeline should not invoke the expensive OmKeyLocationInfoGroup.getLocationList()

jojochuang commented on a change in pull request #2367:
URL: https://github.com/apache/ozone/pull/2367#discussion_r668416760



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -745,33 +745,34 @@ protected void refreshPipeline(List<OmKeyInfo> keyList) throws IOException {
     }
 
     Set<Long> containerIDs = new HashSet<>();
-    for (OmKeyInfo keyInfo : keyList) {
-      List<OmKeyLocationInfoGroup> locationInfoGroups =
-          keyInfo.getKeyLocationVersions();
-
-      for (OmKeyLocationInfoGroup key : locationInfoGroups) {
-        for (OmKeyLocationInfo k : key.getLocationList()) {
-          containerIDs.add(k.getContainerID());
-        }
-      }
-    }
+    keyList.forEach(
+        keyInfo -> keyInfo.getKeyLocationVersions().forEach(
+            key -> key.getLocationLists().forEach(
+                OmKeyLocationInfoList -> OmKeyLocationInfoList.forEach(
+                    k -> containerIDs.add(k.getContainerID())

Review comment:
       ok let's do that.




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