adoroszlai commented on code in PR #12056:
URL: https://github.com/apache/ozone/pull/12056#discussion_r4582608192


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java:
##########
@@ -114,16 +115,15 @@ public void handle(SCMCommand<?> command, OzoneContainer 
ozoneContainer,
         switch (container.getContainerState()) {
         case OPEN:
         case CLOSING:
-          // If the container is part of open pipeline, close it via
-          // write channel
-          if (ozoneContainer.getWriteChannel()
-              .isExist(closeCommand.getPipelineID())) {
+          final PipelineID pipelineID = ((CloseContainerCommand) 
command).getPipelineID();

Review Comment:
   nit (only change if you have to update the patch for any other reason): we 
can avoid this cast by storing the previous cast result before `getProto()` at:
   
   
https://github.com/apache/ozone/blob/83d5aed7db1093cf1c41831c17691fa680f72c88/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java#L96-L97



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