use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method not_supports_near_cache_localUpdatePolicy_CACHE_ON_UPDATE.
@Test(expected = IllegalArgumentException.class)
public void not_supports_near_cache_localUpdatePolicy_CACHE_ON_UPDATE() {
NearCacheConfig nearCacheConfig = new NearCacheConfig();
nearCacheConfig.setLocalUpdatePolicy(CACHE_ON_UPDATE);
checkNearCacheConfig(MAP_NAME, nearCacheConfig, false);
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method test_checkNearCacheConfig_withPreLoaderConfig_onClients.
@Test
public void test_checkNearCacheConfig_withPreLoaderConfig_onClients() {
NearCacheConfig nearCacheConfig = getNearCacheConfig(BINARY).setCacheLocalEntries(false);
nearCacheConfig.getPreloaderConfig().setEnabled(true).setStoreInitialDelaySeconds(1).setStoreInitialDelaySeconds(1);
checkNearCacheConfig(MAP_NAME, nearCacheConfig, true);
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method test_checkNearCacheConfig_withPreloader_onMembers.
@Test(expected = IllegalArgumentException.class)
public void test_checkNearCacheConfig_withPreloader_onMembers() {
NearCacheConfig nearCacheConfig = getNearCacheConfig(BINARY);
nearCacheConfig.getPreloaderConfig().setEnabled(true).setStoreInitialDelaySeconds(1).setStoreInitialDelaySeconds(1);
checkNearCacheConfig(MAP_NAME, nearCacheConfig, false);
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class GetAllTest method ensure_supplied_number_of_keys_are_in_near_cache.
@Test
public void ensure_supplied_number_of_keys_are_in_near_cache() throws Exception {
final int entryCount = 100000;
final String mapName = "test";
NearCacheConfig nearCacheConfig = new NearCacheConfig();
nearCacheConfig.setCacheLocalEntries(true);
nearCacheConfig.setInvalidateOnChange(true);
Config config = new Config();
config.getMapConfig(mapName).setNearCacheConfig(nearCacheConfig);
HazelcastInstance node = createHazelcastInstance(config);
IMap map = node.getMap(mapName);
for (int i = 0; i < entryCount; i++) {
map.put(i, i);
}
HashSet keys = new HashSet();
for (int i = 0; i < entryCount; i++) {
keys.add(i);
}
map.getAll(keys);
assertEquals(entryCount, ((NearCachedMapProxyImpl) map).getNearCache().size());
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class LiteMemberMapNearCacheBasicTest method createConfig.
protected Config createConfig(NearCacheConfig nearCacheConfig, boolean liteMember) {
Config config = getConfig().setLiteMember(liteMember);
config.getMapConfig(DEFAULT_NEAR_CACHE_NAME).setNearCacheConfig(nearCacheConfig);
return config;
}
Aggregations