use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class NodeQueryCacheConfigurator method getOrNull.
@Override
public QueryCacheConfig getOrNull(String mapName, String cacheName) {
MapConfig mapConfig = config.getMapConfig(mapName);
List<QueryCacheConfig> queryCacheConfigs = mapConfig.getQueryCacheConfigs();
Iterator<QueryCacheConfig> iterator = queryCacheConfigs.iterator();
while (iterator.hasNext()) {
QueryCacheConfig config = iterator.next();
if (config.getName().equals(cacheName)) {
return config;
}
}
return null;
}
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);
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class ClientWriteBehindFlushTest method newMapStoredConfig.
protected Config newMapStoredConfig(MapStore store, int writeDelaySeconds) {
MapStoreConfig mapStoreConfig = new MapStoreConfig();
mapStoreConfig.setEnabled(true);
mapStoreConfig.setWriteDelaySeconds(writeDelaySeconds);
mapStoreConfig.setImplementation(store);
Config config = getConfig();
MapConfig mapConfig = config.getMapConfig(MAP_NAME);
mapConfig.setMapStoreConfig(mapStoreConfig);
return config;
}
Aggregations