It's _not_ a public contract that data of a range() query are returned
ordered by key. Thus, you should not rely on it.

It depends on the store implementation, and it just happens that default
RocksDB does return the data ordered.


-Matthias

On 2/21/19 9:23 AM, Yurii Demchenko wrote:
> Dear Kafka creators,
> 
> First of all I would like to thank you for your great product.
> I have a question relating to the Kafka stores and I will be really
> appreciate if you find a minute to answer.
> 
> According to javadoc of ReadOnlyKeyValueStore#range(K from, K to) method:
> 
>> Get an iterator over a given range of keys. This iterator must be closed
>> after use. The returned iterator must be safe from
>> ConcurrentModificationExceptions and must not return null values. *No
>> ordering guarantees are provided*
> 
> I'm using *KeyValueStore<Long, String>* obtained from *GlobalKTable* via
> *ProcessorContext* in my transformer and iterator retrieved using *range*
> method always provides entries ordered by key (Long) even if records were
> inserted randomly. In which cases this order may be violated?
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to