Hi there,
I'm trying to get some IMaps to be used as near cache, but they don't seem to be storin the data in the near cache and they are distributing the data between the different nodes.
The IMaps are configured like this:
Config cfg = XmlConfigBuilder().build();
-------
MapConfig mapConfig = cfg.getMapConfig(cacheName);
if (mapConfig == null) {
mapConfig = new MapConfig(cacheName);
cfg.addMapConfig(mapConfig);
}
NearCacheConfig nearCacheConfig = mapConfig.getNearCacheConfig();
if (nearCacheConfig == null) {
nearCacheConfig = new NearCacheConfig();
mapConfig.setNearCacheConfig(nearCacheConfig);
}
nearCacheConfig.setName(cacheName);
nearCacheConfig.setCacheLocalEntries(true);
...
I then load some data in the maps and I check their stats:
imap.getLocalMapStats().getOwnedEntryCount() -> returns 100, for example
imap.getLocalMapStats().getNearCacheStats().getOwnedEntryCount() -> always return 0
if I start another node with the same configuration and check the stats again and I get on each node:
imap.getLocalMapStats().getOwnedEntryCount() -> returns 50, aprox.
imap.getLocalMapStats().getNearCacheStats().getOwnedEntryCount() -> always return 0
------
If I don't configure the maps as near cache, I can see that imap.getLocalMapStats().getNearCacheStats() returns null, so something is happening, but items are not stored in the near cache.
Is there anything else that needs to be done so the data are stored in the near cache?
Cheers!
D.
PD: Hazelcast version: 3.4.2.