lru-rs icon indicating copy to clipboard operation
lru-rs copied to clipboard

Exporting keys

Open rohitjoshi opened this issue 6 years ago • 3 comments

It would be good to have the ability to export keys so the cache can be warmup at startup. I am using iter to get all the keys from LRU but requires an extended period of mutex lock which would impact clients.

Is there any way to export keys with minimal locking duration?

rohitjoshi avatar Apr 18 '19 19:04 rohitjoshi

Interesting, it sounds like you could use some form of MVCC so that you could get an iterator over the keys at a certain point in time and continue to operate on the cache afterwards?

jeromefroe avatar Apr 21 '19 14:04 jeromefroe

How do we achieve this?

rohitjoshi avatar Nov 19 '20 03:11 rohitjoshi

Hi @rohitjoshi! I can't think of a better way currently than to get an iter to iterate over all the keys. To be able to get an iter at a particular snapshot which would allow future operations to continue uninterrupted would be an awesome feature, but would require a significant reworking of the internals of the cache.

jeromefroe avatar Nov 19 '20 14:11 jeromefroe