Hi all. Thanks for your replies. Enabling statistics fixed it.
On Tue, Dec 20, 2016 at 12:39 PM, Andrey Mashenkov <[email protected]> wrote: > Hi Alper, > > May be it is not obvious, but to enable offheap you need to > setOffheapMaxMemory to zero (unlimited) or above zero. > Also metrics is disabled by default, you need call > setStatisticsEnabled(true); > > On Tue, Dec 20, 2016 at 11:41 AM, Alper Tekinalp <[email protected]> wrote: > >> Hi all. >> >> I have the following code: >> IgniteConfiguration igniteConfiguration = new >> IgniteConfiguration(); >> igniteConfiguration.setGridName("alper"); >> Ignite start = Ignition.start(igniteConfiguration); >> >> CacheConfiguration configuration = new CacheConfiguration(); >> configuration.setAtomicityMode(CacheAtomicityMode.ATOMIC) >> .setCacheMode(CacheMode.PARTITIONED) >> .setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED) >> .setRebalanceMode(CacheRebalanceMode.SYNC) >> .setWriteSynchronizationMode(C >> acheWriteSynchronizationMode.FULL_SYNC) >> .setRebalanceThrottle(100) >> .setRebalanceBatchSize(2*1024*1024) >> .setBackups(1) >> .setName("cemil") >> .setEagerTtl(false); >> start.getOrCreateCache(configuration); >> >> IgniteCache<Object, Object> cemil = start.getOrCreateCache("cemil" >> ); >> >> cemil.put("1", "10"); >> cemil.put("2", "10"); >> cemil.put("3", "10"); >> cemil.put("4", "10"); >> >> System.out.println(cemil.metrics().getOffHeapAllocatedSize()); >> System.out.println(cemil.metrics().getOffHeapBackupEntriesCo >> unt()); >> System.out.println(cemil.metrics().getOffHeapGets()); >> System.out.println(cemil.metrics().getOffHeapHits()); >> System.out.println(cemil.metrics().getOffHeapMisses()); >> System.out.println(cemil.metrics().getOffHeapPuts()); >> System.out.println(cemil.metrics().getOffHeapEvictions()); >> System.out.println(cemil.metrics().getOffHeapHitPercentage()); >> >> All prints 0. Is that normal? Am i doing something wrong? >> >> -- >> Alper Tekinalp >> >> Software Developer >> Evam Streaming Analytics >> >> Atatürk Mah. Turgut Özal Bulv. >> Gardenya 5 Plaza K:6 Ataşehir >> 34758 İSTANBUL >> >> Tel: +90 216 455 01 53 Fax: +90 216 455 01 54 >> www.evam.com.tr >> <http://www.evam.com> >> > > -- Alper Tekinalp Software Developer Evam Streaming Analytics Atatürk Mah. Turgut Özal Bulv. Gardenya 5 Plaza K:6 Ataşehir 34758 İSTANBUL Tel: +90 216 455 01 53 Fax: +90 216 455 01 54 www.evam.com.tr <http://www.evam.com>
