use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class InMemoryFormatTest method equals.
@Test
public void equals() {
Config config = new Config();
config.addMapConfig(new MapConfig("objectMap").setInMemoryFormat(InMemoryFormat.OBJECT));
config.addMapConfig(new MapConfig("binaryMap").setInMemoryFormat(InMemoryFormat.BINARY));
HazelcastInstance hz = createHazelcastInstance(config);
Pair v1 = new Pair("a", "1");
Pair v2 = new Pair("a", "2");
IMap<String, Pair> objectMap = hz.getMap("objectMap");
IMap<String, Pair> binaryMap = hz.getMap("binaryMap");
objectMap.put("1", v1);
binaryMap.put("1", v1);
assertTrue(objectMap.containsValue(v1));
assertTrue(objectMap.containsValue(v2));
assertTrue(binaryMap.containsValue(v1));
assertFalse(binaryMap.containsValue(v2));
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class EntryProcessorTest method setupImapForEntryProcessorWithIndex.
private IMap<Long, MyData> setupImapForEntryProcessorWithIndex() {
Config config = getConfig();
MapConfig testMapConfig = config.getMapConfig(MAP_NAME);
testMapConfig.setInMemoryFormat(inMemoryFormat);
testMapConfig.getMapIndexConfigs().add(new MapIndexConfig("lastValue", true));
HazelcastInstance instance = createHazelcastInstance(config);
return instance.getMap(MAP_NAME);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class DynamicMapConfigTest method createMapConfig.
private MapConfig createMapConfig() {
MapConfig mapConfig = new MapConfig();
mapConfig.setTimeToLiveSeconds(100);
mapConfig.setMaxIdleSeconds(22);
mapConfig.setEvictionPolicy(EvictionPolicy.LRU);
mapConfig.setEvictionPercentage(35);
mapConfig.setMinEvictionCheckMillis(199);
mapConfig.setReadBackupData(false);
mapConfig.setBackupCount(3);
mapConfig.setAsyncBackupCount(2);
mapConfig.setMaxSizeConfig(new MaxSizeConfig(111, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_SIZE));
return mapConfig;
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class DynamicMapConfigTest method updateMapConfig.
private void updateMapConfig(String mapName, HazelcastInstance node) throws InterruptedException, ExecutionException {
MapConfig mapConfig = createMapConfig();
Operation updateMapConfigOperation = new UpdateMapConfigOperation(mapName, mapConfig);
executeOperation(node, updateMapConfigOperation);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class EvictionTest method newConfigWithTTL.
private Config newConfigWithTTL(String mapName, int ttlSeconds) {
Config config = getConfig();
MapConfig mapConfig = config.getMapConfig(mapName + "*");
mapConfig.setTimeToLiveSeconds(ttlSeconds);
config.addMapConfig(mapConfig);
return config;
}
Aggregations