Package org.jboss.ha.framework.interfaces

Examples of org.jboss.ha.framework.interfaces.ClusterNode


            }
         }
        
         if (merge)
         {
            ClusterNode master = (ClusterNode) (newReplicants.size() > 0 ? newReplicants.get(0) : null);
            inSync = (master != null && oldView.contains(master));
         }
      }     
View Full Code Here


    * @return the discrepancy data. Will return <code>null</code> if no data
    *         for <code>node</code> is stored.
    */
   public TimestampDiscrepancy getTimestampDiscrepancy(String nodeName, boolean allowStatusCheck)
   {
      ClusterNode node = nodesByName.get(nodeName);
      return node == null ? null : getTimestampDiscrepancy(node, allowStatusCheck);
   }
View Full Code Here

      {
         try
         {
            DistributedReplicantManager drm = partition.getDistributedReplicantManager();
            List<ClusterNode> nodes = drm.lookupReplicantsNodes(getServiceHAName());
            ClusterNode coord = (nodes != null && nodes.size() > 0 ? nodes.get(0) : null);
            if (coord != null && coord.equals(partition.getClusterNode()) == false)
            {
               Object rsp = partition.callMethodOnNode(getServiceHAName(), "getDiscrepancies", NULL_ARGS, NULL_TYPES, 60000, coord);
               if (rsp instanceof RemoteDiscrepancies)
               {
                  handleRemoteDiscrepancies((RemoteDiscrepancies) rsp);
View Full Code Here

   /**
    * Handles a pushRemoteDiscrepancies call from a remote node.
    */
   private void handleRemoteDiscrepancies(RemoteDiscrepancies remote)
   {
      ClusterNode sender = remote.getSender();
      Map<Server, TimestampDiscrepancy> remoteDiscrepancies = remote.getDiscrepancies();
     
      synchronized (discrepancies)
      {
         TimestampDiscrepancy senderDiscrepancy = discrepancies.get(new Server(sender));
View Full Code Here

         if (discrepancies.get(key) == null)
         {
            // A node we didn't know about
            discrepancies.put(new Server(key, senderDiscrepancy),
                              new TimestampDiscrepancy(entry.getValue(), senderDiscrepancy));
            ClusterNode node = key.getNode();
            nodesByName.put(node.getName(), node);
         }
      }
   }
View Full Code Here

   public ClusterNode elect(List<ClusterNode> candidates)
   {
      int size = candidates.size();
      int remainder = ((this.mPosition % size) + size) % size;
      ClusterNode result = candidates.get(remainder);
      if (LOG.isDebugEnabled())
      {
         LOG.debug("election with " + size + " nodes and position=" +
            mPosition + ", will choose node[" +remainder+"] picked node ip=" +
            result.getIpAddress() + " port=" + result.getPort());
      }
      return result;
   }
View Full Code Here

      log.debug("RPCTestCase.startService() - " + rpcServiceName);
     
      if (partition == null)
         throw new IllegalStateException("RPCUser partition is null");

      ClusterNode me = partition.getClusterNode();
      ClusterNode[] nodes = partition.getClusterNodes();
      boolean isFirstNode = (nodes != null && nodes[0].equals(me));
     
      // register the service with the partition
      // note that "OneNode" services are only registered on the first node
View Full Code Here

      return this.partition == null ? null : this.partition.getPartitionName();
   }

   public String getLocalNodeName()
   {
      ClusterNode localNode = this.partition == null ? null : this.partition.getClusterNode();
      return localNode == null ? null : localNode.getName();
   }
View Full Code Here

{
   private final ClusterNodeFactory factory = new TestClusterNodeFactory();
   public void testFilterLogic()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      ClusterNode sender = factory.getClusterNode(new IpAddress(12345));
      exerciseFilterLogic(filter, sender);
   }
View Full Code Here

    * doesn't result in an incorrect answer.
    */
   public void testConcurrentResponses()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      ClusterNode sender1 = factory.getClusterNode(new IpAddress(12345));
      ClusterNode sender2 = factory.getClusterNode(new IpAddress(67890));
     
      filter.isAcceptable("A", sender1);
      filter.isAcceptable(null, sender2);
      assertFalse("Concurrency problem (JBAS-7945)",filter.needMoreResponses());
   }
View Full Code Here

TOP

Related Classes of org.jboss.ha.framework.interfaces.ClusterNode

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.