Ejemplo n.º 1
0
 /**
  * Locally destroy a key in region REGION_NAME. The keys to locally destroy are specified in
  * keyIntervals.
  *
  * @return true if all keys to be locally destroyed have been completed.
  */
 protected boolean localDestroy() {
   SharedCounters sc = CQUtilBB.getBB().getSharedCounters();
   long nextKey = sc.incrementAndRead(CQUtilBB.LASTKEY_LOCAL_DESTROY);
   if (!keyIntervals.keyInRange(KeyIntervals.LOCAL_DESTROY, nextKey)) {
     Log.getLogWriter().info("All local destroys completed; returning from localDestroy");
     return true;
   }
   Object key = NameFactory.getObjectNameForCounter(nextKey);
   Log.getLogWriter().info("Locally destroying " + key);
   checkContainsValueForKey(key, true, "before localDestroy");
   try {
     aRegion.localDestroy(key);
     Log.getLogWriter()
         .info(
             "Done locally destroying "
                 + key
                 + ", num remaining: "
                 + (keyIntervals.getLastKey(KeyIntervals.LOCAL_DESTROY) - nextKey));
   } catch (EntryNotFoundException e) {
     throw new TestException(TestHelper.getStackTrace(e));
   }
   return (nextKey >= keyIntervals.getLastKey(KeyIntervals.LOCAL_DESTROY));
 }