use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class EntryListenerConfigTest method createInstanceAndInitializeListeners.
private void createInstanceAndInitializeListeners() {
MapConfig mapConfig = new MapConfig(mapName);
mapConfig.getEntryListenerConfigs().add(listenerConfig);
Config config = new Config().addMapConfig(mapConfig);
instance = createHazelcastInstance(config);
instance.getMap(mapName);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class EntryProcessorBouncingNodesTest method newInstance.
private HazelcastInstance newInstance(boolean withIndex) {
Config config = getConfig();
MapConfig mapConfig = config.getMapConfig(MAP_NAME);
mapConfig.setBackupCount(2);
if (withIndex) {
mapConfig.addMapIndexConfig(new MapIndexConfig("__key", true));
}
return instanceFactory.newHazelcastInstance(config);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class EntryProcessorTest method getConfig.
@Override
public Config getConfig() {
Config config = super.getConfig();
MapConfig mapConfig = new MapConfig(MAP_NAME);
mapConfig.setInMemoryFormat(inMemoryFormat);
config.addMapConfig(mapConfig);
return config;
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class DynamicMapConfigTest method testMapConfigUpdate_reflectedToRecordStore.
@Test
public void testMapConfigUpdate_reflectedToRecordStore() throws ExecutionException, InterruptedException {
String mapName = randomMapName();
Config config = getConfig();
config.setProperty(GroupProperty.PARTITION_COUNT.getName(), "1");
HazelcastInstance node = createHazelcastInstance(config);
IMap<Integer, Integer> map = node.getMap(mapName);
// trigger recordStore creation.
map.put(1, 1);
boolean beforeUpdate = isRecordStoreExpirable(map) && isEvictionEnabled(map);
updateMapConfig(mapName, node);
boolean afterUpdate = isRecordStoreExpirable(map) && isEvictionEnabled(map);
assertFalse("Before MapConfig update, RecordStore should not be expirable and evictable", beforeUpdate);
assertTrue("RecordStore should be expirable and evictable after MapConfig update", afterUpdate);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class PartitioningStrategyFactoryTest method getConfig.
@Override
protected Config getConfig() {
Config config = new Config();
MapConfig mapConfig = new MapConfig(mapName);
PartitioningStrategyConfig partitioningStrategyConfig = new PartitioningStrategyConfig();
partitioningStrategyConfig.setPartitioningStrategyClass("com.hazelcast.partition.strategy.StringPartitioningStrategy");
mapConfig.setPartitioningStrategyConfig(partitioningStrategyConfig);
config.addMapConfig(mapConfig);
return config;
}
Aggregations