Alexey, The runtime class is used so I can have a common method to create any cache type and index the key and value types of the cache.
To simplify things, attached is a tar file that is a small program that throws an OOM exception for me. I get the OOM when loading from the cache store on misses. I would expect it to just evict memory pages when it inserts a new value, and not care if the insert is because of a put or a read from cache. If you comment out line 79 in the IgniteConfigGenerator class then it does not get the OOM. This is a simple test program, in my production code the value in the cache will be an object, and I am calling setIndexedTypes to create a table for that value so I can use sql query calls. Can you let me know if you get the same results, and if so why we get the OOM? Thanks, Larry On Fri, Jan 12, 2018 at 6:53 AM, Alexey Popov <tank2.a...@gmail.com> wrote: > Hi, > > You are right, "evicts=0" is related to cache evictions for on-heap caching > [1]. It should be always 0 for you. > > I tried your case (with the same configs as you) and page evictions work > fine with cache store enabled and indexed types. It seems that you have > some > misconfiguration. > > What are you trying to achieve by adding > .setIndexedTypes(keytag.runtimeClass, valtag.runtimeClass) to String-value > cache? and what is keytag.runtimeClass and valtag.runtimeClass? > > Could you please try with DummyClass with valid indexes enabled as below: > > /** > * DummyClass > */ > public class DummyClass { > /** Dummy string. */ > public String dummyStr; > > /** Dummy int. */ > @QuerySqlField(index = true) > public Integer dummyInt; > > public DummyClass(Integer dummyInt) { > this.dummyInt = dummyInt; > this.dummyStr = StringUtils.rightPad(dummyInt.toString(), 1024, > '*'); > } > } > > CacheConfiguration<Integer, DummyClass> cacheCfg = new > CacheConfiguration<Integer, DummyClass>(CACHE_NAME) > .setCacheMode(CacheMode.PARTITIONED) > .setAtomicityMode(CacheAtomicityMode.ATOMIC) > > .setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(Duration.ETERNAL)) > .setDataRegionName(REG_NAME) > .setStatisticsEnabled(true) > > .setCacheStoreFactory(FactoryBuilder.factoryOf( > DummyStoreFromAdapter.class)) > .setReadThrough(true) > .setIndexedTypes(Integer.class, DummyClass.class); > > Thanks, > Alexey > > [1] https://apacheignite.readme.io/docs/evictions#section-java-heap-cache > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
fail.tar
Description: Unix tar archive