public static PartitionedRegion getPartitionedRegion(String prName, Cache cache) { Region region = cache.getRegion(prName); if (region != null) { if (region instanceof PartitionedRegion) return (PartitionedRegion)region; } return null; }
/** * @throws com.gemstone.gemfire.cache.CacheRuntimeException if no cache created */ protected Region getRegion(DistributedSystem sys) { Cache cache = CacheFactory.getInstance(sys); return cache.getRegion(this.regionName); }
public void run2() throws CacheException { Region dsRegion = getCache().getRegion(WAN_REGION_NAME); for (int i = 0; i < entryCount; i++) { dsRegion.put(key+i, val+i, arg+i); } } };
public void run2() throws CacheException { Region dsRegion = getCache().getRegion(regionName); dsRegion.put(key, val, arg); } });
public void run() { Cache cache = getCache(); Region region = cache.getRegion("/region"); region.destroyRegion(); } };
public void run() { LocalRegion lr = (LocalRegion)getCache().getRegion(REGION_NAME); lr.localDestroyRegion(); } };
public Object call() { VersionTag tag = ((LocalRegion)getCache().getRegion(REGION_NAME)).getVersionTag(key); return tag; } };
public void run() { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion("partitioned"); BucketRegion br = region.getBucketRegion(bucketNumber); checkEventTracker(br, expectedEntryCount); } };
public Object call() throws Exception { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName); return new TreeSet<Integer>(region.getDataStore().getAllLocalBucketIds()); } };
public Object call() throws Exception { final Region r = getCache().getRegion(regionName); assertEquals("value", r.putIfAbsent("key0", "newValue")); assertTrue(r.containsKeyOnServer("key0")); assertTrue(r.containsKey("key0")); assertTrue(r.containsValueForKey("key0")); return null; } });
public void run() { DistributedRegion rr = (DistributedRegion)getCache().getRegion(REGION_NAME); rr.clear(); long region_version = getRegionVersionForMember(rr.getVersionVector(), memberID, false); long region_gc_version = getRegionVersionForMember(rr.getVersionVector(), memberID, true); assertEquals(regionVersionForThisOp, region_version); assertEquals(region_version, region_gc_version); } };
public static void putDelta() throws Exception { Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME); DeltaTestImpl test = new DeltaTestImpl(9999,NEW_STR); test.setIntVar(NEW_INT); r1.put("KEY",test); }
public Object call() throws Exception { final Region r = getCache().getRegion(regionName); assertTrue(r.containsKey("key0")); assertFalse(r.containsValueForKey("key0")); return null; } });
public void run() { Region rgn1 = getCache().getRegion(rgnName); assertEquals("val3", rgn1.getEntry("key3").getValue()); assertEquals("val4", rgn1.getEntry("key4").getValue()); } });
public Object call() throws Exception { final Region r = getCache().getRegion(regionName); assertNull(r.putIfAbsent("key0", "value")); assertTrue(r.containsKeyOnServer("key0")); Object v = r.get("key0"); assertNull("expected null but was "+v, v); return null; } });
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysRemoved(); } };
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysAdded(); } };
public void testPartitionedRegionAttributesForCoLocation2(){ closeCache(); setXmlFile(findFile("coLocation.xml")); Cache c = getCache(); assertNotNull(c); Region cust = c.getRegion(Region.SEPARATOR+"Customer"); assertNotNull(cust); Region order = c.getRegion(Region.SEPARATOR+"Order"); assertNotNull(order); assertTrue(cust.getAttributes().getPartitionAttributes().getColocatedWith()==null); assertTrue(order.getAttributes().getPartitionAttributes().getColocatedWith().equals("Customer")); }