public boolean isServerMap() { return snapshot.isServerMap(); }
public boolean isServerMap() { return snapshot.isServerMap(); }
private void startEviction() { // This method is also directly invoked as a "postCreate" method (ie. it will be invoked when a non-shared instance // of this class becomes shared) if (this.config.isServerMap()) { // no need to run eviction scheduler for servermap return; } evictionScheduler.start(); }
private void startEviction() { // This method is also directly invoked as a "postCreate" method (ie. it will be invoked when a non-shared instance // of this class becomes shared) if (this.config.isServerMap()) { // no need to run eviction scheduler for servermap return; } evictionScheduler.start(); }
private void startEviction() { // This method is also directly invoked as a "postCreate" method (ie. it will be invoked when a non-shared instance // of this class becomes shared) if (this.config.isServerMap()) { // no need to run eviction scheduler for servermap return; } evictionScheduler.start(); }
/** * Constructs an immutable configuration as a value-based copy of the supplied configuration. * * @param config configuration to copy from */ public ImmutableConfig(final CacheConfig config) { this.name = config.getName(); this.loggingEnabled = config.isLoggingEnabled(); this.maxTTISeconds = config.getMaxTTISeconds(); this.maxTTLSeconds = config.getMaxTTLSeconds(); this.orphanEvictionEnabled = config.isOrphanEvictionEnabled(); this.orphanEvictionPeriod = config.getOrphanEvictionPeriod(); this.targetMaxInMemoryCount = config.getTargetMaxInMemoryCount(); this.targetMaxTotalCount = config.getTargetMaxTotalCount(); this.capacityEvictionPolicyDataFactory = config.getCapacityEvictionPolicyDataFactory(); this.serverMap = config.isServerMap(); }
/** * Constructs an immutable configuration as a value-based copy of the supplied * configuration. * * @param config configuration to copy from */ public ImmutableConfig(final CacheConfig config) { this.name = config.getName(); this.loggingEnabled = config.isLoggingEnabled(); this.maxTTISeconds = config.getMaxTTISeconds(); this.maxTTLSeconds = config.getMaxTTLSeconds(); this.orphanEvictionEnabled = config.isOrphanEvictionEnabled(); this.orphanEvictionPeriod = config.getOrphanEvictionPeriod(); this.targetMaxInMemoryCount = config.getTargetMaxInMemoryCount(); this.targetMaxTotalCount = config.getTargetMaxTotalCount(); this.capacityEvictionPolicyDataFactory = config.getCapacityEvictionPolicyDataFactory(); this.serverMap = config.isServerMap(); }
protected void initializeOnLoad(final boolean startEviction) { if (config.isLoggingEnabled()) { LOGGER.info("Initializing CHMDistributedMap, starting eviction thread"); } this.timeSource = new SystemTimeSource(); this.orphanEvictor = new OrphanEvictionListener<K>(config, this, orphanEvictorLock); this.evictionScheduler = new EvictionScheduler(config, new Evictor<K>(this, orphanEvictor)); this.statistics = new EvictionStatistics(); if (!this.config.isServerMap()) { // target capacity eviction listener not needed for servermap this.data.registerMapSizeListener(new TargetCapacityMapSizeListener(data, getConfig())); } if (startEviction) { startEviction(); } }
protected void initializeOnLoad(final boolean startEviction) { if (config.isLoggingEnabled()) { LOGGER.info("Initializing CHMDistributedMap, starting eviction thread"); } this.timeSource = new SystemTimeSource(); this.orphanEvictor = new OrphanEvictionListener<K>(config, this, orphanEvictorLock); this.evictionScheduler = new EvictionScheduler(config, new Evictor<K>(this, orphanEvictor)); this.statistics = new EvictionStatistics(); if (this.data instanceof CacheEvictionListenerSupport) { ((CacheEvictionListenerSupport) this.data).addCacheEvictionListener(this); } if (!this.config.isServerMap()) { // target capacity eviction listener not needed for servermap this.data.registerMapSizeListener(new TargetCapacityMapSizeListener(data, getConfig(), this)); } if (startEviction) { startEviction(); } }
/** * Constructs an immutable configuration as a value-based copy of the supplied configuration. * * @param config configuration to copy from */ public ImmutableConfig(final CacheConfig config) { this.name = config.getName(); this.loggingEnabled = config.isLoggingEnabled(); this.maxTTISeconds = config.getMaxTTISeconds(); this.maxTTLSeconds = config.getMaxTTLSeconds(); this.orphanEvictionEnabled = config.isOrphanEvictionEnabled(); this.orphanEvictionPeriod = config.getOrphanEvictionPeriod(); this.targetMaxInMemoryCount = config.getTargetMaxInMemoryCount(); this.targetMaxTotalCount = config.getTargetMaxTotalCount(); this.capacityEvictionPolicyDataFactory = config.getCapacityEvictionPolicyDataFactory(); this.serverMap = config.isServerMap(); boolean enableLocalCache; if (config instanceof MutableConfig) { enableLocalCache = ((MutableConfig) config).isLocalCacheEnabled(); } else if (config instanceof ImmutableConfig) { enableLocalCache = ((ImmutableConfig) config).isLocalCacheEnabled(); } else { enableLocalCache = true; } this.localCacheEnabled = enableLocalCache; }
protected void initializeOnLoad(final boolean startEviction) { if (config.isLoggingEnabled()) { LOGGER.info("Initializing CHMDistributedMap, starting eviction thread"); } this.timeSource = new SystemTimeSource(); this.orphanEvictor = new OrphanEvictionListener<K>(config, this, orphanEvictorLock); this.evictionScheduler = new EvictionScheduler(config, new Evictor<K>(this, orphanEvictor)); this.statistics = new EvictionStatistics(); if (this.data instanceof CacheEvictionListenerSupport) { ((CacheEvictionListenerSupport) this.data).addCacheEvictionListener(this); } if (!this.config.isServerMap()) { // target capacity eviction listener not needed for servermap this.data.registerMapSizeListener(new TargetCapacityMapSizeListener(data, getConfig(), this)); } if (startEviction) { startEviction(); } }