public void run() { try{Thread.sleep(3*1000);}catch(InterruptedException ex){fail("interrupted");} mirroredRegion.clear(); assertEquals(0, mirroredRegion.size()); } });
public static void checkSize(){ getLogWriter().info( "Partitioned Region " + regionName + " Have size :" + region.size()); }
public void run2() { Cache cache = getCache(); for (int j = 0; j < MAX_REGIONS; j++) { Region pr = cache.getRegion(Region.SEPARATOR + PR_PREFIX + "DistAckSync" + j); assertNotNull(pr); assertEquals("size not matching=", cnt, pr.size()); } } });
public Object call() throws CacheException { Region region = getRootRegion().getSubregion(regionName); assertEquals(numberOfEntries*2, region.size()); List<VersionTag> versions = new ArrayList<VersionTag>(numberOfEntries*2); RegionMap entries = ((LocalRegion) region).entries; for (Object key : entries.keySet()) { RegionEntry internalRegionEntry = entries.getEntry(key); versions.add(internalRegionEntry.getVersionStamp().asVersionTag()); } return versions; } });
public void beforeRegionClear(RegionEvent event) { logCall("beforeRegionClear", event); // Ensure region still accessible final Region region = event.getRegion(); try { region.size(); } catch (Exception e) { throwException("TestWriter: beforeRegionClear() caught " + e + " during beforeRegionClear"); } }
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()); } });
public static void PutRegionSizeOnBB() { Cache cache = CacheHelper.getCache(); if (cache == null) { Log.getLogWriter().info("Not the right VM"); } else { Region aRegion = RegionHelper.getRegion(REGION_NAME); int regionSize = aRegion.size(); Log.getLogWriter().info("PutRegionSizeonBB()- Region size : " + aRegion.size()); //Put the regionsize on the blackboard TargetBB.getBB().getSharedMap().put("regionSize", new Integer(regionSize)); } }
/** Task to verify that the region recovered data from disk (it's size is not 0) */ public static void HydraTask_verifyRegion() { int size = aRegion.size(); Log.getLogWriter().info(aRegion.getFullPath() + " is size " + size); if (aRegion.size() == 0) { throw new TestException("Expected region size to be > 0, but it is " + size); } verifyFromSnapshot(aRegion, (Map) SplitBrainBB.getBB().getSharedMap().get(SNAPSHOT_KEY)); }
public void run2() throws CacheException { Region region = getRootRegion().getSubregion(regionName); region.getAttributesMutator().addCacheListener(new MyListener(false)); doPutAll(regionName, "key-", numberOfEntries); assertEquals(numberOfEntries, region.size()); } });
public void testOverflowOnlyAndThenPeristAndOverflow(){ createOverflowOnly(); put100Int(); region.close(); createPersistAndOverflow(); assertTrue(region.size()==0); }
/** Log the size of each root region * */ private static void logRegionSizes() { for (Region aRegion: CacheHelper.getCache().rootRegions()) { Log.getLogWriter().info("Region " + aRegion.getFullPath() + " is size " + aRegion.size()); } }
/** Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES * which is equivalent to a full GII. * * @param aRegion The region to register interest on. */ protected static void registerInterest(Region aRegion) { Log.getLogWriter().info("Calling registerInterest for all keys, result interest policy KEYS_VALUES"); aRegion.registerInterest("ALL_KEYS", InterestResultPolicy.KEYS_VALUES); Log.getLogWriter().info("Done calling registerInterest for all keys, " + "result interest policy KEYS_VALUES, " + aRegion.getFullPath() + " size is " + aRegion.size()); }
/** Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES * which is equivalent to a full GII. * * @param aRegion The region to register interest on. */ public static void registerInterest(Region aRegion) { Log.getLogWriter().info("Calling registerInterest for all keys, result interest policy KEYS_VALUES"); aRegion.registerInterest("ALL_KEYS", InterestResultPolicy.KEYS_VALUES); Log.getLogWriter().info("Done calling registerInterest for all keys, " + "result interest policy KEYS_VALUES, " + aRegion.getFullPath() + " size is " + aRegion.size()); }
/** Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES * which is equivalent to a full GII. * * @param aRegion The region to register interest on. */ protected static void registerInterest(Region aRegion) { Log.getLogWriter().info("Calling registerInterest for all keys, result interest policy KEYS_VALUES"); aRegion.registerInterest("ALL_KEYS", InterestResultPolicy.KEYS_VALUES); Log.getLogWriter().info("Done calling registerInterest for all keys, " + "result interest policy KEYS_VALUES, " + aRegion.getFullPath() + " size is " + aRegion.size()); }
/** * Test on Replicated Region data */ public void testQueriesOnReplicatedRegionWithSameProjAttr() throws Exception { Cache cache = CacheUtils.getCache(); createReplicatedRegion(); assertNotNull(cache.getRegion(regionName)); assertEquals(numElem * 2, cache.getRegion(regionName).size()); executeQueryTest(cache, projectionQueries, toDateExpectedResults); }
protected void sizeOfRegion() { try { int i = region.size(); Log.getLogWriter().info("----size of region is " + i); MapBB.incrementCounter("MapBB.NUM_SIZE", MapBB.NUM_SIZE); } catch (RegionDestroyedException rdex) { Log.getLogWriter().info("RegionDestroyedException...may occur in concurrent environment. Continuing with test."); recoverRegion(); } catch (Exception ex) { throw new TestException(TestHelper.getStackTrace(ex)); } }//end of sizeOfRegion
private void initialize(Region region) { setNumberOfEntries(region.size()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { LocalRegion lr = (LocalRegion) region; LRUStatistics stats = ((AbstractLRURegionMap) lr.getRegionMap())._getLruList().stats(); setHeapSize(stats.getCounter()); } else { setHeapSize(-1); } }
public static long getVersionTimestampAfterOp() { Region region = cache.getRegion("repRegion"); assertEquals(1, region.size()); region.destroy("testKey"); Region.Entry entry = ((LocalRegion)region).getEntry("testKey", null, true); RegionEntry re = ((EntrySnapshot)entry).getRegionEntry(); getLogWriter().fine("RegionEntry for testKey: " + re.getKey() + " " + re.getValueInVM((LocalRegion) region)); assertTrue(re.getValueInVM((LocalRegion) region) instanceof Tombstone); VersionTag tag = re.getVersionStamp().asVersionTag(); return tag.getVersionTimeStamp(); }