protected RegionAttributes createCacheServerAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setPartitionAttributes((new PartitionAttributesFactory()).create()); return factory.create(); } }
protected AttributesFactory getServerCacheAttributesFactory() { AttributesFactory factory = new AttributesFactory(); factory.setPartitionAttributes((new PartitionAttributesFactory()).setTotalNumBuckets(1).create()); return factory; } }
protected RegionAttributes createServerCacheAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.PARTITION); factory.setPartitionAttributes((new PartitionAttributesFactory()).create()); return factory.create(); } }
/** * Returns region attributes for a partitioned region with distributed-ack scope */ @Override protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setEarlyAck(false); factory.setPartitionAttributes((new PartitionAttributesFactory()).create()); return factory.create(); }
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setTotalNumBuckets(totalNumBuckets); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); RegionAttributes regionAttribs = attr.create(); cache.createRegion("PR1", regionAttribs); } };
protected RegionAttributes createRegionAttrs(int red, int localMaxMem) { AttributesFactory attr = new AttributesFactory(); attr.setDataPolicy(DataPolicy.PARTITION); PartitionAttributesFactory paf = new PartitionAttributesFactory(); PartitionAttributes prAttr = paf.setRedundantCopies(red) .setLocalMaxMemory(localMaxMem) .setTotalNumBuckets(TOTAL_NUM_BUCKETS) .create(); attr.setPartitionAttributes(prAttr); return attr.create(); } }
public void run() { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); paf.setTotalNumBuckets(12); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); cache.createRegion("region1", attr.create()); } };
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 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()); } };
private void createPR(String regionName){ Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); paf.setRecoveryDelay(-1); paf.setStartupRecoveryDelay(-1); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); cache.createRegion(regionName, attr.create()); }
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); attr.setPartitionAttributes(new PartitionAttributesFactory() .setTotalNumBuckets(totalNumBuckets) .setLocalMaxMemory(8) .create()); PartitionedRegion p = (PartitionedRegion) cache.createRegion(r, attr.create()); assertNotNull(p); } });
@Override public void run2() throws CacheException { AttributesFactory attr = new AttributesFactory(); attr.setValueConstraint(String.class); PartitionAttributes prAttr = new PartitionAttributesFactory().setRedundantCopies(1).setTotalNumBuckets(totalBuckets).create(); attr.setPartitionAttributes(prAttr); getCache().createRegion(rName, attr.create()); } };
public void run2() throws CacheException { AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); PartitionResolver resolver = MonthBasedPartitionResolver.getInstance(); PartitionAttributes prAttr = paf.setLocalMaxMemory(0).setTotalNumBuckets( totalNumBuckets).setPartitionResolver(resolver).setRedundantCopies(0) .create(); attr.setPartitionAttributes(prAttr); RegionAttributes regionAttribs = attr.create(); cache.createRegion("PR1", regionAttribs); } };
public Object call() throws Exception { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); attr.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(rc) .setTotalNumBuckets(tb) .create()); cache.createRegion(prName, attr.create()); return cache.getDistributedSystem().getDistributedMember(); } };
public void run2() { final PartitionAttributes pra = new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).setLocalMaxMemory(0).create(); AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(pra); 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() throws CacheException { AttributesFactory factory = new AttributesFactory(); //factory.setDataPolicy(DataPolicy.PARTITION); factory.setPartitionAttributes((new PartitionAttributesFactory()).setTotalNumBuckets(8).create()); createRegion(exampleRegionName, factory.create()); createRegion(exampleRegionName2, factory.create()); Region exampleRegion = getRootRegion().getSubregion(exampleRegionName); exampleRegion.getCache().getLogger().fine("#### CREATING PR REGION...."); } });
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); } };