Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-4064 Add support for infinite endpoints for range queries in Kafka Streams KV stores #1761

Closed
wants to merge 8 commits into from

Conversation

theduderog
Copy link
Contributor

@guozhangwang

I had to fix the bug with in-memory ranges being exclusive and RocksDB being inclusive to get meaningful tests to work.

@dguy
Copy link
Contributor

dguy commented Aug 19, 2016

@theduderog you have a checkstyle failure

@dguy
Copy link
Contributor

dguy commented Aug 19, 2016

After seeing the API changes, i'm wondering if it would be better if we have a single function range(Range<K> range) - and have a class sth like:

class Range<K>
   K from;
   K to;
   ...
   static <K> from(K key) ...
   static <K> until(K key) ..
  // etc

It at least means we can support everything with a single method on the KeyValuStore interface.
Interested in hearing what @guozhangwang @miguno @enothereska @mjsax think

@miguno
Copy link
Contributor

miguno commented Aug 19, 2016

I don't have a strong opinion.

I see the benefits of a single range(Range<K> range) method. Its drawback is that users have to construct a new instance of Range<K> every time, which is more cumbersome in terms of using the API.

So:

store.rangeFrom(3)

versus

store.range(Range.from(3))

Perhaps a question to ask is: Would we need a separate Range class because we expect to add more functions than what rangeFrom(K) and rangeUntil(K) would cover?

@theduderog
Copy link
Contributor Author

cc @ijuma as well

@ijuma
Copy link
Contributor

ijuma commented Aug 19, 2016

I prefer the method taking a Range personally (it is why I suggested that offline when the discussion was taking place). It is easy to add convenience methods later, if necessary, but hard to remove methods from the interface.

@guozhangwang
Copy link
Contributor

There are some jenkins failures that seems related to the changes.

@theduderog
Copy link
Contributor Author

@guozhangwang I'll fix those. What you think about the API?

@dguy
Copy link
Contributor

dguy commented Oct 14, 2016

@theduderog - sorry we haven't progressed this at all. Besides the conflicts. I'm in favor of the API as I mentioned above (Obviously!) @enothereska @mjsax @guozhangwang - thoughts?

@enothereska
Copy link
Contributor

Yeah good idea. Let's push to get this in asap. @theduderog could you resolve the conflict and then we can take it from there. Sorry for the delay.

@mjsax
Copy link
Member

mjsax commented Oct 25, 2016

ping @theduderog

@theduderog
Copy link
Contributor Author

retest this please

@theduderog
Copy link
Contributor Author

theduderog commented Oct 25, 2016

Is range() supposed to be inclusive or exclusive of the endpoint? So for, this PR makes them all inclusive.

The docs say inclusive, the RocksDB implementation is inclusive, but the InMemory implementation is exclusive.

Not to mentioned that Java SortedSet.subSet defaults to exclusive and seems like the more natural choice so it's likely what users expect.

@guozhangwang
Copy link
Contributor

Re: range() I think we can make it consistent as inclusive everywhere, the InMemoryStore's range function seems to be a bug itself. Could you fix it along with this PR?

Re: API, I think I also agree with @dguy and @ijuma on the new Range class that

class Range<K>
   private K from;
   private K to;
   ...
   static <K> from(K key) ...
   static <K> until(K key) ..
   static <K> range(K keyFrom, K keyUtil) ..

which could be generalized later. At the same time we can keep the current function and reimplemented as Range.range(..).

@guozhangwang
Copy link
Contributor

Made a pass over the implementation, LGTM overall.

@theduderog
Copy link
Contributor Author

retest this please

@guozhangwang
Copy link
Contributor

@theduderog retest this does not work for apache repos just FYI :P

@theduderog
Copy link
Contributor Author

thanks, @guozhangwang. it may have just been a coincidence but it seemed to kick off right after i added that comment

@guozhangwang
Copy link
Contributor

@theduderog Could you file a KIP for this API change as well?

Copy link
Contributor

@dguy dguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were going to have a single range method that takes a Range class?

@theduderog
Copy link
Contributor Author

@dguy I'll switch to that for the KIP

@mjsax mjsax added the streams label Jan 30, 2018
@mjsax mjsax added the kip Requires or implements a KIP label Jun 12, 2020
@mjsax
Copy link
Member

mjsax commented Feb 2, 2021

Closing this PR due to inactivity.

@mjsax mjsax closed this Feb 2, 2021
@vvcephei
Copy link
Contributor

FYI, this was implemented in #11120

efeg added a commit to efeg/kafka that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kip Requires or implements a KIP streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants