Package org.radargun

Examples of org.radargun.DistStageAck


      return true;
   }

   protected DistStageAck errorResponse(String message) {
      log.error(message);
      return new DistStageAck(slaveState).error(message, null);
   }
View Full Code Here


      return new DistStageAck(slaveState).error(message, null);
   }

   protected DistStageAck errorResponse(String message, Exception e) {
      log.error(message, e);
      return new DistStageAck(slaveState).error(message, e);
   }
View Full Code Here

      log.error(message, e);
      return new DistStageAck(slaveState).error(message, e);
   }

   protected DistStageAck successfulResponse() {
      return new DistStageAck(slaveState);
   }
View Full Code Here

      this.slaveState = slaveState;
   }

   protected DistStageAck errorResponse(String message) {
      log.error(message);
      return new DistStageAck(slaveState).error(message, null);
   }
View Full Code Here

      return new DistStageAck(slaveState).error(message, null);
   }

   protected DistStageAck errorResponse(String message, Exception e) {
      log.error(message, e);
      return new DistStageAck(slaveState).error(message, e);
   }
View Full Code Here

      log.error(message, e);
      return new DistStageAck(slaveState).error(message, e);
   }

   protected DistStageAck successfulResponse() {
      return new DistStageAck(slaveState);
   }
View Full Code Here

      for (int i = 0; i < threads; ++i) {
         ClientThread ct = new ClientThread(i);
         clients.add(ct);
         ct.start();
      }
      DistStageAck ack = successfulResponse();
      for (ClientThread ct : clients) {
         try {
            ct.join();
            if (ct.exception != null) {
               ack = errorResponse("Exception in client thread", ct.exception);
View Full Code Here

      }
      for (int i = 0; i < 5; i++) {
         try {
            log.info("Before executing clear, memory looks like this: \n" + Utils.getMemoryInfo());
            if (shouldExecute()) {
               DistStageAck response = executeClear();
               if (response != null) return response;
               if (cacheInformation == null) return successfulResponse();
            } else {
               if (Boolean.FALSE.equals(local) || localBasicOperations == null) {
                  long size;
                  for (int count = new Random().nextInt(20) + 10; count > 0 && (size = cacheInformation.getCache(cacheName).getLocallyStoredSize()) > 0; --count) {
                     log.debug("Waiting until the cache gets empty (contains " + size + " entries)");
                     Thread.sleep(1000);
                  }
                  if ((size = cacheInformation.getCache(cacheName).getLocallyStoredSize()) > 0) {
                     log.error("The cache was not cleared from another node (contains " + size + " entries), clearing locally");
                     DistStageAck response = executeClear();
                     if (response != null) return response;
                     if (cacheInformation == null) return successfulResponse();
                  }
               }
            }
View Full Code Here

      try {
         Thread.sleep(duration);
      } catch (InterruptedException e) {
      }
      finished = true;
      DistStageAck error = checkThreads(threads);
      if (error != null) return error;
      return new ChangeAck(slaveState, valueChangeDetected);
   }
View Full Code Here

         Thread.sleep(duration);
      } catch (InterruptedException e) {
         log.warn("Sleep was interrupted");
      }
      finished = true;
      DistStageAck error = checkThreads(threadList);
      if (error != null) return error;
      try {
         Thread.sleep(30000);
      } catch (InterruptedException e) {
         log.warn("Sleep was interrupted");
View Full Code Here

TOP

Related Classes of org.radargun.DistStageAck

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.