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; }
.setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)) .setDiskStoreName(diskStore) .create(name); .setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(5, EvictionAction.OVERFLOW_TO_DISK)) .setDiskStoreName(diskStore) .create(name);
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"); } };
private void createPartitionedRegion(String regionName) { final Cache cache = getCache(); // Create the data region RegionFactory<String, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); dataRegionFactory.setConcurrencyLevel(4); EvictionAttributes ea = EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY); dataRegionFactory.setEvictionAttributes(ea); dataRegionFactory.setEnableAsyncConflation(true); FixedPartitionAttributes fpa = FixedPartitionAttributes.createFixedPartition("Par1", true); PartitionAttributes pa = new PartitionAttributesFactory() .setLocalMaxMemory(100) .setRecoveryDelay(2) .setTotalMaxMemory(200) .setRedundantCopies(1) .addFixedPartitionAttributes(fpa) .create(); dataRegionFactory.setPartitionAttributes(pa); dataRegionFactory.create(regionName); }
public void run() { final Cache cache = getCache(); RegionFactory<String, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); dataRegionFactory.setConcurrencyLevel(4); EvictionAttributes ea = EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY); dataRegionFactory.setEvictionAttributes(ea); dataRegionFactory.setEnableAsyncConflation(true); FixedPartitionAttributes fpa = FixedPartitionAttributes.createFixedPartition("Par1", true); PartitionAttributes pa = new PartitionAttributesFactory() .setLocalMaxMemory(100) .setRecoveryDelay(2) .setTotalMaxMemory(200) .setRedundantCopies(1) .addFixedPartitionAttributes(fpa) .create(); dataRegionFactory.setPartitionAttributes(pa); dataRegionFactory.create(PR1); createLocalRegion(LOCALREGIONONMANAGER); } });
public void run() { getSystem(server1Props); final Cache cache = getCache(); RegionFactory<String, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); dataRegionFactory.setConcurrencyLevel(4); EvictionAttributes ea = EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY); dataRegionFactory.setEvictionAttributes(ea); dataRegionFactory.setEnableAsyncConflation(true); FixedPartitionAttributes fpa = FixedPartitionAttributes.createFixedPartition("Par2", 4); PartitionAttributes pa = new PartitionAttributesFactory() .setLocalMaxMemory(150) .setRecoveryDelay(4) .setTotalMaxMemory(200) .setRedundantCopies(1) .addFixedPartitionAttributes(fpa) .create(); dataRegionFactory.setPartitionAttributes(pa); dataRegionFactory.create(PR1); createRegionsWithSubRegions(); } });
private void createPartitionedRegion(String regionName) { final Cache cache = getCache(); // Create the data region RegionFactory<String, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); dataRegionFactory.setConcurrencyLevel(4); EvictionAttributes ea = EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY); dataRegionFactory.setEvictionAttributes(ea); dataRegionFactory.setEnableAsyncConflation(true); FixedPartitionAttributes fpa = FixedPartitionAttributes.createFixedPartition("Par1", true); PartitionAttributes pa = new PartitionAttributesFactory() .setLocalMaxMemory(100) .setRecoveryDelay(2) .setTotalMaxMemory(200) .setRedundantCopies(1) .addFixedPartitionAttributes(fpa) .create(); dataRegionFactory.setPartitionAttributes(pa); dataRegionFactory.addCacheListener(new CacheListener1()); dataRegionFactory.addCacheListener(new CacheListener2()); dataRegionFactory.create(regionName); }