Hi,

Can you please properly subscribe to the mailing list so that the community
can receive email notifications? Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1


suhuadong wrote
> hi team,
> Version of igntie is 1.5.0.final.
> 
> ClientMode of Ignite is true.
> 
> I'm trying to run near cache example codes,but I'm having a strange
> Exception.
> 
>                    
> example code:
>             // Create distributed cache on the server nodes, called
> "myCache".
>             ignite.getOrCreateCache(new CacheConfiguration<String,
> String>("myCache"));
> 
>             // Create near-cache configuration for "myCache".
>             NearCacheConfiguration<String, String> nearCfg = new
> NearCacheConfiguration<>();
> 
>             // Use LRU eviction policy to automatically evict entries
>             // from near-cache, whenever it reaches 100_000 in size.
>             nearCfg.setNearEvictionPolicy(new
> LruEvictionPolicy<>(100_000));
> 
>             // Create near-cache for "myCache".
>             IgniteCache&lt;String, String&gt; cache =
> ignite.getOrCreateNearCache("myCache", nearCfg);
> 
>             https://apacheignite.readme.io/docs/near-caches

This happens because getOrCreateCache also creates a client handler without
the near cache. After that it's impossible to dynamically add near cache.

In your code you should simply remove the first line. getOrCreateNearCache
method will automatically start the distributed server cache and then create
a local near cache.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-near-cache-Problem-tp4657p4677.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to