/** * Sets the eviction attributes that controls growth of the Region to be created. * * @param evictionAttributes for the Region to create * @return a reference to this RegionFactory object */ public RegionFactory<K,V> setEvictionAttributes(EvictionAttributes evictionAttributes) { this.attrsFactory.setEvictionAttributes(evictionAttributes); return this; }
/** * Sets the eviction attributes that controls growth of the Region to be created. * * @param evictionAttributes for the Region to create * @return a reference to this RegionFactory object */ public RegionFactory<K,V> setEvictionAttributes(EvictionAttributes evictionAttributes) { this.attrsFactory.setEvictionAttributes(evictionAttributes); return this; }
@Override protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setConcurrencyChecksEnabled(true); factory.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes( 5, EvictionAction.OVERFLOW_TO_DISK)); return factory.create(); }
public static void createDistRegionWithMemEvictionAttr() { final AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.NORMAL); factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes( new ObjectSizerImpl(), EvictionAction.LOCAL_DESTROY)); DistributedRegion distRegion = (DistributedRegion)cache.createRegion("DR1", factory.create()); assertNotNull(distRegion); }
public void createDistRegion() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(getOffHeapEnabled()); factory.setDataPolicy(DataPolicy.NORMAL); factory.setEvictionAttributes(EvictionAttributes.createLRUHeapAttributes( null, EvictionAction.LOCAL_DESTROY)); DistributedRegion distRegion = (DistributedRegion)cache.createRegion("DR1", factory.create()); assertNotNull(distRegion); }
public void run2() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); factory.setEvictionAttributes(firstEvictionAttributes); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); assertEquals(firstEvictionAttributes, pr.getAttributes() .getEvictionAttributes()); } };
public Object call() throws Exception { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); Region region = cache.createRegion("region1", attr.create()); return null; } };
public void run2() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); factory.setEvictionAttributes(firstEa); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); assertEquals(firstEa, pr.getAttributes().getEvictionAttributes()); } };
public void run() { Cache cache = getCache(); AttributesFactory<Integer, TestDelta> attr = new AttributesFactory<Integer, TestDelta>(); PartitionAttributesFactory<Integer, TestDelta> paf = new PartitionAttributesFactory<Integer, TestDelta>(); paf.setLocalMaxMemory(0); PartitionAttributes<Integer, TestDelta> prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setDataPolicy(DataPolicy.PARTITION); attr.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); Region<Integer, TestDelta> region = cache.createRegion("region1", attr.create()); } };
public void run() { Cache cache = getCache(); AttributesFactory<Integer, TestDelta> attr = new AttributesFactory<Integer, TestDelta>(); attr.setDiskSynchronous(true); attr.setDataPolicy(DataPolicy.REPLICATE); attr.setScope(Scope.DISTRIBUTED_ACK); attr.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(1, new TestObjectSizer(), EvictionAction.OVERFLOW_TO_DISK)); attr.setDiskDirs(getMyDiskDirs()); Region region = cache.createRegion("region", attr.create()); } });
public void run2() { getCache().getResourceManager().setEvictionHeapPercentage(heapPercentage); final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); factory.setEvictionAttributes(firstEvictionAttributes); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); assertEquals(firstEvictionAttributes, pr.getAttributes() .getEvictionAttributes()); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(secondEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(secondEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); factory.setEvictionAttributes(firstEvictionAttrs); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };
public void run() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); final EvictionAttributes ea = EvictionAttributes.createLRUEntryAttributes(firstEvictionAttributes.getMaximum()+10, firstEvictionAttributes.getAction()); factory.setEvictionAttributes(ea); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };