smengcl commented on code in PR #4568:
URL: https://github.com/apache/ozone/pull/4568#discussion_r1179468312
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -241,6 +253,30 @@ public OmSnapshotManager(OzoneManager ozoneManager) {
this.snapshotDiffCleanupService.start();
}
+ /**
+ * Throws OMException FILE_NOT_FOUND if snapshot is not in active status.
+ * @param snapshotTableKey snapshot table key
+ */
+ public void checkSnapshotActive(String snapshotTableKey) throws IOException {
+ checkSnapshotActive(getSnapshotInfo(snapshotTableKey));
+ }
+
+ private void checkSnapshotActive(SnapshotInfo snapInfo) throws OMException {
+
+ if (!snapInfo.getSnapshotStatus().equals(SnapshotStatus.SNAPSHOT_ACTIVE)) {
Review Comment:
good catch
--
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]