You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ArafatKhan2198 (via GitHub)" <gi...@apache.org> on 2023/02/26 17:01:41 UTC

[GitHub] [ozone] ArafatKhan2198 commented on a diff in pull request #4182: HDDS-5463. [FSO] Recon Container API does not work correctly with FSO.

ArafatKhan2198 commented on code in PR #4182:
URL: https://github.com/apache/ozone/pull/4182#discussion_r1118119522


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -157,11 +157,17 @@ public Response getKeysForContainer(
       for (ContainerKeyPrefix containerKeyPrefix : containerKeyPrefixMap
           .keySet()) {
 
-        // Directly calling get() on the Key table instead of iterating since
-        // only full keys are supported now. When we change to using a prefix
-        // of the key, this needs to change to prefix seek.
-        OmKeyInfo omKeyInfo = omMetadataManager.getKeyTable(getBucketLayout())
-            .getSkipCache(containerKeyPrefix.getKeyPrefix());
+      // Directly calling getSkipCache() on the Key/FileTable table accordingly
+      // instead of iterating since only full keys are supported now. We will
+      // try to get the OmKeyInfo object by searching the KEY_TABLE table with
+      // the key prefix. If it's not found, we will then search the FILE_TABLE
+        OmKeyInfo omKeyInfo = omMetadataManager.getKeyTable(BucketLayout.LEGACY)
+            .getSkipCache(containerKeyPrefix.getKeyPrefix()) == null ?
+            omMetadataManager.getKeyTable(BucketLayout.FILE_SYSTEM_OPTIMIZED)
+                .getSkipCache(containerKeyPrefix.getKeyPrefix()) :
+            omMetadataManager.getKeyTable(BucketLayout.LEGACY)
+                .getSkipCache(containerKeyPrefix.getKeyPrefix());

Review Comment:
   Thanks for the suggestion @dombizita I have made the changes, do take a look !!



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