use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testWhenBothMapEvictionPolicyClassNameAndEvictionPolicySet.
@Test
public void testWhenBothMapEvictionPolicyClassNameAndEvictionPolicySet() {
MapConfig mapConfig = config.getMapConfig("mapBothMapEvictionPolicyClassNameAndEvictionPolicy");
String expectedComparatorClassName = "com.hazelcast.map.eviction.LRUEvictionPolicy";
assertEquals(expectedComparatorClassName, mapConfig.getMapEvictionPolicy().getClass().getName());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testFullQueryCacheConfig.
@Test
public void testFullQueryCacheConfig() {
MapConfig mapConfig = config.getMapConfig("map-with-query-cache");
QueryCacheConfig queryCacheConfig = mapConfig.getQueryCacheConfigs().get(0);
EntryListenerConfig entryListenerConfig = queryCacheConfig.getEntryListenerConfigs().get(0);
assertTrue(entryListenerConfig.isIncludeValue());
assertFalse(entryListenerConfig.isLocal());
assertEquals("com.hazelcast.spring.DummyEntryListener", entryListenerConfig.getClassName());
assertFalse(queryCacheConfig.isIncludeValue());
assertEquals("my-query-cache-1", queryCacheConfig.getName());
assertEquals(12, queryCacheConfig.getBatchSize());
assertEquals(33, queryCacheConfig.getBufferSize());
assertEquals(12, queryCacheConfig.getDelaySeconds());
assertEquals(InMemoryFormat.OBJECT, queryCacheConfig.getInMemoryFormat());
assertTrue(queryCacheConfig.isCoalesce());
assertFalse(queryCacheConfig.isPopulate());
assertIndexesEqual(queryCacheConfig);
assertEquals("__key > 12", queryCacheConfig.getPredicateConfig().getSql());
assertEquals(EvictionPolicy.LRU, queryCacheConfig.getEvictionConfig().getEvictionPolicy());
assertEquals(EvictionConfig.MaxSizePolicy.ENTRY_COUNT, queryCacheConfig.getEvictionConfig().getMaximumSizePolicy());
assertEquals(111, queryCacheConfig.getEvictionConfig().getSize());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testMapEvictionPolicyImpl.
@Test
public void testMapEvictionPolicyImpl() {
MapConfig mapConfig = config.getMapConfig("mapWithMapEvictionPolicyImpl");
assertEquals(DummyMapEvictionPolicy.class, mapConfig.getMapEvictionPolicy().getClass());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testMapEvictionPolicyClassName.
@Test
public void testMapEvictionPolicyClassName() {
MapConfig mapConfig = config.getMapConfig("mapWithMapEvictionPolicyClassName");
String expectedComparatorClassName = "com.hazelcast.map.eviction.LRUEvictionPolicy";
assertEquals(expectedComparatorClassName, mapConfig.getMapEvictionPolicy().getClass().getName());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class MapConfigRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) {
final JsonObject result = new JsonObject();
result.add("update", update);
if (update) {
final Set<Member> members = mcs.getHazelcastInstance().getCluster().getMembers();
for (Member member : members) {
mcs.callOnMember(member, new UpdateMapConfigOperation(mapName, config.getMapConfig()));
}
result.add("updateResult", "success");
} else {
MapConfig cfg = (MapConfig) mcs.callOnThis(new GetMapConfigOperation(mapName));
if (cfg != null) {
result.add("hasMapConfig", true);
result.add("mapConfig", new MapConfigDTO(cfg).toJson());
} else {
result.add("hasMapConfig", false);
}
}
root.add("result", result);
}
Aggregations