Examples of ClusterNode


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

   /**
    * 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

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

         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

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

   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

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

      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

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

      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

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

{
   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

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

    * 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

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

   public void testUsePreferredMasterViaHost()
   {
      this.policy.setPreferredMaster("localhost:10001");
     
      ClusterNode master = this.policy.elect(this.candidates);
     
      Assert.assertSame(this.candidates.get(1), master);
   }
View Full Code Here

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

     if (System.getProperty("java.net.preferIPv4Stack").equals("true"))
       hostport = "127.0.0.1:10002" ;
    
      this.policy.setPreferredMaster(hostport);
     
      ClusterNode master = this.policy.elect(this.candidates);
     
      Assert.assertSame(this.candidates.get(2), master);
   }
View Full Code Here

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

  
   public void testUseDefaultMaster()
   {
      this.policy.setPreferredMaster("localhost:10003");
     
      ClusterNode master = this.policy.elect(this.candidates);
     
      Assert.assertSame(this.candidates.get(0), master);
     
      this.policy.setPosition(1);
     
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.