use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ClientNearCacheTestSupport method testNearCacheExpiration_withMaxIdle.
protected void testNearCacheExpiration_withMaxIdle(InMemoryFormat inMemoryFormat) {
NearCacheConfig nearCacheConfig = createNearCacheConfig(inMemoryFormat);
nearCacheConfig.setTimeToLiveSeconds(MAX_IDLE_SECONDS);
testNearCacheExpiration(nearCacheConfig, MAX_IDLE_SECONDS);
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class XmlClientConfigBuilderTest method testNearCacheConfig_withEvictionConfig_withPreloaderConfig.
@Test
public void testNearCacheConfig_withEvictionConfig_withPreloaderConfig() throws IOException {
URL schemaResource = XMLConfigBuilderTest.class.getClassLoader().getResource("hazelcast-client-test.xml");
ClientConfig clientConfig = new XmlClientConfigBuilder(schemaResource).build();
assertEquals("MyInstanceName", clientConfig.getInstanceName());
NearCacheConfig nearCacheConfig = clientConfig.getNearCacheConfig("nearCacheWithEvictionAndPreloader");
assertEquals(10000, nearCacheConfig.getTimeToLiveSeconds());
assertEquals(5000, nearCacheConfig.getMaxIdleSeconds());
assertFalse(nearCacheConfig.isInvalidateOnChange());
assertEquals(InMemoryFormat.OBJECT, nearCacheConfig.getInMemoryFormat());
assertTrue(nearCacheConfig.isCacheLocalEntries());
assertNotNull(nearCacheConfig.getEvictionConfig());
assertEquals(100, nearCacheConfig.getEvictionConfig().getSize());
assertEquals(EvictionConfig.MaxSizePolicy.ENTRY_COUNT, nearCacheConfig.getEvictionConfig().getMaximumSizePolicy());
assertEquals(EvictionPolicy.LFU, nearCacheConfig.getEvictionConfig().getEvictionPolicy());
assertNotNull(nearCacheConfig.getPreloaderConfig());
assertTrue(nearCacheConfig.getPreloaderConfig().isEnabled());
assertEquals("/tmp/myNearCache", nearCacheConfig.getPreloaderConfig().getDirectory());
assertEquals(2342, nearCacheConfig.getPreloaderConfig().getStoreInitialDelaySeconds());
assertEquals(4223, nearCacheConfig.getPreloaderConfig().getStoreIntervalSeconds());
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ClientMapNearCacheStalenessTest method getClientConfig.
protected ClientConfig getClientConfig(String mapName) {
NearCacheConfig nearCacheConfig = getNearCacheConfig(mapName);
ClientConfig clientConfig = new ClientConfig();
clientConfig.addNearCacheConfig(nearCacheConfig);
return clientConfig;
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ClientMapNearCacheStalenessTest method getNearCacheConfig.
private NearCacheConfig getNearCacheConfig(String mapName) {
NearCacheConfig nearCacheConfig = new NearCacheConfig(mapName);
nearCacheConfig.setInvalidateOnChange(true);
return nearCacheConfig;
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class ClientMapRecordStateStressTest method newNearCacheConfig.
protected NearCacheConfig newNearCacheConfig() {
NearCacheConfig nearCacheConfig = new NearCacheConfig();
nearCacheConfig.setName(mapName);
nearCacheConfig.setInvalidateOnChange(true);
return nearCacheConfig;
}
Aggregations