jojochuang commented on code in PR #11328:
URL: https://github.com/apache/ozone/pull/11328#discussion_r4212132548
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java:
##########
@@ -154,6 +155,21 @@ public static OMPathInfo verifyFilesInPath(
return new OMPathInfo(missing, OMDirectoryResult.NONE, acls);
}
+ /**
+ * Reads only the objectID of the directory stored under the given directory
table key, without
+ * materializing an {@link OmDirectoryInfo}. The path walks below need each
parent directory's
+ * objectID, but a full read also decodes and rebuilds the ACL list, the
metadata map and the
+ * timestamps, which they discard.
+ *
+ * @return the directory's objectID, or null if there is no directory under
that key.
+ */
+ private static Long getDirObjectId(OMMetadataManager omMetadataManager,
String dbNodeName)
+ throws IOException {
+ return omMetadataManager.getDirectoryTable().getProjected(dbNodeName,
+ OmDirectoryInfo::getObjectID,
+ SnapshotDiffValueParser::parseDirectoryInfoObjectId);
Review Comment:
Reusing snapshot-diff partial parsing on the OM hot path is fine
technically, but the name/location (SnapshotDiffValueParser) is a bit
misleading for maintainers.
Nit: Consider a neutral helper (e.g. next to DirectoryInfo codec /
OmDirectoryInfo) and have snapshot diff delegate to it.
--
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]