Search in sources :

Example 61 with MapConfig

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);
}
Also used : Config(com.hazelcast.config.Config) MapConfig(com.hazelcast.config.MapConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) MapConfig(com.hazelcast.config.MapConfig)

Example 62 with MapConfig

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);
}
Also used : MapIndexConfig(com.hazelcast.config.MapIndexConfig) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) MapIndexConfig(com.hazelcast.config.MapIndexConfig) MapConfig(com.hazelcast.config.MapConfig)

Example 63 with MapConfig

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;
}
Also used : MapConfig(com.hazelcast.config.MapConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) Config(com.hazelcast.config.Config) MapIndexConfig(com.hazelcast.config.MapIndexConfig) MapConfig(com.hazelcast.config.MapConfig)

Example 64 with MapConfig

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);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MaxSizeConfig(com.hazelcast.config.MaxSizeConfig) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 65 with MapConfig

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;
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) MapConfig(com.hazelcast.config.MapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) Config(com.hazelcast.config.Config) MapConfig(com.hazelcast.config.MapConfig)

Aggregations

MapConfig (com.hazelcast.config.MapConfig)182 Config (com.hazelcast.config.Config)125 HazelcastInstance (com.hazelcast.core.HazelcastInstance)78 Test (org.junit.Test)75 QuickTest (com.hazelcast.test.annotation.QuickTest)68 ParallelTest (com.hazelcast.test.annotation.ParallelTest)62 MapStoreConfig (com.hazelcast.config.MapStoreConfig)43 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)41 MaxSizeConfig (com.hazelcast.config.MaxSizeConfig)28 NearCacheConfig (com.hazelcast.config.NearCacheConfig)27 MapIndexConfig (com.hazelcast.config.MapIndexConfig)20 QuorumConfig (com.hazelcast.config.QuorumConfig)19 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)18 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)16 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)14 NightlyTest (com.hazelcast.test.annotation.NightlyTest)12 PartitionedCluster (com.hazelcast.quorum.PartitionedCluster)10 CountDownLatch (java.util.concurrent.CountDownLatch)10 BeforeClass (org.junit.BeforeClass)10 AssertTask (com.hazelcast.test.AssertTask)9