use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class CacheEventJournalBounceTest method getConfig.
@Override
protected Config getConfig() {
final CacheSimpleConfig cacheConfig = new CacheSimpleConfig().setName(TEST_CACHE_NAME);
cacheConfig.getEvictionConfig().setSize(Integer.MAX_VALUE);
Config config = super.getConfig().addCacheConfig(cacheConfig);
config.getCacheConfig(TEST_CACHE_NAME).setEventJournalConfig(new EventJournalConfig().setEnabled(true).setCapacity(10000));
return config;
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class CacheEventJournalBasicTest method getConfig.
@Override
protected Config getConfig() {
Config config = super.getConfig();
CacheSimpleConfig nonEvictingCache = config.getCacheConfig(NON_EVICTING_CACHE).setInMemoryFormat(getInMemoryFormat());
MaxSizePolicy maxSizePolicy = getInMemoryFormat() == InMemoryFormat.NATIVE ? USED_NATIVE_MEMORY_SIZE : DEFAULT_MAX_SIZE_POLICY;
nonEvictingCache.getEvictionConfig().setMaxSizePolicy(maxSizePolicy).setSize(Integer.MAX_VALUE);
final CacheSimpleConfig evictingCache = config.getCacheConfig(EVICTING_CACHE).setInMemoryFormat(getInMemoryFormat());
evictingCache.getEvictionConfig().setMaxSizePolicy(maxSizePolicy);
return config;
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AddCacheConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
CacheSimpleConfig config = new CacheSimpleConfig();
config.setAsyncBackupCount(parameters.asyncBackupCount);
config.setBackupCount(parameters.backupCount);
config.setCacheEntryListeners(parameters.cacheEntryListeners);
config.setCacheLoader(parameters.cacheLoader);
config.setCacheLoaderFactory(parameters.cacheLoaderFactory);
config.setCacheWriter(parameters.cacheWriter);
config.setCacheWriterFactory(parameters.cacheWriterFactory);
config.setDisablePerEntryInvalidationEvents(parameters.disablePerEntryInvalidationEvents);
config.setEvictionConfig(parameters.evictionConfig.asEvictionConfig(serializationService));
if (parameters.expiryPolicyFactoryClassName != null) {
config.setExpiryPolicyFactory(parameters.expiryPolicyFactoryClassName);
} else if (parameters.timedExpiryPolicyFactoryConfig != null) {
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = new ExpiryPolicyFactoryConfig(parameters.timedExpiryPolicyFactoryConfig);
config.setExpiryPolicyFactoryConfig(expiryPolicyFactoryConfig);
}
config.setEventJournalConfig(parameters.eventJournalConfig);
config.setHotRestartConfig(parameters.hotRestartConfig);
config.setInMemoryFormat(InMemoryFormat.valueOf(parameters.inMemoryFormat));
config.setKeyType(parameters.keyType);
config.setManagementEnabled(parameters.managementEnabled);
config.setMergePolicyConfig(mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize));
config.setName(parameters.name);
if (parameters.partitionLostListenerConfigs != null && !parameters.partitionLostListenerConfigs.isEmpty()) {
List<CachePartitionLostListenerConfig> listenerConfigs = (List<CachePartitionLostListenerConfig>) adaptListenerConfigs(parameters.partitionLostListenerConfigs);
config.setPartitionLostListenerConfigs(listenerConfigs);
} else {
config.setPartitionLostListenerConfigs(new ArrayList<>());
}
config.setSplitBrainProtectionName(parameters.splitBrainProtectionName);
config.setReadThrough(parameters.readThrough);
config.setStatisticsEnabled(parameters.statisticsEnabled);
config.setValueType(parameters.valueType);
config.setWanReplicationRef(parameters.wanReplicationRef);
config.setWriteThrough(parameters.writeThrough);
if (parameters.isMerkleTreeConfigExists) {
config.setMerkleTreeConfig(parameters.merkleTreeConfig);
}
return config;
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AddCacheConfigMessageTask method checkStaticConfigDoesNotExist.
@Override
protected boolean checkStaticConfigDoesNotExist(IdentifiedDataSerializable config) {
DynamicConfigurationAwareConfig nodeConfig = (DynamicConfigurationAwareConfig) nodeEngine.getConfig();
CacheSimpleConfig cacheConfig = (CacheSimpleConfig) config;
return nodeConfig.checkStaticConfigDoesNotExist(nodeConfig.getStaticConfig().getCacheConfigs(), cacheConfig.getName(), cacheConfig);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleCache.
protected void handleCache(Node node) throws Exception {
CacheSimpleConfig cacheConfig = ConfigUtils.getByNameOrNew(config.getCacheConfigs(), getAttribute(node, "name"), CacheSimpleConfig.class);
handleCacheNode(node, cacheConfig);
}
Aggregations