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 2020/03/19 19:17:00 UTC

[GitHub] [hadoop-ozone] nandakumar131 commented on a change in pull request #692: HDDS-3168. Improve read efficiency by merging a lot of RPC call getContainerWithPipeline into one

nandakumar131 commented on a change in pull request #692: HDDS-3168. Improve read efficiency by merging a lot of RPC call getContainerWithPipeline into one
URL: https://github.com/apache/hadoop-ozone/pull/692#discussion_r395250835
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
 ##########
 @@ -687,36 +688,46 @@ public OmKeyInfo lookupKey(OmKeyArgs args, String clientAddress)
    */
   @VisibleForTesting
   protected void refreshPipeline(OmKeyInfo value) throws IOException {
-    if (value != null &&
-        CollectionUtils.isNotEmpty(value.getKeyLocationVersions())) {
-      Map<Long, ContainerWithPipeline> containerWithPipelineMap =
-          new HashMap<>();
-      for (OmKeyLocationInfoGroup key : value.getKeyLocationVersions()) {
-        for (OmKeyLocationInfo k : key.getLocationList()) {
-          // TODO: fix Some tests that may not initialize container client
-          // The production should always have containerClient initialized.
-          if (scmClient.getContainerClient() != null) {
-            try {
-              if (!containerWithPipelineMap.containsKey(k.getContainerID())) {
-                ContainerWithPipeline containerWithPipeline = scmClient
-                    .getContainerClient()
-                    .getContainerWithPipeline(k.getContainerID());
-                containerWithPipelineMap.put(k.getContainerID(),
-                    containerWithPipeline);
-              }
-            } catch (IOException ioEx) {
-              LOG.debug("Get containerPipeline failed for volume:{} bucket:{} "
+    // TODO: fix Some tests that may not initialize container client
+    // The production should always have containerClient initialized.
+    if (scmClient.getContainerClient() == null) {
+      return;
+    }
+
+    if (value == null
+            || CollectionUtils.isEmpty(value.getKeyLocationVersions())) {
+      return;
+    }
 
 Review comment:
   ```suggestion
       final List<OmKeyLocationInfoGroup> locationGroups = value == null ?
           null : value.getKeyLocationVersions();
   
       if (scmClient.getContainerClient() == null ||
           CollectionUtils.isEmpty(locationGroups)) {
         return;
       }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org