I'm not sure about the LevelDB implementation as it is a third-party. But as it is file based it will append new entries at the end.
The SingleFileStore implementation re-use the space within the file if possible if the entry size is not larger than the old entry.
The only possiblility I'm aware of is to purge on startup if the cluster is running and it will be restored from the cluster.
Infinispan can purge only those entries which are expired (based on the lifespan or idle time). How LevelDB stores the entries internally is out of the range for Infinispan, and org.iq80.leveldb.DB does not have any API to enforce this - there are only methods for suspending and resuming the compaction (which should run in background), and LevelDBStore does not use them.
The period of purging expired entries is controlled by <expiration interval="..." />. You could trigger that manually by calling cache.getAdvancedCache().getComponentRegistry().getLocalComponent(PersistenceManager.class).purgeExpired(), though you're touching internals a bit this way.
I am thinking to use HBase as cache store but can not find enough documentation ,Can anyone share example of using HBase as cache store with Infinispan?
I am able to use HBase as a cache store for infinispan but facing an issue
when entry gets expired Infinispan moves them to expire table but is not deleting them from entry table as a result i have entries both in entry as well as expired tables
even after calling cacheStrore.purgeExpired(); //entries are not getting deleted from entry table
Any pointer will be of a great help
HBase cache store is not very actively updated. Contributions and fixes are welcomed.