/** * Sets the DiskStore name attribute. * This causes the region to belong to the DiskStore. * @param name the name of the diskstore * @return a reference to this RegionFactory object * @since 6.5 * * @see AttributesFactory#setDiskStoreName */ public RegionFactory<K,V> setDiskStoreName(String name) { this.attrsFactory.setDiskStoreName(name); return this; }
public ClientRegionFactory<K,V> setDiskStoreName(String name) { this.attrsFactory.setDiskStoreName(name); return this; }
public ClientRegionFactory<K,V> setDiskStoreName(String name) { this.attrsFactory.setDiskStoreName(name); return this; }
/** * Sets the DiskStore name attribute. * This causes the region to belong to the DiskStore. * @param name the name of the diskstore * @return a reference to this RegionFactory object * @since 6.5 * * @see AttributesFactory#setDiskStoreName */ public RegionFactory<K,V> setDiskStoreName(String name) { this.attrsFactory.setDiskStoreName(name); return this; }
protected RegionAttributes getDiskRegionAttributes() { AttributesFactory factory = new AttributesFactory(getRegionAttributes()); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .setTimeInterval(1000) .setQueueSize(0) .create("TXRestrictionsTest") .getName()); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); }
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_NO_ACK); factory.setEvictionAttributes(EvictionAttributes .createLRUMemoryAttributes(2, null, EvictionAction.OVERFLOW_TO_DISK)); File d = new File("DiskRegions" + ProcessMgr.getProcessId()); d.mkdirs(); DiskStoreFactory dsf = getCache().createDiskStoreFactory(); dsf.setDiskDirs(new File[]{d}); DiskStore ds = dsf.create(name); factory.setDiskStoreName(ds.getName()); createRegion(name, factory.create()); } };
protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_NO_ACK); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .setTimeInterval(1000) .setQueueSize(0) .create("DiskDistributedNoAckAsyncRegionTest") .getName()); factory.setDiskSynchronous(false); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); }
protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_NO_ACK); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .create("DiskDistributedNoAckSyncOverflowRegionTest") .getName()); factory.setEvictionAttributes(EvictionAttributes .createLRUMemoryAttributes(1, null, EvictionAction.OVERFLOW_TO_DISK)); factory.setDiskSynchronous(true); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); }
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); factory.setEvictionAttributes(EvictionAttributes .createLRUEntryAttributes(100, EvictionAction.OVERFLOW_TO_DISK)); File d = new File("DiskRegions" + ProcessMgr.getProcessId()); d.mkdirs(); DiskStoreFactory dsf = getCache().createDiskStoreFactory(); dsf.setDiskDirs(new File[]{d}); DiskStore ds = dsf.create(name); factory.setDiskStoreName(ds.getName()); createRegion(name, factory.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } });
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); createRegion(name, factory.create()); } };
public void run() { cache = getCache(); DiskStore ds = cache.findDiskStore(diskStoreName); if(ds == null) { ds = cache.createDiskStoreFactory() .setDiskDirs(getDiskDirs()).create(diskStoreName); } AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); af.setDiskStoreName(diskStoreName); cache.createRegion(regionName, af.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory 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()); } });
public void run() { Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(0); paf.setRecoveryDelay(0); paf.setColocatedWith(PR_REGION_NAME); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); af.setPartitionAttributes(paf.create()); cache.createRegion("region2", af.create()); } };
public void run2() throws CacheException { RegionAttributes ra = getRegionAttributes(); AttributesFactory factory = new AttributesFactory(ra); if (ra.getEvictionAttributes() == null || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) { factory.setDiskStoreName(null); } factory.setDataPolicy(DataPolicy.REPLICATE); Region region = createRegion(name, factory.create()); region.put(key1, value1); region.put(key2, value2); region.put(key3, value3); } };
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore("disk"); if (ds == null) { ds = cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()) .create("disk"); } AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); af.setPartitionAttributes(paf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); cache.createRegion(PR_REGION_NAME, af.create()); } };
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore("disk"); if (ds == null) { ds = cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()) .create("disk"); } AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); af.setPartitionAttributes(paf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); cache.createRegion(PR_REGION_NAME, af.create()); } };