/** * @param logWriter * @param criticalState */ public MemoryHog(String n, Cache c, AtomicBoolean critical) { this.name = n; this.cache = c; this.tenuredData = new RegionFactory().setScope(Scope.LOCAL).create(this.name); this.criticalState = critical; }
protected RegionFactory<?, ?> defineRegionFactory() { return new RegionFactory() .setPartitionAttributes(definePartitionAttributes()); }
protected Region createRegion() { RegionFactory rf = new RegionFactory(); rf.setDiskStoreName("diskStore"); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); Region region = rf.create("region"); return region; }
@SuppressWarnings({ "rawtypes", "deprecation" }) @Override protected RegionFactory<?, ?> defineRegionFactory() { return new RegionFactory() .setPartitionAttributes(definePartitionAttributes()) .setEnableOffHeapMemory(true); } }
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.EMPTY); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.EMPTY); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.EMPTY); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.create(REGION_NAME); } };
public void run() { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); rf.setScope(Scope.DISTRIBUTED_ACK); rf.setConcurrencyChecksEnabled(false); rf.setDataPolicy(DataPolicy.REPLICATE); rf.create("region"); } });
public void run() { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); rf.setScope(Scope.DISTRIBUTED_ACK); rf.setConcurrencyChecksEnabled(false); rf.setDataPolicy(DataPolicy.EMPTY); rf.create("region"); } });
private Region createOverflowRegion() { RegionFactory rf = new RegionFactory(); rf.setDiskStoreName("diskStore"); rf.setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); rf.setDataPolicy(DataPolicy.NORMAL); Region region = rf.create("region"); return region; }
public void testNoConcurrencyChecks () { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); rf.setConcurrencyChecksEnabled(false); try { LocalRegion region = (LocalRegion) rf.create(REGION_NAME); fail("Expected to get an IllegalStateException because concurrency checks can't be disabled"); } catch(IllegalStateException expected) { //do nothing } }
public void run() { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); rf.setScope(Scope.DISTRIBUTED_ACK); rf.setConcurrencyChecksEnabled(false); rf.setDataPolicy(DataPolicy.NORMAL); rf.setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.ALL)); rf.create("region"); } });
public Region createRegion() { DiskStoreImpl ds = createDiskStore(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); rf.setDiskDirs(diskDirs); DiskWriteAttributesFactory daf = new DiskWriteAttributesFactory(); daf.setMaxOplogSize(1); rf.setDiskWriteAttributes(daf.create()); Region region = rf.create("region"); return region; } });
public void testPutsPartitionedRegion() throws Exception{ PartitionAttributes pa = new PartitionAttributesFactory(). setRedundantCopies(0).setTotalNumBuckets(3).create(); Region region = new RegionFactory().setPartitionAttributes(pa).create("parReg"); checkOpRejection(region, false, true); region.close(); assertEquals(0 + SYSTEM_LISTENERS, cache.getResourceManager(false). getResourceListeners(ResourceType.HEAP_MEMORY).size()); }
public void run() { Cache cache = getCache(); DiskStoreFactory dsf = cache.createDiskStoreFactory(); dsf.setDiskDirs(getDiskDirs(getUniqueName())); dsf.setMaxOplogSize(1); DiskStore ds = dsf.create(getUniqueName()); RegionFactory rf = new RegionFactory(); rf.setDiskStoreName(ds.getName()); rf.setDiskSynchronous(true); rf.setDataPolicy(DataPolicy.REPLICATE); rf.setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); rf.create("region3"); } };