Hello Tom, This is a long-delayed reply, but I've finally discovered the bug you reported inside session stores, and here is a fix that I've put up for trunk:
https://github.com/apache/kafka/pull/6134 Sorry it took a while for me to get back to you! Guozhang On Wed, Oct 17, 2018 at 8:31 AM Guozhang Wang <[email protected]> wrote: > Tom, > > I think there is a documentation error on the `findSessions` function, > where the last parameter should really be "the start timestamp of the > latest session to search for". > > So back to your example, if you want to find "any sessions that has an > overlap of [T2, T4)" you should be calling `findSessions(K1, T4, T2)` > instead, i.e. the second parameter should be larger than the third, > otherwise there is no "range" to search for. > > I will go ahead and update the java doc accordingly. > > Guozhang > > > On Tue, Oct 16, 2018 at 8:13 AM Guozhang Wang <[email protected]> wrote: > >> Hello Tom, >> >> Thanks for reporting the observed issue. I've looked into the source code >> and I agree with you that there is indeed a mistake interpreting the >> parameters. >> >> I'll file a JIRA to keep track, and fix it asap. >> >> >> Guozhang >> >> On Fri, Oct 12, 2018 at 10:06 AM Thomas Becker <[email protected]> >> wrote: >> >>> I've been experimenting with the streams SessionStore and found some >>> behavior that contradicts the javadoc. Specifically: I have a SessionStore, >>> and put() a session with key K1 and session of time T0-T5. I then call >>> findSessions("K1", T2, T4) and it comes back empty. I would expect the >>> session to be returned since, according to the documentation that call >>> fetches "any sessions with the matching key and the sessions end is >= >>> earliestSessionEndTime and the sessions start is <= latestSessionStartTime" >>> and obviously T5 >= T2 and T0 <= T4. From the behavior I see, the third >>> parameter to this method should be called "latestSession*End*Time". That >>> is, the method returns all sessions that end within the range given. Any >>> thoughts? >>> >>> >>> >>> ________________________________ >>> >>> This email and any attachments may contain confidential and privileged >>> material for the sole use of the intended recipient. Any review, copying, >>> or distribution of this email (or any attachments) by others is prohibited. >>> If you are not the intended recipient, please contact the sender >>> immediately and permanently delete this email and any attachments. No >>> employee or agent of TiVo Inc. is authorized to conclude any binding >>> agreement on behalf of TiVo Inc. by email. Binding agreements with TiVo >>> Inc. may only be made by a signed written agreement. >>> >> >> >> -- >> -- Guozhang >> > > > -- > -- Guozhang > -- -- Guozhang
