/** * All entries for the LRUCapacityController are considered to be of size 1. */ @Override public int entrySize(Object key, Object value) { if (Token.isRemoved(value)) { // bug #42228 - lruEntryDestroy removes an entry from the LRU, but if // it is subsequently resurrected we want the new entry to generate a delta return 0; } if ((value == null /* overflow to disk */ || value == Token.INVALID || value == Token.LOCAL_INVALID) && getEvictionAction().isOverflowToDisk()) { // Don't count this entry toward LRU return 0; } else { return 1; } }
private boolean isOverflowEnabled() { EvictionAttributes ea = getAttributes().getEvictionAttributes(); return ea != null && ea.getAction().isOverflowToDisk(); }
@Override public void run2() throws CacheException { RegionAttributes<Object, Object> ra = getRegionAttributes(); AttributesFactory<Object, Object> factory = new AttributesFactory<>(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } });
@Override public void run2() throws CacheException { RegionAttributes<Object, Object> ra = getRegionAttributes(); AttributesFactory<Object, Object> factory = new AttributesFactory<>(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); factory.addCacheListener(new MirroredDataFromNonMirroredListener()); createRegion(name, factory.create()); } });
@Override public void run2() throws CacheException { RegionAttributes<Object, Object> ra = getRegionAttributes(); AttributesFactory<Object, Object> factory = new AttributesFactory<>(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); setLoader(new TestCacheLoader<Object, Object>() { @Override public Object load2(LoaderHelper<Object, Object> helper) throws CacheLoaderException { fail("Should not be invoked"); return null; } }); factory.setCacheLoader(loader()); createRegion(name, factory.create()); } };
public IndexManager(InternalCache cache, Region region) { this.cache = cache; this.region = region; // must be a SortedMap to ensure the indexes are iterated over in fixed // order // to avoid deadlocks when acquiring locks // indexes = Collections.synchronizedSortedMap(new TreeMap()); indexMaintenanceSynchronous = region.getAttributes().getIndexMaintenanceSynchronous(); isOverFlowToDisk = region.getAttributes().getEvictionAttributes().getAction().isOverflowToDisk(); this.offHeap = region.getAttributes().getOffHeap(); if (!indexMaintenanceSynchronous) { updater = new IndexUpdaterThread(this.INDEX_MAINTENANCE_BUFFER, "OqlIndexUpdater:" + region.getFullPath()); updater.start(); } }
return 0; } else if (action.isOverflowToDisk()) { Assert.assertTrue(entry instanceof DiskEntry); int change = 0;
&& this.getEvictionAttributes().getAction().isOverflowToDisk()) || this.getDataPolicy().withPersistence()) { StatisticsFactory sf = this.getCache().getDistributedSystem();
diskFlags.add(DiskRegionFlag.IS_WITH_VERSIONING); boolean overflowEnabled = ea != null && ea.getAction().isOverflowToDisk(); int startingBucketID = -1; String partitionName = NO_FIXED_PARTITION_NAME;
EvictionAttributes evBucket = eva; factory.setEvictionAttributes(evBucket); if (evBucket.getAction().isOverflowToDisk()) { setDiskAttributes(factory);