public Object call() throws Exception { getCache().createRegionFactory(RegionShortcut.REPLICATE).create(testName); return null; } };
private Region<?,?> createParReg(String regionName, Cache cache) { RegionFactory regionFactory = cache.createRegionFactory(); regionFactory.setDataPolicy(DataPolicy.PARTITION); return regionFactory.create(regionName); }
@Override public Object call() throws Exception { Region r = getCache().createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT).create(regionName); return null; } };
public Object call() throws Exception { RegionFactory<Integer,TestDataCloseDuringRegionOp> rf = getCache().createRegionFactory(RegionShortcut.REPLICATE_PROXY); rf.setConcurrencyChecksEnabled(false); rf.create( replName); return null; } };
@Override public Object call() throws Exception { RegionFactory rf = getCache().createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT); Region r = rf.create(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } });
@Override public Object call() throws Exception { RegionFactory rf = getCache().createRegionFactory(RegionShortcut.REPLICATE); Region region = rf.create(regionName); assertTrue(region.getAttributes().getConcurrencyChecksEnabled()); return null; } });
@Override public Object call() throws Exception { Region r = getCache().createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT).create(regionName); assertNotNull(r); return null; } };
public Object call() throws Exception { getCache().createRegionFactory(RegionShortcut.REPLICATE).setConcurrencyChecksEnabled(true).create(REP_REG_NAME); getCache().createRegionFactory(RegionShortcut.PARTITION_REDUNDANT).setConcurrencyChecksEnabled(true).create(PR_REG_NAME); return null; } });
public void run() { // no need to close cache as it will be closed as part of teardown2 Cache cache = getCache(); RegionFactory<Integer, Integer> dataRegionFactory = cache .createRegionFactory(RegionShortcut.PARTITION); Region region = dataRegionFactory.create("testRegion"); for (int i = 0; i < 5; i++) { region.put("key" + (i + 200), "value" + (i + 200)); } } });
public void run() { Cache cache = getCache(); waitForManagerToRegisterListener(); RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE); for (int i = 1; i <= 15; i++) { rf.create("NotifTestRegion_" + i); } Region member1NotifRegion = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender1); assertEquals(0, member1NotifRegion.size()); } });
private Region<?,?> createParReg(String regionName, Cache cache, Class keyConstraint, Class valueConstraint ) { RegionFactory regionFactory = cache.createRegionFactory(); regionFactory.setDataPolicy(DataPolicy.PARTITION); regionFactory.setKeyConstraint(keyConstraint); regionFactory.setValueConstraint(valueConstraint); return regionFactory.create(regionName); }
@Override public void run() { Cache cache = getCache(new CacheFactory()); Region<Integer, Object> region = cache.<Integer, Object>createRegionFactory(RegionShortcut.PARTITION).create("test"); if (region == null) { getLogWriter().error("oops!"); } } };
/** * Creates a region and assigns a compressor. * @param name the region name. * @param dataPolicy the type of peer. * @param compressor a compressor. * @return the newly created region. */ private Region<String,String> createRegion(String name,DataPolicy dataPolicy,Compressor compressor) { return getCache().<String,String>createRegionFactory().setDataPolicy(dataPolicy).setCloningEnabled(true).setCompressor(compressor).create(name); }
public Object call() { RegionFactory f = getCache().createRegionFactory(getRegionAttributes()); CCRegion = (LocalRegion)f.create(name); return CCRegion.getDistributionManager().getDistributionManagerId(); } };
public void run() { Cache cache = getCache(); RegionFactory regionFactory = cache.createRegionFactory(); regionFactory.setDiskStoreName(regionName); regionFactory.setDiskSynchronous(true); regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); regionFactory.setScope(Scope.DISTRIBUTED_ACK); regionFactory.create(regionName); } });
public void run() { Cache cache = getCache(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setTotalNumBuckets(10); cache.createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create()).create("region"); } });
@Override public Object call() throws Exception { LocalRegion r = (LocalRegion)getCache().createRegionFactory( RegionShortcut.REPLICATE).create(regionName); r.put("key", "value"); return r.getRegionEntry("key").getVersionStamp().asVersionTag(); } });
public void run() { Cache cache = getCache(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setTotalNumBuckets(10); paf.setLocalMaxMemory(0); cache.createRegionFactory(RegionShortcut.PARTITION_PROXY) .setPartitionAttributes(paf.create()) .create("region"); }
public Object call() throws Exception { RegionFactory<Object, Object> rf = getCache().createRegionFactory(shortcut); if (!shortcut.equals(RegionShortcut.REPLICATE)) { rf.setPartitionAttributes(new PartitionAttributesFactory().setRedundantCopies(2).create()); } rf.create("region"); return null; } };
@Override public Object call() throws Exception { CacheFactory cf = new CacheFactory() .setPdxSerializer(new MyPdxSerializer()); Cache cache = getCache(cf); Region r = cache.createRegionFactory(RegionShortcut.REPLICATE).create("pdxtest"); r.put(1, new MyObjectPdx(1, "test", MyEnumPdx.const1)); return null; } };