Hi,
Please see my answers inline
On 1/13/2016 10:44 AM, Ambha wrote:
I have a few doubts on off heap cache configuration
1. Is it possible to set both off-heap and cache store with write behind
mode for a cache?
The configuration looks like:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="TestData" />
<property name="memoryMode" value="ONHEAP_TIERED" />
<property name="offHeapMaxMemory" value="#{5 * 1024L * 1024L * 1024L}" />
<property name="writeBehindEnabled" value="true" />
<property name="writeBehindFlushSize" value="200" />
<property name="writeBehindFlushFrequency" value="1000000"/>
<property name="evictionPolicy">
<bean
class="org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy">
<property name="maxSize" value="100000"/>
</bean>
</property>
<property name="cacheStoreFactory">
<bean class="javax.cache.configuration.FactoryBuilder$SingletonFactory">
<constructor-arg> <bean
class="com.wipro.base.cache.MySqlPersistenceStore"></bean>
</constructor-arg>
</bean>
</property>
Yes, it's possible to use off-heap space for a cache and sync data to a
storage in either write-through or write-behind mode.
Actually, cache store is not bound to any cache memory mode (on-heap,
off-heap, swap) where cache data can reside.
Please refer to [1] to get more details.
2. from which place (onheap or offheap or both) the cached objects are
written to cache store (MySQL above) if write behind is enabled?
If write-behind is enabled cache objects that must be synced to a
storage are queued up in the write-behind store implementation and
flushed up later.
There is no difference whether the objects are actually stored - in
on-heap or off-heap.
You can find more details on write-behind store here [2].
3. What will happen to a new item to be placed in cache when the size (both
onheap and offheap) has already exceeded the limit?
You will face with out of memory situation unless you configured an
eviction policy that moves data to swap. [3]
[1] https://apacheignite.readme.io/docs/off-heap-memory
[2]
https://apacheignite.readme.io/docs/persistent-store#write-behind-caching
[3] https://apacheignite.readme.io/docs/evictions
Regards,
Denis
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Setting-both-offHeapMaxMemory-and-cacheStoreFactory-tp2527.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.