Package org.infinispan.remoting.transport

Examples of org.infinispan.remoting.transport.Transport


   }

   private void join() throws Exception {
      startLatch.close();
      setJoinComplete(false);
      Transport t = rpcManager.getTransport();
      List<Address> members = t.getMembers();
      consistentHash = createConsistentHash(configuration, members, topologyInfo);
      self = t.getAddress();
      if (members.size() > 1 && !t.getCoordinator().equals(self)) {
         JoinTask joinTask = new JoinTask(rpcManager, cf, configuration, dataContainer, this);
         joinFuture = rehashExecutor.submit(joinTask);
         //task will set joinComplete flag
      } else {
         setJoinComplete(true);
View Full Code Here


   @Start(priority = 20)
   private void join() throws Exception {
      if (trace) log.trace("starting distribution manager on " + getMyAddress());
      notifier.addListener(listener);

      Transport t = rpcManager.getTransport();
      List<Address> members = t.getMembers();
      self = t.getAddress();
      lastViewId = t.getViewId();
      consistentHash = ConsistentHashHelper.createConsistentHash(configuration, members);
      lastSuccessfulCH = ConsistentHashHelper.createConsistentHash(configuration, members);

      // in case we are/become the coordinator, make sure we're in the push confirmations map before anyone else
      synchronized (pushConfirmations) {
         pushConfirmations.put(t.getAddress(), -1);
      }

      // allow incoming requests
      joinStartedLatch.countDown();

      // nothing to push, but we need to inform the coordinator that we have finished our push
      notifyCoordinatorPushCompleted(t.getViewId());
   }
View Full Code Here

         markRehashCompleted(viewId);
      }
   }

   public void notifyCoordinatorPushCompleted(int viewId) throws InterruptedException {
      Transport t = rpcManager.getTransport();

      if (t.isCoordinator()) {
         if (trace) log.tracef("Node %s is the coordinator, marking push for %d as complete directly", self, viewId);
         markNodePushCompleted(viewId, self);
      } else {
         final RehashControlCommand cmd = cf.buildRehashControlCommand(RehashControlCommand.Type.NODE_PUSH_COMPLETED, self, viewId);
         Address coordinator = rpcManager.getTransport().getCoordinator();
View Full Code Here

   @Override
   public void removeCache(String cacheName) {
      RemoveCacheCommand cmd = new RemoveCacheCommand(this, globalComponentRegistry);
      cmd.injectComponents(null, globalComponentRegistry.getNamedComponentRegistry(cacheName));
      cmd.setCacheName(cacheName);
      Transport transport = getTransport();
      try {
         if (transport != null) {
            Configuration c = getConfiguration(cacheName);
            // Use sync replication timeout
            transport.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, c.getSyncReplTimeout(), false, null, false);
         }
         // Once sent to the cluster, remove the local cache
         cmd.perform(null);
      } catch (Throwable t) {
         throw new CacheException("Error removing cache", t);
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public List<Address> getMembers() {
      Transport t = getTransport();
      return t == null ? null : t.getMembers();
   }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public Address getAddress() {
      Transport t = getTransport();
      return t == null ? null : t.getAddress();
   }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public Address getCoordinator() {
      Transport t = getTransport();
      return t == null ? null : t.getCoordinator();
   }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public boolean isCoordinator() {
      Transport t = getTransport();
      return t != null && t.isCoordinator();
   }
View Full Code Here

   }

   @ManagedAttribute(description = "The physical network addresses associated with this instance")
   @Metric(displayName = "Physical network addresses", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
   public String getPhysicalAddresses() {
      Transport t = getTransport();
      if (t == null) return "local";
      List<Address> address = t.getPhysicalAddresses();
      return address == null ? "local" : address.toString();
   }
View Full Code Here

   }

   @ManagedAttribute(description = "List of members in the cluster")
   @Metric(displayName = "Cluster members", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
   public String getClusterMembers() {
      Transport t = getTransport();
      if (t == null) return "local";
      List<Address> addressList = t.getMembers();
      return addressList.toString();
   }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.transport.Transport

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.