I v use LruEvictionPolicyFactory in my CacheConfiguration such as fire
CacheConfiguration<K, V> cacheCfg = new CacheConfiguration<>();
cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC);
cacheCfg.setPartitionLossPolicy(PartitionLossPolicy.READ_WRITE_SAFE);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
cacheCfg.setEvictionPolicyFactory(new LruEvictionPolicyFactory<>(200000));
我使用数据
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="initialSize" value="#{512L * 1024 * 1024}"/>
<property name="maxSize" value="#{3 * 1024L * 1024 * 1024}"/>
<property name="pageEvictionMode" value="RANDOM_LRU"/>
<property name="evictionThreshold" value="0.9"/>
<property name="metricsEnabled" value="true"/>
<property name="persistenceEnabled" value="false"/>
</bean>
但是,我可以看到,我藏匿的2000 000多份记录,有时甚至有800 000份记录。
• 如何控制我海滩的数据规模,避免使用太多的记忆