[ 
https://issues.apache.org/jira/browse/KAFKA-2389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708553#comment-14708553
 ] 

Jay Kreps commented on KAFKA-2389:
----------------------------------

I agree with you that few people will want the callback in the sync mode, that 
just means they'll use the variant without it. Using the callback with sync 
mode is still well defined and has exactly the expected meaning ("do this thing 
after the call is complete") it just isn't super useful because you could just 
as easily put your code afterwards. So I don't think there is anything 
confusing about it.

I'm okay with your proposal too, but 
1. We need to rename the async commits to commitAsync or something similar, you 
can't have two methods with the same name that behave totally differently and 
have different post-conditions.
2. We need to include variants of asyncCommit that don't take the callback. 
Having the user implement or discover a NoOpCallback to be able to use the api 
is not good.
The downside of this approach, as I pointed out, is that it leads to 8 variants 
of commit. Unfortunately the thing about variants is that in practice the user 
really does have to read all of them to make sure they're using the one they 
want. This means we make the common case gets more complicated still (adding 
callbacks already exploded this a bit).

> CommitType seems not necessary in commit().
> -------------------------------------------
>
>                 Key: KAFKA-2389
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2389
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Jiangjie Qin
>            Assignee: Jiangjie Qin
>
> The CommitType does not seem to be necessary in for commit(), it can be 
> inferred from whether user passed in a callback or not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to