swamirishi commented on code in PR #5399:
URL: https://github.com/apache/ozone/pull/5399#discussion_r1361031169
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1474,6 +1476,34 @@ private void listStatusFindKeyInTableCache(
cacheKeyMap.put(cacheKey, null);
}
}
+
+ // let's say fsPaths is disabled, then creating a key like a/b/c
+ // will not create intermediate keys in the keyTable so only entry
+ // in the keyTable would be {a/b/c}. This would be skipped from getting
+ // added to cacheKeyMap above as remainingKey would be {b/c} and it
+ // contains the slash, In this case we track such keys which are not added
+ // to the map, find the immediate child and check if they are present in
+ // the map. If not create a fake dir and add it. This is similar to the
+ // logic in findKeyInDbWithIterator.
+ if (!recursive) {
+ for (Map.Entry<String, OmKeyInfo> entry : remainingKeys.entrySet()) {
+ String remainingKey = entry.getKey();
+ String immediateChild =
+ OzoneFSUtils.getImmediateChild(remainingKey, keyArgs);
+ if (!cacheKeyMap.containsKey(immediateChild)) {
+ // immediateChild contains volume/bucket prefix remove it.
+ String volumeBuckPrefix = OZONE_URI_DELIMITER + entry.getValue()
Review Comment:
from what i understand this list would be for only one bucket. This can be
outside the loop, it would be a constant string for this function.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]