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


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java:
##########
@@ -320,8 +322,10 @@ public void testOrphanBlock() throws Exception {
                 .setTxID(1L)
                 .setCount(10)
                 .build()));
-    dn2Service.getDatanodeStateMachine().getContext()
-        .addCommand(deleteBlocksCommand);
+    StateContext context = dn2Service.getDatanodeStateMachine().getContext();
+    deleteBlocksCommand.setTerm(context.getTermOfLeaderSCM().isPresent() ?
+            context.getTermOfLeaderSCM().getAsLong() : 0);

Review Comment:
   No need to update the PR for this, but wanted to mention:
   
   ```java
   context.getTermOfLeaderSCM().isPresent() ? 
context.getTermOfLeaderSCM().getAsLong() : 0
   ```
   
   can be simplified to
   
   ```
   context.getTermOfLeaderSCM().orElse(0)
   ```



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