0

How do we use CachedMap in Trident. My use case is such that, I will be doing some database and want to store that information in cache or trident state. Next time when I get any tuple, I want to query the trident state or cache before querying database. I don't get required data in trident state/cache, I will be querying the database and updating the trident state/cache. Please let me know how do we achieve this or if there any link to help me out with this scenario.

Matthias J. Sax
  • 59,682
  • 7
  • 117
  • 137
Alok
  • 1,374
  • 3
  • 18
  • 44

1 Answers1

0

CachedMap wraps your IBackingMap and also implements IBackingMap. It calls your store when it doesn't have a cached value.

new CachedMap(myIBackingMap, cacheSize)

See example usage in trident-memcached

Joshua Martell
  • 7,074
  • 2
  • 30
  • 37