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 2022/09/30 01:41:19 UTC

[GitHub] [ozone] duongkame commented on a diff in pull request #3771: HDDS-7229. Introduce container location cache in ScmClient

duongkame commented on code in PR #3771:
URL: https://github.com/apache/ozone/pull/3771#discussion_r984139661


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ScmClient.java:
##########
@@ -52,4 +107,40 @@ public void setUpdateServiceGrpcClient(
   public SCMUpdateServiceGrpcClient getUpdateServiceGrpcClient() {
     return updateServiceGrpcClient;
   }
+
+  public Pipeline getContainerLocation(long containerId, boolean forceRefresh)
+      throws IOException {
+    if (forceRefresh) {
+      containerLocationCache.invalidate(containerId);
+    }
+    try {
+      return containerLocationCache.get(containerId);
+    } catch (ExecutionException e) {
+      return handleCacheExecutionException(e);
+    }
+  }
+
+  public Map<Long, Pipeline> getContainerLocations(Iterable<Long> containerIds,

Review Comment:
   A key is designed to have multiple blocks and thus multiple containers. Indeed, we always use this interface and don't really need `getContainerLocation`. Removed.



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