public Object call() throws Exception { RegionAttributes ra = PartitionedRegionTestHelper .createRegionAttrsForPR(0, 0); getCache().createRegion(rName, ra); return Boolean.TRUE; } });
public Object call() throws Exception { RegionAttributes ra = PartitionedRegionTestHelper .createRegionAttrsForPR(0, 0); getCache().createRegion(rName, ra); return Boolean.TRUE; } });
public static void caseSetUp() throws Exception { Properties properties = new Properties(); properties.setProperty("mcast-port", "0"); properties.setProperty("locators", ""); distributedSystem = DistributedSystem.connect(properties); Cache cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); RegionAttributes regionAttributes = factory.create(); testRegion = cache.createRegion("TestRegion", regionAttributes); }
public static void caseSetUp() throws Exception { Properties properties = new Properties(); properties.setProperty("mcast-port", "0"); properties.setProperty("locators", ""); distributedSystem = DistributedSystem.connect(properties); Cache cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); RegionAttributes regionAttributes = factory.create(); testRegion = cache.createRegion("TestRegion", regionAttributes); }
public static void createMirroredRegion(){ try{ AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes attr = factory.create(); mirroredRegion = cache.createRegion("mirrored", attr); } catch (Exception ex){ ex.printStackTrace(); } }//end of createCache
public static void createMirroredRegion(){ try{ AttributesFactory factory1 = new AttributesFactory(); factory1.setScope(Scope.DISTRIBUTED_ACK); factory1.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr1 = factory1.create(); mirroredRegion = cache.createRegion("mirrored", attr1); } catch (Exception ex){ ex.printStackTrace(); } }
public Object call() throws IOException { Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); RegionAttributes attrs = af.create(); cache.createRegion(regionName, attrs); startBridgeServer(serverPort, true); return null; } });
public static void createClientCacheFeeder(String host, Integer port) throws Exception { ClientConflationDUnitTest test = new ClientConflationDUnitTest("temp"); cacheFeeder = test.createCache(createProperties1(DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_DEFAULT)); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createPool2(host, factory, port); RegionAttributes attrs = factory.create(); cacheFeeder.createRegion(REGION_NAME1, attrs); attrs = factory.create(); cacheFeeder.createRegion(REGION_NAME2, attrs); }
public void run2() throws CacheException { Cache cache = getCache(); for (int i = startIndexForRegion; i < endIndexForRegion; i++) { cache.createRegion(prPrefix + i, createRegionAttrs(redundancy, localMaxMem, numBuckets)); } getLogWriter() .info( "createMultiplePartitionRegion() - Partition Regions Successfully Completed "); } };
public void run2() throws CacheException { AttributesFactory factory1 = new AttributesFactory(); factory1.setScope(Scope.DISTRIBUTED_ACK); factory1.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr1 = factory1.create(); mirroredRegion = cache.createRegion("mirrored", attr1); // reset slow com.gemstone.gemfire.internal.cache.InitialImageOperation.slowImageProcessing = 0; } };
@Override protected void setUp() throws Exception { super.setUp(); tblName = CacheUtils.init("CacheTest"); cache = CacheUtils.getCache(); AttributesFactory attributesFactory = new AttributesFactory(); attributesFactory.setValueConstraint(Portfolio.class); RegionAttributes regionAttributes = attributesFactory.create(); currRegion = cache.createRegion("portfolios", regionAttributes); qs = CacheUtils.getQueryService(); }
private void createSecondLocalRegion() { Cache cache = CacheUtils.getCache(); AttributesFactory attributesFactory = new AttributesFactory(); attributesFactory.setDataPolicy(DataPolicy.NORMAL); RegionAttributes regionAttributes = attributesFactory.create(); Region region = cache.createRegion(exampleRegionName, regionAttributes); for(int i=1; i<=numElem; i++) { Portfolio obj = new Portfolio(i); region.put(i, obj); System.out.println(obj); } }
public void run() { Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_ACK); af.setDataPolicy(DataPolicy.REPLICATE); Region region = cache.createRegion("region", af.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); } };
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 run() { try { AttributesFactory factory2 = new AttributesFactory(); factory2.setScope(Scope.DISTRIBUTED_ACK); factory2.setEarlyAck(false); factory2.setDataPolicy(DataPolicy.REPLICATE); getCache().createRegion(rgnName, factory2.create()); } catch (CacheException e) { fail("While creating region", e); } } });
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory factory = new AttributesFactory(); factory.addCacheListener(new CacheListener2()); factory.addCacheListener(new CacheListener1()); factory.setScope(scope); RegionAttributes attrs = factory.create(); Region region = cache.createRegion(name, attrs); } });
public static void createDR(String distributedRegionName, DataPolicy dataPolicy) { AttributesFactory attr = new AttributesFactory(); attr.setScope(Scope.DISTRIBUTED_ACK); attr.setDataPolicy(dataPolicy); assertNotNull(cache); region = cache.createRegion(distributedRegionName, attr.create()); assertNotNull(region); getLogWriter().info( "Distributed Region " + distributedRegionName + " created Successfully :" + region); }
@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); } };