Hi there,
I’ve got a MapState where I need to iterate over the entries. This currently isn’t supported (at least for Rocks DB), AFAIK, though there is an issue/PR to improve this. The best solution I’ve seen is what Fabian proposed, which involves keeping a ValueState with a count of entries, and then having the key for the MapState be the index. I cannot comment on the internal design, but you could put the data into a This effectively lets you iterate over all of the map entries for a given (keyed) state - though it doesn’t solve the “I have to iterate over _every_ entry” situation. Is this currently the best option? Thanks, — Ken
|
Hi Ken, I'd like to clarify what I said before.By using MapState mainly gain two things: However, iterating over the list should be done by iterating over the entry (or value) set. The entry set iterator will prefetch multiple entries and only deserialize the key / values when you access them. This reduces the number of RocksDB look-ups. Best, Fabian 2018-02-19 0:10 GMT+01:00 Ken Krugler <[hidden email]>:
|
In reply to this post by Ken Krugler
Hi Ken, just for my clarification, the `RocksDBMapState#entries` method does not satisfy your requirements? This method does not allow you to iterate across different keys of your keyed stream of course. But it should allow you to iterate over the different entries for a given key of your keyed stream. Cheers, Till On Mon, Feb 19, 2018 at 12:10 AM, Ken Krugler <[hidden email]> wrote:
|
In reply to this post by Fabian Hueske-2
Hi Fabian,
I’m assuming I can’t hold onto the iterator across calls to a function, right? If so, then making get(index) calls via the technique described below is currently the most efficient approach, yes? Thanks, — Ken
|
In reply to this post by Till Rohrmann
Hi Till,
I need to do incremental iteration of the entries, versus a complete iteration. And I'm assuming I can't keep the iterator around across calls to the function. Regards, — Ken
-------------------------- Ken Krugler custom big data solutions & training Hadoop, Cascading, Cassandra & Solr |
Hi Ken, That's correct. The iterator will become invalid once you leave the method.2018-02-20 1:03 GMT+01:00 Ken Krugler <[hidden email]>:
|
Free forum by Nabble | Edit this page |