Examples of CacheViewControlCommand


Examples of org.infinispan.commands.control.CacheViewControlCommand

      cacheViewInfo.setListener(listener);
      handleRequestJoin(self, cacheName);

      // then ask the coordinator to join and use its existing cache view
      if (!isCoordinator) {
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.REQUEST_JOIN, self);
         // If we get a SuspectException we can ignore it, the new coordinator will come asking for our state anyway
         Map<Address,Response> rspList = transport.invokeRemotely(Collections.singleton(coordinator), cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
         checkRemoteResponse(cacheName, cmd, rspList);
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

         // update the local cache state
         handleRequestLeave(self, cacheName);

         // finally broadcast the leave request to all the members
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.REQUEST_LEAVE, self);
         // ignore any response from the other members
         transport.invokeRemotely(members, cmd, ResponseMode.ASYNCHRONOUS, timeout, false, null, false);
      } catch (Exception e) {
         log.debugf(e, "%s: Error while leaving cache view", cacheName);
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

   private CacheView clusterPrepareView(final String cacheName, final CacheView pendingView) throws Exception {
      final CacheViewInfo cacheViewInfo = viewsInfo.get(cacheName);
      final CacheView committedView = cacheViewInfo.getCommittedView();
      log.tracef("%s: Preparing view %d on members %s", cacheName, pendingView.getViewId(), pendingView.getMembers());

      final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
            CacheViewControlCommand.Type.PREPARE_VIEW, self, pendingView.getViewId(),
            pendingView.getMembers(), committedView.getViewId(), committedView.getMembers());

      Set<Address> leavers = cacheViewInfo.getPendingChanges().getLeavers();
      if (pendingView.containsAny(leavers))
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

      log.tracef("%s: Rolling back to cache view %d on members %s, new view id is %d", cacheName, committedViewId, validTargets, newViewId);

      try {
         // it's ok to send the rollback to nodes that don't have the cache yet, they will just ignore it
         // on the other hand we *have* to send the rollback to any nodes that got the prepare
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.ROLLBACK_VIEW, self, newViewId, null, committedViewId, null);
         // wait until we get all the responses, but ignore the results
         Map<Address, Response> rspList = transport.invokeRemotely(validTargets, cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
         checkRemoteResponse(cacheName, cmd, rspList);
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

      validTargets.removeAll(cacheViewInfo.getPendingChanges().getLeavers());
      log.tracef("%s: Committing cache view %d on members %s", cacheName, viewId, targets);

      try {
         // broadcast the command to all the members
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.COMMIT_VIEW, self, viewId);
         // wait until we get all the responses, but ignore the results
         Map<Address, Response> rspList = transport.invokeRemotely(validTargets, cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null, false);
         checkRemoteResponse(cacheName, cmd, rspList);
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

         recoveryInfo = new HashMap<Address, Map<String, CacheView>>();
         // first get the local views
         recoveryInfo.put(self, handleRecoverViews());

         // then broadcast the recover command to all the members
         CacheViewControlCommand cmd = new CacheViewControlCommand(
               DUMMY_CACHE_NAME_FOR_GLOBAL_COMMANDS, CacheViewControlCommand.Type.RECOVER_VIEW, self);
         Map<Address, Response> rspList = transport.invokeRemotely(null, cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, true, null, false);
         checkRemoteResponse(null, cmd, rspList);
         for (Map.Entry<Address, Response> e : rspList.entrySet()) {
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

               break;
            case CompleteTransactionCommand.COMMAND_ID:
               command = new CompleteTransactionCommand(cacheName);
               break;
            case CacheViewControlCommand.COMMAND_ID:
               command = new CacheViewControlCommand(cacheName);
               break;                     
            default:
               throw new CacheException("Unknown command id " + id + "!");
         }
      } else {
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

      cacheViewInfo.setListener(listener);
      handleRequestJoin(self, cacheName);

      // then ask the coordinator to join and use its existing cache view
      if (!isCoordinator) {
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.REQUEST_JOIN, self);
         // If we get a SuspectException we can ignore it, the new coordinator will come asking for our state anyway
         Map<Address,Response> rspList = transport.invokeRemotely(Collections.singleton(coordinator), cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null);
         checkRemoteResponse(cacheName, cmd, rspList);
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

         // update the local cache state
         handleRequestLeave(self, cacheName);

         // finally broadcast the leave request to all the members
         final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
               CacheViewControlCommand.Type.REQUEST_LEAVE, self);
         // ignore any response from the other members
         // still, the call has to be synchronous or the externalizer table might stop before we serialize the command
         transport.invokeRemotely(members, cmd, ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, false, null);
      } catch (Exception e) {
View Full Code Here

Examples of org.infinispan.commands.control.CacheViewControlCommand

   private CacheView clusterPrepareView(final String cacheName, final CacheView pendingView) throws Exception {
      final CacheViewInfo cacheViewInfo = viewsInfo.get(cacheName);
      final CacheView committedView = cacheViewInfo.getCommittedView();
      log.tracef("%s: Preparing view %d on members %s", cacheName, pendingView.getViewId(), pendingView.getMembers());

      final CacheViewControlCommand cmd = new CacheViewControlCommand(cacheName,
            CacheViewControlCommand.Type.PREPARE_VIEW, self, pendingView.getViewId(),
            pendingView.getMembers(), committedView.getViewId(), committedView.getMembers());

      Set<Address> leavers = cacheViewInfo.getPendingChanges().getLeavers();
      if (pendingView.containsAny(leavers))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.