aswinshakil commented on code in PR #4436:
URL: https://github.com/apache/ozone/pull/4436#discussion_r1143830294
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequestUtils.java:
##########
@@ -47,4 +60,40 @@ public static void checkClientRequestPrecondition(
OMException.ResultCodes.INTERNAL_ERROR);
}
}
+
+ public static boolean isSnapshotBucket(OMMetadataManager omMetadataManager,
+ OmKeyInfo keyInfo) throws IOException {
+
+ boolean status;
+ TableIterator<String, ? extends Table.KeyValue<String, SnapshotInfo>>
+ iterator = omMetadataManager.getSnapshotInfoTable().iterator();
+ String dbSnapshotBucketKey = omMetadataManager.getBucketKey(
+ keyInfo.getVolumeName(), keyInfo.getBucketName())
+ + OM_KEY_PREFIX;
+
+ iterator.seek(dbSnapshotBucketKey);
+ status = iterator.hasNext() && iterator.next().getKey()
Review Comment:
We are also checking the snapshotDbKey which is `volume/bucket/snapName`
along with the `seek()`, so it should be fine.
--
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]