private static void setNotClearable(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(false); } }
private static void setNotClearable(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(false); } }
/** * Attempt to disable eviction for the given clustered object. * <p> * If eviction is disabled, then this object will remain in the local heap on the VM from which this method was * called. * * @param o target object * @return {@code true} if eviction was disabled */ public static boolean disableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(false); return true; } return false; }
/** * Attempt to disable eviction for the given clustered object. * <p> * If eviction is disabled, then this object will remain in the local heap on the VM from which this method was * called. * * @param o target object * @return {@code true} if eviction was disabled */ public static boolean disableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(false); return true; } return false; }
/** * Attempt to enabled eviction for the given clustered object. * <p> * If eviction is enabled, then the cluster is free to remove this object * from the local heap on the VM from which this method is called. * * @param o target object * @return {@code true} if eviction was enabled */ public static boolean enableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(true); return true; } return false; }
/** * Attempt to enabled eviction for the given clustered object. * <p> * If eviction is enabled, then the cluster is free to remove this object from the local heap on the VM from which * this method is called. * * @param o target object * @return {@code true} if eviction was enabled */ public static boolean enableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(true); return true; } return false; }
/** * Attempt to enabled eviction for the given clustered object. * <p> * If eviction is enabled, then the cluster is free to remove this object from the local heap on the VM from which * this method is called. * * @param o target object * @return {@code true} if eviction was enabled */ public static boolean enableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(true); return true; } return false; }
/** * Attempt to disable eviction for the given clustered object. * <p> * If eviction is disabled, then this object will remain in the local heap * on the VM from which this method was called. * * @param o target object * @return {@code true} if eviction was disabled */ public static boolean disableEviction(Object o) { if (o instanceof Clearable) { ((Clearable) o).setEvictionEnabled(false); return true; } return false; }
public void initialize() { localClassCache = new ConcurrentHashMap<Integer, ObjectStreamClass>(); localMappingCache = new ConcurrentHashMap<String, Integer>(); // There isn't anything clearable in this map so don't waste time visiting it ((Clearable) mappings).setEvictionEnabled(false); }
public void initialize() { lookup = DEFAULT_LOOKUP; localCache = new ConcurrentHashMap<Integer, ObjectStreamClass>(); // There isn't anything clearable in this map so don't waste time visiting it for (Map map : mappings.getConstituentMaps()) { if (map instanceof Clearable) { ((Clearable) map).setEvictionEnabled(false); } } }
public void initialize() { lookup = DEFAULT_LOOKUP; localCache = new ConcurrentHashMap<Integer, ObjectStreamClass>(); // There isn't anything clearable in this map so don't waste time visiting it for (Map map : mappings.getConstituentMaps()) { if (map instanceof Clearable) { ((Clearable) map).setEvictionEnabled(false); } } }
public void initialize() { oscSoftQueue = new ReferenceQueue<ObjectStreamClass>(); localCache = new ConcurrentHashMap<Integer, CachedOscReference>(); // There isn't anything clearable in this map so don't waste time visiting // it for (Map<?, ?> map : mappings.getConstituentMaps()) { if (map instanceof Clearable) { ((Clearable) map).setEvictionEnabled(false); } } }
public void initialize() { localCache = new ConcurrentHashMap<Integer, ObjectStreamClass>(); // There isn't anything clearable in this map so don't waste time visiting // it for (Map<?, ?> map : mappings.getConstituentMaps()) { if (map instanceof Clearable) { ((Clearable) map).setEvictionEnabled(false); } } }
public CHMDistributedMap(Config config) { this.config = config; final int INITIAL_CAPACITY = 128; final float LOAD_FACTOR = 0.75f; this.data = new ConcurrentHashMap<K, V>(INITIAL_CAPACITY, LOAD_FACTOR, config.getConcurrency()); this.timestamps = new ConcurrentHashMap<K, Timestamp>(INITIAL_CAPACITY, LOAD_FACTOR, config.getConcurrency()); ((Clearable) timestamps).setEvictionEnabled(false); this.globalKeySet = new GlobalKeySet<K>(); this.orphanEvictorLock = new ReentrantLock(); initializeOnLoad(); }
private void initializeStore() { for (int i = 0; i < config.getConcurrency(); i++) { this.store[i] = new CacheDataStoreSegment(); this.dtmStore[i] = new CacheDataStoreSegment(); ((Clearable) dtmStore[i]).setEvictionEnabled(false); } }
protected ConcurrentDistributedMapDsoArray(final CacheConfig cacheConfig, final LockType lockType, final LockStrategy<? super K> lockStrategy, final int concurrency) { // ensure that DSO is active at construction time, ie. fail fast concurrency Assert.pre(!(ManagerUtil.getManager() instanceof NullManager)); int sshift = 0; int ssize = 1; while (ssize < concurrency) { ++sshift; ssize <<= 1; } this.segmentShift = 32 - sshift; this.segmentMask = ssize - 1; this.storeList = new ArrayList<ClusteredMap<K, V>>(ssize); if (this.storeList instanceof Clearable) { // ArrayList isn't currently clearable but it might be someday ((Clearable) this.storeList).setEvictionEnabled(false); } createConstituentMaps(cacheConfig, lockType, lockStrategy, ssize); onLoad(); }
protected ConcurrentDistributedMapDsoArray(final CacheConfig cacheConfig, final LockType lockType, final GenericLockStrategy<L, ? super K> lockStrategy, final int concurrency, final boolean invalidateOnChange, final boolean localCacheEnabled, final boolean deleteValueOnRemove) { // ensure that DSO is active at construction time, ie. fail fast concurrency Assert.pre(!(ManagerUtil.getManager() instanceof NullManager)); this.invalidateOnChange = invalidateOnChange; this.localCacheEnabled = localCacheEnabled; this.deleteValueOnRemove = deleteValueOnRemove; int sshift = 0; int ssize = 1; while (ssize < concurrency) { ++sshift; ssize <<= 1; } this.segmentShift = 32 - sshift; this.segmentMask = ssize - 1; this.storeList = new ArrayList<InternalClusteredMap<K, V>>(ssize); if (this.storeList instanceof Clearable) { // ArrayList isn't currently clearable but it might be someday ((Clearable) this.storeList).setEvictionEnabled(false); } createConstituentMaps(cacheConfig, lockType, lockStrategy, ssize); hasMutateCallbackSupport = probeForMutateCallbackSupport(); onLoad(); }
protected ConcurrentDistributedMapDsoArray(final CacheConfig cacheConfig, final LockType lockType, final GenericLockStrategy<L, ? super K> lockStrategy, final int concurrency, final boolean invalidateOnChange) { // ensure that DSO is active at construction time, ie. fail fast concurrency Assert.pre(!(ManagerUtil.getManager() instanceof NullManager)); this.invalidateOnChange = invalidateOnChange; int sshift = 0; int ssize = 1; while (ssize < concurrency) { ++sshift; ssize <<= 1; } this.segmentShift = 32 - sshift; this.segmentMask = ssize - 1; this.storeList = new ArrayList<InternalClusteredMap<K, V>>(ssize); if (this.storeList instanceof Clearable) { // ArrayList isn't currently clearable but it might be someday ((Clearable) this.storeList).setEvictionEnabled(false); } createConstituentMaps(cacheConfig, lockType, lockStrategy, ssize); hasMutateCallbackSupport = probeForMutateCallbackSupport(); onLoad(); }
hibernateCaches = (ConcurrentMap<String, Cache>) ManagerUtil.lookupOrCreateRoot(rootName, temp); if (hibernateCaches instanceof Clearable) { ((Clearable) hibernateCaches).setEvictionEnabled(false);