smengcl commented on code in PR #8587:
URL: https://github.com/apache/ozone/pull/8587#discussion_r2373472436
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java:
##########
@@ -927,4 +942,17 @@ public String getPath() {
}
return getParentObjectID() + OzoneConsts.OM_KEY_PREFIX + getFileName();
}
+
+ public static boolean isKeyEmpty(@Nullable OmKeyInfo keyInfo) {
+ if (keyInfo == null) {
+ return true;
+ }
+ for (OmKeyLocationInfoGroup keyLocationList : keyInfo
+ .getKeyLocationVersions()) {
+ if (keyLocationList.getLocationListCount() != 0) {
+ return false;
+ }
+ }
Review Comment:
This for-loop can also be turned into another helper method in `OmKeyInfo`,
say `hasBlocks()` (inverted).
--
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]