Esempio n. 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()));
 }
 /**
  * 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()));
 }
 /** 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()));
 }
Esempio n. 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;
   }
 }
 /**
  * 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);
 }
Esempio n. 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();
   }
 }
Esempio n. 7
0
 /** Wait for the current vm to recognize a severe alert. */
 public static void waitForSevereAlert() {
   waitForSevereAlert(RemoteTestModule.getMyVmid());
 }
Esempio n. 8
0
 /** Return whether the current vm has received a severe alert. */
 public static boolean receivedSevereAlert() {
   return receivedSevereAlert(RemoteTestModule.getMyVmid());
 }
Esempio n. 9
0
 /** Signal that a severe alert occurred in the current vm. */
 public static void signalSevereAlert() {
   signalSevereAlert(RemoteTestModule.getMyVmid());
 }
Esempio n. 10
0
 /** Wait for the current vm to become dead. */
 public static void waitForIsDead() {
   waitForIsDead(RemoteTestModule.getMyVmid());
 }
Esempio n. 11
0
 /** Wait for the current vm to complete initialization */
 public static void waitForInitialization() {
   waitForInitialization(RemoteTestModule.getMyVmid());
 }
Esempio n. 12
0
 /** Signal that this vm is ready for intialization. */
 public static void signalReadyForInit() {
   signalReadyForInit(RemoteTestModule.getMyVmid());
 }
Esempio n. 13
0
 /** Wait for membership failure to complete. */
 public static void waitMembershipFailureComplete() {
   waitMembershipFailureComplete(RemoteTestModule.getMyVmid());
 }
Esempio n. 14
0
 /** Enable sickness for the current vm */
 public static void enableSickness() {
   enableSickness(RemoteTestModule.getMyVmid());
 }
Esempio n. 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);
 }
Esempio n. 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();
 }
Esempio n. 17
0
 /** Return whether this vm is ready for initialization. */
 public static boolean isReadyForInit() {
   return isReadyForInit(RemoteTestModule.getMyVmid());
 }
Esempio n. 18
0
 /** Enable slow listeners for the current vm */
 public static void enableSlowListener() {
   enableSlowListener(RemoteTestModule.getMyVmid());
 }
Esempio n. 19
0
 /** Signal that the current vm is dead. */
 public static void signalIsDead() {
   signalIsDead(RemoteTestModule.getMyVmid());
 }
Esempio n. 20
0
 /** Enable becoming dead for the current vm */
 public static void enablePlayDead() {
   enablePlayDead(RemoteTestModule.getMyVmid());
 }
Esempio n. 21
0
 /** Signal that initialization for this VM is complete. */
 public static void signalInitIsComplete() {
   signalInitIsComplete(RemoteTestModule.getMyVmid());
 }
Esempio n. 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);
 }
Esempio n. 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);
 }