Thanks for the comment Jun. Please see the reply in line On Mon, Sep 19, 2016 at 10:21 AM, Jason Gustafson <ja...@confluent.io> wrote:
> +1 on Jun's suggestion to use "beginning" and "end". The term "latest" is > misleading since the last message in the log may not have the largest > timestamp. > > On Mon, Sep 19, 2016 at 9:49 AM, Jun Rao <j...@confluent.io> wrote: > > > Hi, Jiangjie, > > > > Thanks for the proposal. Looks good to me overall. Just a couple of minor > > comments. > > > > 1. I thought at some point you considered to only return offset in > > offsetsForTimes instead of offset and timestamp. One benefit of doing > that > > is that it will make the return type consistent among all three new apis. > > It also feels a bit weird that we only return timestamp, but not other > > metadata associated with a message. > I changed the interface for earliestOffsets() and latestOffsets() to return only offset instead of OffsetAndTimestamp because the timestamp may not always be meaningful. For offsetsForTimes(), the primary reason to return the timestamp with offset is because the found timestamp may not always be the same as target timestamp. Returning timestamp with offset may be useful if users do not always want to read the message afterwards. For example, user may not want to consume a message if its timestamp is too far away from the target timestamp. Also users may only want to perform some query based timestamp without consuming all the messages. e.g. total number of messages in a time range. I did not think much about other metadata of the message because it seems the interface only cares about the timestamp and the offsets. > > > 2. To be consistent with existing seek apis, would it be better to rename > > earliestOffsets() and latestOffsets() to beginningOffsets() and > > endOffsets()? > Good point, will make the change. This makes the name align with seekToBeginning() and seekToEnd(). > > > Jun > > > > On Fri, Sep 9, 2016 at 4:38 PM, Becket Qin <becket....@gmail.com> wrote: > > > > > Hi all, > > > > > > I'd like to start the voting for KIP-79 > > > > > > In short we propose to : > > > 1. add a ListOffsetRequest/ListOffsetResponse v1, and > > > 2. add earliestOffsts(), latestOffsets() and offsetForTime() methods in > > the > > > new consumer. > > > > > > The KIP wiki is the following: > > > https://cwiki.apache.org/confluence/pages/viewpage. > > action?pageId=65868090 > > > > > > Thanks, > > > > > > Jiangjie (Becket) Qin > > > > > >