0

I have an use-case where a guava RangeMap needs to pre-built and loaded into redis. At some point in the future, it would be retrieved from redis and used again.

This is done to reduce the time in building the rangeMap itself.

Any suggestions or recommendations? Can the RangeMap be serialized and stored into redis? is this the best way?

Also, what is the average lookup time for a range map for a single data-point?

mlog(n)? m-> number of ranges, n -> avg. size of the range

  • 1
    The lookup time for a RangeMap for a single data point is O(log m). – Louis Wasserman May 06 '20 at 15:32
  • @LouisWasserman, thanks for your insight. Do you also have any insights into the other question I had regarding cache pre-build + serialization/deserialization with storage in redis vs building the cache on demand? The operation is time-sensitive as it runs on streaming flink pipelines and I have an option to pre-build the cache ansync and store it into redis. In general, is there any documentation on the performance aspects of rangemap? I used .stats() for guavacache, is there something similar for rangemap? – Ullas Kashyap May 07 '20 at 03:57
  • 1
    `RangeMap` is intended to resemble `Map` more than a cache, and offers no more stats than `Map` does. You could serialize it yourself from the `asMapOfRanges().entrySet()` view. – Louis Wasserman May 07 '20 at 16:37
  • Thanks for your input @LouisWasserman – Ullas Kashyap May 07 '20 at 18:55

0 Answers0