adoroszlai commented on code in PR #4287:
URL: https://github.com/apache/ozone/pull/4287#discussion_r1111706488
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1176,24 +1176,51 @@ private OzoneFileStatus getOzoneFileStatus(OmKeyArgs
args,
*/
private OmKeyInfo createFakeDirIfShould(String volume, String bucket,
String keyName, BucketLayout layout) throws IOException {
- OmKeyInfo fakeDirKeyInfo = null;
String dirKey = OzoneFSUtils.addTrailingSlashIfNeeded(keyName);
String targetKey = OzoneFSUtils.addTrailingSlashIfNeeded(
metadataManager.getOzoneKey(volume, bucket, keyName));
+
+ Table<String, OmKeyInfo> keyTable = metadataManager.getKeyTable(layout);
+ Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> cacheIterator
=
+ keyTable.cacheIterator();
+ while (cacheIterator.hasNext()) {
Review Comment:
The loop over the cache does not assume any order, iterates until the first
match, so it should be OK.
I'm not sure about the effect on performance, it may be better or worse with
this. I'm OK with omitting this first loop completely.
--
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]