2

I am storing entries in IgniteCache, and After each time interval (lets say 1 Hr), entries stored in that Hour should get Evicted and Stored to Hbase. How can I achieve this?

I tried as follows.

setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(Duration.ONE_HOUR));

But this evicts entries one by one, after 1 Hour when particular entry was inserted, I want Bulk eviction and those evicted entries will be stored in HBASE.

Sibeesh Venu
  • 18,755
  • 12
  • 103
  • 140
iamLalit
  • 448
  • 3
  • 20

1 Answers1

0

It sounds like you're going to evict everything that you have in cache, right? If so, I would just use write-through to make sure that all the cache updates are propagated to HBASE, and then simply destroy and recreate the cache from scratch every hour.

Ram Ghadiyaram
  • 28,239
  • 13
  • 95
  • 121
Valentin Kulichenko
  • 8,365
  • 1
  • 16
  • 12
  • Yes I am going to delete every thing from cache, I did use the write-though but it affect one entry that I am inserting, ie the entry inserting in Cache (I am storing entyries in form of JSONObject). I want one complete Eviction of Cache, and all those collective Entries will be evicted on a Listener. In short, I am making Ignite a buffer for entries which are to be inserted in HBASE for 1 hour. – iamLalit Dec 26 '16 at 12:57
  • This will require iteration through all entries in the cache. And (depending on required guarantees) probably lock-the-world semantics during this eviction process. The solution I proposed do not require this - data is written to HBase while you update the cache, and in-memory data is cleared immediately since you can destroy the whole cache (this operation does not require iteration). – Valentin Kulichenko Dec 26 '16 at 18:37
  • Hello, What happen to evicted data, can I get that evicted data on Any Listener or Method or such – iamLalit Dec 28 '16 at 10:11