1

How do we empty the cache every n seconds (so that we can run queries on the data that has come in for the n second window - batch window querying)? I could only find FIFO and LRU based eviction policies in the ignite code where the eviction policy is based on the cache entry getting added or modified.

I understand we can have a sliding window using CreatedExpiryPolicy

cfg.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new CreatedExpiryPolicy(new Duration(SECONDS, 5))));

But I don't think this will help me maintain batch windows. Neither will FIFO or LruEvictionPolicy.

I need some eviction policy which is based on some static time window (every 5 seconds for example). Will I have to write my own implementation?

James Isaac
  • 2,587
  • 6
  • 20
  • 30

1 Answers1

2

Well, it's possible to change ExpiryPolicy for each added entry with

IgniteCache.withExpiryPolicy

and calculate remaining time every time, but it will be too big overhead - each entry will have their own EvictionPolicy.

I would recommend to schedule job that will clear the cache using cron based scheduling:

Evgenii Zhuravlev
  • 2,987
  • 1
  • 9
  • 15