[
https://issues.apache.org/jira/browse/KAFKA-2389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715565#comment-14715565
]
Guozhang Wang commented on KAFKA-2389:
--------------------------------------
I'm late on this discussion, but here are my two cents:
"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."
I feel it is OK to have sync / async differentiated by the callback rather than
by their names. For example ZooKeeper has a similar approach regarding sync /
async APIs:
http://zookeeper.apache.org/doc/r3.4.5/api/org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String,
org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.StatCallback,
java.lang.Object)
"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."
With commit(OffsetCommitCallback callback), users can just call commit(null)
and do not need to implement a NoOpCallback, right?
I am personally not favor of making commitSync / commitAsync function names.
> 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)