chia7712 commented on code in PR #17965:
URL: https://github.com/apache/kafka/pull/17965#discussion_r1868169155


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2221,6 +2220,13 @@ AcquisitionLockTimerTask 
batchAcquisitionLockTimeoutTask() {
             return batchState.acquisitionLockTimeoutTask;
         }
 
+        private RecordState batchRollbackState() {
+            if (batchState == null) {

Review Comment:
   Could you please add a helper method to obtain a non-null batchState? For 
example:
   
   
   ```java
           private InFlightState inFlightState() {
               if (batchState == null) {
                   throw new IllegalStateException("The batch state is not 
available as the offset state is maintained");
               }
               return batchState;
           }
   ```



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

Reply via email to