Пример #1
0
 /** Signal that the membershipFailure is complete. */
 public static void signalMembershipFailureComplete() {
   Log.getLogWriter()
       .info(
           "ControllerBB: signaling membership failure complete for vmID "
               + RemoteTestModule.getMyVmid());
   String key = ControllerBB.MembershipFailureCompleteKey + RemoteTestModule.getMyVmid();
   ControllerBB.getBB().getSharedMap().put(key, new Long(System.currentTimeMillis()));
 }
Пример #2
0
 /**
  * Creates and initializes the singleton instance of CQTest in a client and start the CQs running.
  */
 public static synchronized void HydraTask_initializeClient() {
   if (testInstance == null) {
     testInstance = new CQKnownKeysTest();
     testInstance.initializeClient(true);
   }
   testInstance.uniqueKeyIndex.set(new Integer(RemoteTestModule.getCurrentThread().getThreadId()));
 }
Пример #3
0
 /** Creates and initializes a data store PR in a bridge server. */
 public static synchronized void HydraTask_initializeBridgeServer() {
   if (testInstance == null) {
     testInstance = new CQKnownKeysTest();
     testInstance.initializeRegion("serverRegion");
     testInstance.initializeInstance();
     BridgeHelper.startBridgeServer("bridge");
     testInstance.isBridgeClient = false;
   }
   testInstance.uniqueKeyIndex.set(new Integer(RemoteTestModule.getCurrentThread().getThreadId()));
 }
Пример #4
0
 /** Get the value of the shared map counter for this vm. */
 public static int getMapCounter(String keyBase) {
   String key = keyBase + RemoteTestModule.getMyVmid();
   Object value = ControllerBB.getBB().getSharedMap().get(key);
   if (value == null) {
     return 0;
   } else {
     int intVal = ((Integer) value).intValue();
     return intVal;
   }
 }
Пример #5
0
 /**
  * Create a region with the given region description name.
  *
  * @param regDescriptName The name of a region description.
  */
 protected void initializeRegion(String regDescriptName) {
   CacheHelper.createCache("cache1");
   String key = VmIDStr + RemoteTestModule.getMyVmid();
   String xmlFile = key + ".xml";
   try {
     CacheHelper.generateCacheXmlFile("cache1", regDescriptName, xmlFile);
   } catch (HydraRuntimeException e) {
     if (e.toString().indexOf("Cache XML file was already created") >= 0) {
       // this can occur when reinitializing after a stop-start because
       // the cache xml file is written during the first init tasks
     } else {
       throw new TestException(TestHelper.getStackTrace(e));
     }
   }
   aRegion = RegionHelper.createRegion(regDescriptName);
 }
Пример #6
0
 /**
  * Atomically increment a counter in the ControllerBB sharedMap.
  *
  * @param keyBase A string from ControllerBB that prefixes a vm id to use as a key in the
  *     ControllerBB shared map. The VM id used is the current vm's id.
  */
 public static void incMapCounter(String keyBase) {
   String key = keyBase + RemoteTestModule.getMyVmid();
   Log.getLogWriter().info("Incrementing sharedMap counter " + key);
   SharedLock slock = ControllerBB.getBB().getSharedLock();
   slock.lock();
   try {
     int newValue = 0;
     Object value = ControllerBB.getBB().getSharedMap().get(key);
     if (value == null) {
       newValue = 1;
     } else {
       newValue = ((Integer) value).intValue() + 1;
     }
     ControllerBB.getBB().getSharedMap().put(key, new Integer(newValue));
     Log.getLogWriter().info("Incremented sharedMap counter, count is now " + newValue);
   } finally {
     slock.unlock();
   }
 }
Пример #7
0
 /** Wait for the current vm to recognize a severe alert. */
 public static void waitForSevereAlert() {
   waitForSevereAlert(RemoteTestModule.getMyVmid());
 }
Пример #8
0
 /** Return whether the current vm has received a severe alert. */
 public static boolean receivedSevereAlert() {
   return receivedSevereAlert(RemoteTestModule.getMyVmid());
 }
Пример #9
0
 /** Signal that a severe alert occurred in the current vm. */
 public static void signalSevereAlert() {
   signalSevereAlert(RemoteTestModule.getMyVmid());
 }
Пример #10
0
 /** Wait for the current vm to become dead. */
 public static void waitForIsDead() {
   waitForIsDead(RemoteTestModule.getMyVmid());
 }
Пример #11
0
 /** Wait for the current vm to complete initialization */
 public static void waitForInitialization() {
   waitForInitialization(RemoteTestModule.getMyVmid());
 }
Пример #12
0
 /** Signal that this vm is ready for intialization. */
 public static void signalReadyForInit() {
   signalReadyForInit(RemoteTestModule.getMyVmid());
 }
Пример #13
0
 /** Wait for membership failure to complete. */
 public static void waitMembershipFailureComplete() {
   waitMembershipFailureComplete(RemoteTestModule.getMyVmid());
 }
Пример #14
0
 /** Enable sickness for the current vm */
 public static void enableSickness() {
   enableSickness(RemoteTestModule.getMyVmid());
 }
Пример #15
0
 /** Return whether membership failure is complete for this vm. */
 public static boolean isMembershipFailureComplete() {
   String key = ControllerBB.MembershipFailureCompleteKey + RemoteTestModule.getMyVmid();
   return ControllerBB.getBB().getSharedMap().containsKey(key);
 }
Пример #16
0
 /** Return the currentTimeMillis value of when membership failure completed */
 public static long getMembershipFailureCompletionTime() {
   String key = ControllerBB.MembershipFailureCompleteKey + RemoteTestModule.getMyVmid();
   return ((Long) (ControllerBB.getBB().getSharedMap().get(key))).longValue();
 }
Пример #17
0
 /** Return whether this vm is ready for initialization. */
 public static boolean isReadyForInit() {
   return isReadyForInit(RemoteTestModule.getMyVmid());
 }
Пример #18
0
 /** Enable slow listeners for the current vm */
 public static void enableSlowListener() {
   enableSlowListener(RemoteTestModule.getMyVmid());
 }
Пример #19
0
 /** Signal that the current vm is dead. */
 public static void signalIsDead() {
   signalIsDead(RemoteTestModule.getMyVmid());
 }
Пример #20
0
 /** Enable becoming dead for the current vm */
 public static void enablePlayDead() {
   enablePlayDead(RemoteTestModule.getMyVmid());
 }
Пример #21
0
 /** Signal that initialization for this VM is complete. */
 public static void signalInitIsComplete() {
   signalInitIsComplete(RemoteTestModule.getMyVmid());
 }
Пример #22
0
 /** Return whether the current vm is enabled for being dead. */
 public static boolean isPlayDeadEnabled() {
   String key = ControllerBB.EnableDeadKey + RemoteTestModule.getMyVmid();
   return ControllerBB.getBB().getSharedMap().containsKey(key);
 }
Пример #23
0
 /** Return whether slow listeners are enabled for the current vm. */
 public static boolean isSlowListenerEnabled() {
   String key = ControllerBB.EnableSlowListenerKey + RemoteTestModule.getMyVmid();
   return ControllerBB.getBB().getSharedMap().containsKey(key);
 }