public boolean isOrphanEvictionEnabled() { return snapshot.isOrphanEvictionEnabled(); }
public boolean isOrphanEvictionEnabled() { return snapshot.isOrphanEvictionEnabled(); }
public boolean isOrphanEvictionEnabled() { return snapshot.isOrphanEvictionEnabled(); }
public boolean isRegionCacheOrphanEvictionEnabled(final String region) { return lookupTerracottaHibernateEvictorConfig(region).isOrphanEvictionEnabled(); }
/** * Construct an orphan eviction listener with clustered state * * @param config The clustered configuration of the orphan distributed map and orphan evictor * @param store The clustered store to evict * @param orphanEvictorLock The clustered lock that is used as a token to indicate the elected orphan evictor */ public OrphanEvictionListener(CacheConfig config, Evictable<K> store, EvictorLock orphanEvictorLock) { // Copy configuration this.config = config; if (config.isOrphanEvictionEnabled()) { Assert.eval(config.getOrphanEvictionPeriod() > 0); } // Copy clustered resources this.store = store; this.orphanEvictorLock = orphanEvictorLock; }
/** * Construct an orphan eviction listener with clustered state * * @param config The clustered configuration of the orphan distributed map and orphan evictor * @param store The clustered store to evict * @param orphanEvictorLock The clustered lock that is used as a token to indicate the elected orphan evictor */ public OrphanEvictionListener(CacheConfig config, Evictable<K> store, EvictorLock orphanEvictorLock) { // Copy configuration this.config = config; if (config.isOrphanEvictionEnabled()) { Assert.eval(config.getOrphanEvictionPeriod() > 0); } // Copy clustered resources this.store = store; this.orphanEvictorLock = orphanEvictorLock; }
/** * Construct an orphan eviction listener with clustered state * * @param config The clustered configuration of the orphan distributed map and orphan evictor * @param store The clustered store to evict * @param orphanEvictorLock The clustered lock that is used as a token to indicate the elected orphan evictor */ public OrphanEvictionListener(CacheConfig config, Evictable<K> store, EvictorLock orphanEvictorLock) { // Copy configuration this.config = config; if (config.isOrphanEvictionEnabled()) { Assert.eval(config.getOrphanEvictionPeriod() > 0); } // Copy clustered resources this.store = store; this.orphanEvictorLock = orphanEvictorLock; }
/** * Construct an orphan eviction listener with clustered state * * @param config The clustered configuration of the orphan distributed map and orphan evictor * @param store The clustered store to evict * @param orphanEvictorLock The clustered lock that is used as a token to indicate the elected orphan evictor */ public OrphanEvictionListener(CacheConfig config, Evictable<K> store, EvictorLock orphanEvictorLock) { // Copy configuration this.config = config; if (config.isOrphanEvictionEnabled()) { Assert.eval(config.getOrphanEvictionPeriod() > 0); } // Copy clustered resources this.store = store; this.orphanEvictorLock = orphanEvictorLock; }
/** * Attempt to obtain orphan evictor write lock. If successful, set isOrphanEvictor to true */ public void startLocalEviction() { if (config.isOrphanEvictionEnabled() && !isOrphanEvictor) { if (orphanEvictorLock.tryLock()) { isOrphanEvictor = true; log("Elected to be orphan evictor"); } else { isOrphanEvictor = false; } } log("Local eviction started"); }
/** * Attempt to obtain orphan evictor write lock. If successful, set isOrphanEvictor to true */ public void startLocalEviction() { if (config.isOrphanEvictionEnabled() && !isOrphanEvictor) { if (orphanEvictorLock.tryLock()) { isOrphanEvictor = true; log("Elected to be orphan evictor"); } else { isOrphanEvictor = false; } } log("Local eviction started"); }
/** * Attempt to obtain orphan evictor write lock. If successful, set isOrphanEvictor to true */ public void startLocalEviction() { if (config.isOrphanEvictionEnabled() && !isOrphanEvictor) { if (orphanEvictorLock.tryLock()) { isOrphanEvictor = true; log("Elected to be orphan evictor"); } else { isOrphanEvictor = false; } } log("Local eviction started"); }
/** * Attempt to obtain orphan evictor write lock. If successful, set isOrphanEvictor to true */ public void startLocalEviction() { if (config.isOrphanEvictionEnabled() && !isOrphanEvictor) { if (orphanEvictorLock.tryLock()) { isOrphanEvictor = true; log("Elected to be orphan evictor"); } else { isOrphanEvictor = false; } } log("Local eviction started"); }
public void evictOrphanElements(final ClusterInfo clusterInfo) { if (isEvictionEnabled() && getConfig().isOrphanEvictionEnabled()) { for (Map m : data.getConstituentMaps()) { Set<K> keys = clusterInfo.getKeysForOrphanedValues(m); invalidateCacheEntries(keys.iterator()); } } }
public void evictOrphanElements(final ClusterInfo clusterInfo) { if (isEvictionEnabled() && getConfig().isOrphanEvictionEnabled()) { for (Map m : data.getConstituentMaps()) { Set<K> keys = clusterInfo.getKeysForOrphanedValues(m); invalidateCacheEntries(keys.iterator()); } } }
public void evictOrphanElements(final ClusterInfo clusterInfo) { if (isEvictionEnabled() && getConfig().isOrphanEvictionEnabled()) { for (Map m : data.getConstituentMaps()) { Set<K> keys = clusterInfo.getKeysForOrphanedValues(m); invalidateCacheEntries(keys.iterator()); } } }
public void evictOrphanElements(final DsoCluster clusterInfo) { if (isEvictionEnabled() && getConfig().isOrphanEvictionEnabled()) { for (Map m : data.getConstituentMaps()) { Set<K> keys = clusterInfo.getKeysForOrphanedValues(m); invalidateCacheEntries(keys.iterator()); } } }
public ImmutableConfig(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(); }
/** * 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(); }
/** * Perform orphan eviction */ public void endLocalEviction() { log("Local eviction finished"); if (!config.isOrphanEvictionEnabled() || !isOrphanEvictor || !(config.getMaxTTISeconds() > 0 || config.getMaxTTLSeconds() > 0)) { return; } boolean isTimeForOrphanEviction = incrementEvictionCounter(); if (isTimeForOrphanEviction) { log("Running orphan eviction (evictionCount = " + evictionCount + ", orphanEvictionPeriod = " + config.getOrphanEvictionPeriod() + ")"); // when the cluster information has been injected, there's also no sense to evict if (clusterInfo != null) { store.evictOrphanElements(clusterInfo); } } else { log("Not running orphan eviction (evictionCount = " + evictionCount + ", orphanEvictionPeriod = " + config.getOrphanEvictionPeriod() + ")"); } }