Examples of RingToken


Examples of org.jgroups.protocols.ring.RingToken

          callRemoteMethods(m, "installTransitionalView", new Object[]{m}, new String[]{Vector.class.getName()},
                            GroupRequest.GET_ALL, 0);
         //callRemoteMethods(m, "installTransitionalView", m, GroupRequest.GET_ALL, 0);

         Vector xmits = prepareRecoveryRetransmissionList(myAllReceivedUpTos);
         RingToken injectToken = null;
         if (xmits.size() > 1)
         {

             if(log.isInfoEnabled()) log.info("VS not satisfied, injecting recovery token...");
             long aru = ((Long) xmits.firstElement()).longValue();
            long highest = ((Long) xmits.lastElement()).longValue();

            injectToken = new RingToken(RingToken.RECOVERY);
            injectToken.setHighestSequence(highest);
            injectToken.setAllReceivedUpto(aru);


            Collection rtr = injectToken.getRetransmissionRequests();
            rtr.addAll(xmits);
         }
         else
         {

             if(log.isInfoEnabled()) log.info("VS satisfied, injecting operational token...");
             injectToken = new RingToken();
            long sequence = ((Long) xmits.firstElement()).longValue();
            injectToken.setHighestSequence(sequence);
            injectToken.setAllReceivedUpto(sequence);
         }
          if(node != null)
              node.passToken(injectToken);
         tokenRetransmitter.resetTimeout();
      }
View Full Code Here

Examples of org.jgroups.protocols.ring.RingToken

      if (memberSize == 1 && isCoordinator && !tokenCirculating)
      {
         //create token for the first time , lets roll
         tokenCirculating = true;
         RingToken token = new RingToken();
          if(node != null)
              node.passToken(token);
         tokenRetransmitter.resetTimeout();
      }
      sleepTime = (20/memberSize);
View Full Code Here

Examples of org.jgroups.protocols.ring.RingToken

      public void run()
      {
         while (running)
         {
            RingToken token = null;
            int timeout = 0;

             if(node == null) {
                 // sleep some time, then retry
                 Util.sleep(500);
                 continue;
             }

            try
            {
               timeout = (int) getTimeout();

                  if(log.isInfoEnabled()) log.info("timeout(ms)=" + timeout);

               token = (RingToken) node.receiveToken(timeout);

               if (token.getType() == RingToken.OPERATIONAL &&
                       state == RECOVERY_STATE)
               {
                  state = OPERATIONAL_STATE;
               }

               tokenReceived(token);
               recalculateTimeout();

               if (token.getType() == RingToken.RECOVERY &&
                       isRecoveryCompleted(token))
               {

                     if(log.isInfoEnabled()) log.info("all members recovered, injecting operational token");
                  token.setType(RingToken.OPERATIONAL);
               }
               node.passToken(token);
               resetTimeout();
            }
            catch (TokenLostException tle)
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.