smengcl commented on code in PR #4634:
URL: https://github.com/apache/ozone/pull/4634#discussion_r1183145461


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java:
##########
@@ -87,7 +89,15 @@ public OMSnapshotCreateRequest(OMRequest omRequest) {
   }
 
   @Override
+  @DisallowedUntilLayoutVersion(SNAPSHOT_SUPPORT)
   public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+    if (!ozoneManager.getVersionManager()
+            .isAllowed(SNAPSHOT_SUPPORT)) {
+      throw new OMException(
+              "cannot be invoked before finalization.",

Review Comment:
   The annotation `@DisallowedUntilLayoutVersion` itself is already supposed to 
do the same thing as the `isAllowed()` check internally. It will throw 
exception if the layout version is too low.
   
   So this `if` condition is unnecessary here.



-- 
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]

Reply via email to