-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
10.0.0.Final
-
None
We should introduce a
flush(Publisher<MarshalledEntry<K, V>>)
method to the AdvancedCacheWriter interface. This will simply iterate over the cache on a best-effort basis (concurrent updates to the cache may be missed) and write it's contents to the underlying store(s).
The flush method should be called by the PersistenceManager when an appropriate trigger has been manually called by the user, for example JMX or REST.
Adding this capability will allow for use-cases where users don't want to write to the underlying store during normal operation, however in certain circumstances they want to persist the data. To achieve this, the user can configure a store as normal, whilst setting the SKIP_CACHE_LOAD and SKIP_CACHE_STORE flags via AdvancedCache::withFlags.
Alternatively, we could introduce a new attribute to store's which ensures that the store is always skipped except when flushing, e.g. "flush-only". This has the advantage of not requiring users to utilise flags and it will be possible to have multiple stores, some flush-only and other write-through/write-behind.
- is related to
-
ISPN-328 Async store to support frequency based flushing
- To Do