You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Debasish Ghosh <gh...@gmail.com> on 2018/01/30 06:49:31 UTC

ReadOnlyKeyValueStore.range API

Hello -

The above API gives me the range of values between fromKey and toKey for a
local state store.

Suppose I have an application running in distributed mode (multiple nodes
same application id). How does this API translate to multiple nodes ? I
know the  basic implementation is for a local node. But is there an
algorithm to implement this range() function for the distributed setting ?

I can find out the host where fromKey lives, also the host where toKey
lives. But how do I know the elements in between ?

Any pointer will be appreciated ..

regards.
-- 
Sent from my iPhone

Re: ReadOnlyKeyValueStore.range API

Posted by "Matthias J. Sax" <ma...@confluent.io>.
You need to write some custom code using Interactive Queries and
implement a scatter-gather pattern.

Basically, you need to do the range on each instance and then merge all
partial results.

https://kafka.apache.org/10/documentation/streams/developer-guide/interactive-queries.html

You can also find an example for IQ here:
https://github.com/confluentinc/kafka-streams-examples


-Matthias

On 1/29/18 10:49 PM, Debasish Ghosh wrote:
> Hello -
> 
> The above API gives me the range of values between fromKey and toKey for a
> local state store.
> 
> Suppose I have an application running in distributed mode (multiple nodes
> same application id). How does this API translate to multiple nodes ? I
> know the  basic implementation is for a local node. But is there an
> algorithm to implement this range() function for the distributed setting ?
> 
> I can find out the host where fromKey lives, also the host where toKey
> lives. But how do I know the elements in between ?
> 
> Any pointer will be appreciated ..
> 
> regards.
>