kpatelatwork commented on a change in pull request #10528:
URL: https://github.com/apache/kafka/pull/10528#discussion_r614230413



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/SourceTaskOffsetCommitter.java
##########
@@ -105,6 +105,11 @@ public void remove(ConnectorTaskId id) {
     }
 
     private void commit(WorkerSourceTask workerTask) {
+        if (!workerTask.shouldCommitOffsets()) {

Review comment:
       I prefer the encapsulation approach but will leave the decision to you 
as it's a minor nitpick :).
   
   I prefer encapsulation because the caller to `commitOffsets` need not worry 
about first calling `shouldCommitOffsets` and only if it's true then I should 
call `commitOffsets`.  Think like we don't need to do  `!ArrayList.isEmpty` 
check before iterating over it :).




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to