@Override public NearCacheConfig getNearCacheConfig() { final NearCacheConfig nearCacheConfig = super.getNearCacheConfig(); if (nearCacheConfig == null) { return null; } return nearCacheConfig.getAsReadOnly(); }
@Override public NearCacheConfig getNearCacheConfig() { final NearCacheConfig nearCacheConfig = super.getNearCacheConfig(); if (nearCacheConfig == null) { return null; } return nearCacheConfig.getAsReadOnly(); }
@Override public T getConfig(@Nonnull String name, String fallbackName, @Nonnull ConfigSupplier<T> configSupplier) { String baseName = getBaseName(name); Map<String, T> staticCacheConfigs = configSupplier.getStaticConfigs(staticConfig); T config = lookupByPattern(configPatternMatcher, staticCacheConfigs, baseName); if (config == null) { config = configSupplier.getDynamicConfig(configurationService, baseName); } else if (MapConfig.class.isAssignableFrom(config.getClass())) { // this is required only for map config initDefaultMaxSizeForOnHeapMaps(((MapConfig) config).getNearCacheConfig()); } if (config == null && fallbackName != null) { config = configSupplier.getStaticConfig(staticConfig, fallbackName); } return config; } }
@Override public T getConfig(@Nonnull String name, String fallbackName, @Nonnull ConfigSupplier<T> configSupplier) { String baseName = getBaseName(name); Map<String, T> staticCacheConfigs = configSupplier.getStaticConfigs(staticConfig); T config = lookupByPattern(configPatternMatcher, staticCacheConfigs, baseName); if (config == null) { config = configSupplier.getDynamicConfig(configurationService, baseName); } else if (MapConfig.class.isAssignableFrom(config.getClass())) { // this is required only for map config initDefaultMaxSizeForOnHeapMaps(((MapConfig) config).getNearCacheConfig()); } if (config == null && fallbackName != null) { config = configSupplier.getStaticConfig(staticConfig, fallbackName); } return config; } }
@Override public T getConfig(@Nonnull String name, String fallbackName, @Nonnull ConfigSupplier<T> configSupplier) { String baseName = getBaseName(name); Map<String, T> staticCacheConfigs = configSupplier.getStaticConfigs(staticConfig); T config = configSupplier.getDynamicConfig(configurationService, baseName); if (config == null) { config = lookupByPattern(configPatternMatcher, staticCacheConfigs, baseName); if (config != null && MapConfig.class.isAssignableFrom(config.getClass())) { // this is required only for map config initDefaultMaxSizeForOnHeapMaps(((MapConfig) config).getNearCacheConfig()); } } if (config == null) { config = configSupplier.getStaticConfig(staticConfig, fallbackName); } return config; } }
@Override public T getConfig(@Nonnull String name, String fallbackName, @Nonnull ConfigSupplier<T> configSupplier) { String baseName = getBaseName(name); Map<String, T> staticCacheConfigs = configSupplier.getStaticConfigs(staticConfig); T config = configSupplier.getDynamicConfig(configurationService, baseName); if (config == null) { config = lookupByPattern(configPatternMatcher, staticCacheConfigs, baseName); if (config != null && MapConfig.class.isAssignableFrom(config.getClass())) { // this is required only for map config initDefaultMaxSizeForOnHeapMaps(((MapConfig) config).getNearCacheConfig()); } } if (config == null) { config = configSupplier.getStaticConfig(staticConfig, fallbackName); } return config; } }
@Override public void initialize() { super.initialize(); mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); nearCache = mapNearCacheManager.getOrCreateNearCache(name, mapConfig.getNearCacheConfig()); if (invalidateOnChange) { registerInvalidationListener(); } }
public NearCachedMapProxyImpl(String name, MapService mapService, NodeEngine nodeEngine, MapConfig mapConfig) { super(name, mapService, nodeEngine, mapConfig); clusterService = nodeEngine.getClusterService(); NearCacheConfig nearCacheConfig = mapConfig.getNearCacheConfig(); cacheLocalEntries = nearCacheConfig.isCacheLocalEntries(); invalidateOnChange = nearCacheConfig.isInvalidateOnChange(); serializeKeys = nearCacheConfig.isSerializeKeys(); }
@Override public void initialize() { super.initialize(); mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); nearCache = mapNearCacheManager.getOrCreateNearCache(name, mapConfig.getNearCacheConfig()); if (invalidateOnChange) { registerInvalidationListener(); } }
public NearCachedMapProxyImpl(String name, MapService mapService, NodeEngine nodeEngine, MapConfig mapConfig) { super(name, mapService, nodeEngine, mapConfig); clusterService = nodeEngine.getClusterService(); NearCacheConfig nearCacheConfig = mapConfig.getNearCacheConfig(); cacheLocalEntries = nearCacheConfig.isCacheLocalEntries(); invalidateOnChange = nearCacheConfig.isInvalidateOnChange(); serializeKeys = nearCacheConfig.isSerializeKeys(); }
NearCacheConfig nearCacheConfig1 = config.getMapConfig("articlesObject").getNearCacheConfig(); NearCacheConfig nearCacheConfig2 = config.getMapConfig("articlesSerializedKeys").getNearCacheConfig();
/** * Returns a read-only {@link com.hazelcast.core.IMap} configuration for * the given name. * <p> * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given {@code name}. * If there is no config found by the name, it will return the configuration * with the name {@code default}. * For non-default configurations and on-heap maps, it will also * initialise the Near Cache eviction if not previously set. * * @param name name of the map config * @return the map configuration * @throws ConfigurationException if ambiguous configurations are found * @see StringPartitioningStrategy#getBaseName(java.lang.String) * @see #setConfigPatternMatcher(ConfigPatternMatcher) * @see #getConfigPatternMatcher() * @see EvictionConfig#setSize(int) */ public MapConfig findMapConfig(String name) { name = getBaseName(name); MapConfig config = lookupByPattern(configPatternMatcher, mapConfigs, name); if (config != null) { initDefaultMaxSizeForOnHeapMaps(config.getNearCacheConfig()); return config.getAsReadOnly(); } return getMapConfig("default").getAsReadOnly(); }
@Override public DistributedObject createDistributedObject(String name) { Config config = nodeEngine.getConfig(); MapConfig mapConfig = config.findMapConfig(name); MergePolicyProvider mergePolicyProvider = mapServiceContext.getMergePolicyProvider(); checkMapConfig(mapConfig, mergePolicyProvider); Object mergePolicy = mergePolicyProvider.getMergePolicy(mapConfig.getMergePolicyConfig().getPolicy()); checkMergePolicySupportsInMemoryFormat(name, mergePolicy, mapConfig.getInMemoryFormat(), true, nodeEngine.getLogger(getClass())); if (mapConfig.isNearCacheEnabled()) { initDefaultMaxSizeForOnHeapMaps(mapConfig.getNearCacheConfig()); checkNearCacheConfig(name, mapConfig.getNearCacheConfig(), config.getNativeMemoryConfig(), false); return new NearCachedMapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig); } else { return new MapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig); } }
/** * Returns a read-only {@link com.hazelcast.core.IMap} configuration for * the given name. * <p> * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given {@code name}. * If there is no config found by the name, it will return the configuration * with the name {@code default}. * For non-default configurations and on-heap maps, it will also * initialise the Near Cache eviction if not previously set. * * @param name name of the map config * @return the map configuration * @throws ConfigurationException if ambiguous configurations are found * @see StringPartitioningStrategy#getBaseName(java.lang.String) * @see #setConfigPatternMatcher(ConfigPatternMatcher) * @see #getConfigPatternMatcher() * @see EvictionConfig#setSize(int) */ public MapConfig findMapConfig(String name) { name = getBaseName(name); MapConfig config = lookupByPattern(configPatternMatcher, mapConfigs, name); if (config != null) { initDefaultMaxSizeForOnHeapMaps(config.getNearCacheConfig()); return config.getAsReadOnly(); } return getMapConfig("default").getAsReadOnly(); }
@Override public DistributedObject createDistributedObject(String name) { Config config = nodeEngine.getConfig(); MapConfig mapConfig = config.findMapConfig(name); MergePolicyProvider mergePolicyProvider = mapServiceContext.getMergePolicyProvider(); checkMapConfig(mapConfig, mergePolicyProvider); Object mergePolicy = mergePolicyProvider.getMergePolicy(mapConfig.getMergePolicyConfig().getPolicy()); checkMergePolicySupportsInMemoryFormat(name, mergePolicy, mapConfig.getInMemoryFormat(), nodeEngine.getClusterService().getClusterVersion(), true, nodeEngine.getLogger(getClass())); if (mapConfig.isNearCacheEnabled()) { initDefaultMaxSizeForOnHeapMaps(mapConfig.getNearCacheConfig()); checkNearCacheConfig(name, mapConfig.getNearCacheConfig(), config.getNativeMemoryConfig(), false); return new NearCachedMapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig); } else { return new MapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig); } }
TransactionalMapProxySupport(String name, MapService mapService, NodeEngine nodeEngine, Transaction transaction) { super(nodeEngine, mapService, transaction); this.name = name; this.mapServiceContext = mapService.getMapServiceContext(); this.mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); MapConfig mapConfig = nodeEngine.getConfig().findMapConfig(name); this.operationProvider = mapServiceContext.getMapOperationProvider(mapConfig); this.partitionStrategy = mapServiceContext.getPartitioningStrategy(name, mapConfig.getPartitioningStrategyConfig()); this.partitionService = nodeEngine.getPartitionService(); this.operationService = nodeEngine.getOperationService(); this.ss = ((InternalSerializationService) nodeEngine.getSerializationService()); this.nearCacheEnabled = mapConfig.isNearCacheEnabled(); this.serializeKeys = nearCacheEnabled && mapConfig.getNearCacheConfig().isSerializeKeys(); this.valueComparator = mapServiceContext.getValueComparatorOf(mapConfig.getInMemoryFormat()); }
TransactionalMapProxySupport(String name, MapService mapService, NodeEngine nodeEngine, Transaction transaction) { super(nodeEngine, mapService, transaction); this.name = name; this.mapServiceContext = mapService.getMapServiceContext(); this.mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); MapConfig mapConfig = nodeEngine.getConfig().findMapConfig(name); this.operationProvider = mapServiceContext.getMapOperationProvider(mapConfig); this.partitionStrategy = mapServiceContext.getPartitioningStrategy(name, mapConfig.getPartitioningStrategyConfig()); this.partitionService = nodeEngine.getPartitionService(); this.operationService = nodeEngine.getOperationService(); this.ss = ((InternalSerializationService) nodeEngine.getSerializationService()); this.nearCacheEnabled = mapConfig.isNearCacheEnabled(); this.serializeKeys = nearCacheEnabled && mapConfig.getNearCacheConfig().isSerializeKeys(); this.valueComparator = mapServiceContext.getValueComparatorOf(mapConfig.getInMemoryFormat()); }
mapConfig.getMaxSizeConfig().getMaxSizePolicy().name(), mapConfig.getMaxSizeConfig().getSize(), MapStoreConfigHolder.of(mapConfig.getMapStoreConfig(), serializationService), NearCacheConfigHolder.of(mapConfig.getNearCacheConfig(), serializationService), mapConfig.getWanReplicationRef(), mapConfig.getMapIndexConfigs(), mapConfig.getMapAttributeConfigs(), queryCacheConfigHolders, partitioningStrategyClassName, partitioningStrategy, mapConfig.getHotRestartConfig(),
mapConfig.getMaxSizeConfig().getMaxSizePolicy().name(), mapConfig.getMaxSizeConfig().getSize(), MapStoreConfigHolder.of(mapConfig.getMapStoreConfig(), serializationService), NearCacheConfigHolder.of(mapConfig.getNearCacheConfig(), serializationService), mapConfig.getWanReplicationRef(), mapConfig.getMapIndexConfigs(), mapConfig.getMapAttributeConfigs(), queryCacheConfigHolders, partitioningStrategyClassName, partitioningStrategy, mapConfig.getHotRestartConfig(),
mapNearCacheConfigXmlGenerator(gen, m.getNearCacheConfig()); wanReplicationConfigXmlGenerator(gen, m.getWanReplicationRef()); mapIndexConfigXmlGenerator(gen, m);