use of com.hazelcast.config.MapConfig in project cas by apereo.
the class HazelcastTicketRegistryConfiguration method buildHazelcastMapConfigurations.
private Map<String, MapConfig> buildHazelcastMapConfigurations(final TicketCatalog ticketCatalog) {
final Map<String, MapConfig> mapConfigs = new HashMap<>();
final Collection<TicketDefinition> definitions = ticketCatalog.findAll();
definitions.forEach(t -> {
final MapConfig mapConfig = createMapConfig(t);
LOGGER.debug("Created Hazelcast map configuration for [{}]", t);
mapConfigs.put(t.getProperties().getStorageName(), mapConfig);
});
return mapConfigs;
}
use of com.hazelcast.config.MapConfig in project cas by apereo.
the class ProvidedHazelcastInstanceConfigurationTests method hazelcastInstanceIsCreatedNormally.
@Test
public void hazelcastInstanceIsCreatedNormally() throws Exception {
assertNotNull(this.hzInstance);
final Config config = this.hzInstance.getConfig();
assertTrue(config.getNetworkConfig().getJoin().getMulticastConfig().isEnabled());
assertEquals(Arrays.asList("127.0.0.1"), config.getNetworkConfig().getJoin().getTcpIpConfig().getMembers());
assertFalse(config.getNetworkConfig().isPortAutoIncrement());
assertEquals(5801, config.getNetworkConfig().getPort());
final MapConfig mapConfig = config.getMapConfig("tickets-from-external-config");
assertNotNull(mapConfig);
assertEquals(20000, mapConfig.getMaxIdleSeconds());
assertEquals(EvictionPolicy.LFU, mapConfig.getEvictionPolicy());
assertEquals(99, mapConfig.getEvictionPercentage());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class ClientAggregatorsSpecTest method getMapWithNodeCount.
@Override
protected <K, V> IMap<K, V> getMapWithNodeCount(int nodeCount, boolean parallelAccumulation) {
if (nodeCount < 1) {
throw new IllegalArgumentException("node count < 1");
}
MapConfig mapConfig = new MapConfig().setName("aggr").setInMemoryFormat(inMemoryFormat);
Config config = new Config().setProperty(PARTITION_COUNT.getName(), String.valueOf(nodeCount)).setProperty(AGGREGATION_ACCUMULATION_PARALLEL_EVALUATION.getName(), String.valueOf(parallelAccumulation)).addMapConfig(mapConfig);
factory = new TestHazelcastFactory();
for (int i = 0; i < nodeCount; i++) {
factory.newHazelcastInstance(config);
}
HazelcastInstance instance = factory.newHazelcastClient();
return instance.getMap("aggr");
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class ClientMapAggregateTest method getMapWithNodeCount.
public <K, V> IMap<K, V> getMapWithNodeCount(int nodeCount) {
if (nodeCount < 1) {
throw new IllegalArgumentException("node count < 1");
}
factory = new TestHazelcastFactory();
Config config = new Config();
config.setProperty("hazelcast.partition.count", "3");
MapConfig mapConfig = new MapConfig();
mapConfig.setName("aggr");
mapConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
config.addMapConfig(mapConfig);
factory.newInstances(config, nodeCount);
client = factory.newHazelcastClient();
return client.getMap("aggr");
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class ClientMapUnboundReturnValuesTestSupport method getMapWithNodeCount.
private <K, V> IMap<K, V> getMapWithNodeCount(int nodeCount, Config config) {
String mapName = UUID.randomUUID().toString();
MapConfig mapConfig = new MapConfig();
mapConfig.setName(mapName);
mapConfig.setAsyncBackupCount(0);
mapConfig.setBackupCount(0);
config.addMapConfig(mapConfig);
while (nodeCount > 1) {
hazelcastFactory.newHazelcastInstance(config);
nodeCount--;
}
HazelcastInstance node = hazelcastFactory.newHazelcastInstance(config);
return node.getMap(mapName);
}
Aggregations