Hello:

I run the server from 2.8.0 bin package with default-config.xml.
Here is my java client code:

    Ignition.setClientMode(true);
    final CacheConfiguration cfg = new CacheConfiguration("lru-cache");
    cfg.setOnheapCacheEnabled(true);
    final LruEvictionPolicyFactory<String, String> plc = new
LruEvictionPolicyFactory<String, String>(20,20,20);
    cfg.setEvictionPolicyFactory(plc);
    final Ignite ignite = Ignition.start();
    cache = ignite.getOrCreateCache(cfg);

    for(int i = 0; i < 10; i++) {
      final String key = Integer.toString(i);
      cache.put(key, key);
    }

the output of cache.size(CachePeekMode.ONHEAP) is 1. and
cache.size(CachePeekMode.OFFHEAP) shows 10.

the output of cache.getEntry("0").getValue() will give "0", which I thought
it should be null, since I set LRU eviction.

In my user case, I want to use ignite as a pure in-memory cache. To enable
the LRU eviction, should I turn off the off-heap and could you please share
how to do it?

And since there is one item on the heap, may I know if there is a way to get
the cached item on the heap?

Moreover, I want to know if there is a way to set the max number of items
instead of the sizes in bytes.


Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to