Examples of TopologyInfo


Examples of backtype.storm.generated.TopologyInfo

      if(clusterName != null  && !(clusterName.equals(""))) {
        UIUtils.getClusterInfoByName(conf, clusterName);
      }
      client = NimbusClient.getConfiguredClient(conf);

      TopologyInfo summ = client.getClient().getTopologyInfo(topologyid);
      StormTopology topology = client.getClient().getTopology(topologyid);
      TopologyMetricInfo topologyMetricInfo = client.getClient().getTopologyMetric(topologyid);

      String type = UIUtils.componentType(topology, componentid);

      List<TaskSummary> ts = UIUtils.getTaskList(summ.get_tasks(),
          componentid);
     
      topologyName = summ.get_name();

      coms = getComponentSummaries(summ, ts);

      cts = getComponentTasks(ts, window);
View Full Code Here

Examples of org.infinispan.distribution.ch.TopologyInfo

            DataContainer dataContainer, DistributionManagerImpl dmi, InboundInvocationHandler inboundInvocationHandler,
            List<Address> newView, List<List<Address>> mergedGroups) {

      super(rpcManager, commandsFactory, conf, dataContainer, dmi, inboundInvocationHandler);

      TopologyInfo ti = buildTopologyInfo(newView);

      chNew = ConsistentHashHelper.createConsistentHash(configuration, newView, ti);

      if (mergedGroups.size() < 2) throw new IllegalArgumentException("Don't know how to handle a merge of " + mergedGroups.size() + " partitions!");
      if (mergedGroups.size() > 2) log.warn("Attempting to merge more than 2 partitions!  Inconsistencies may occur!  See https://issues.jboss.org/browse/ISPN-1001");

      List<Address> a1 = mergedGroups.get(0);
      List<Address> a2 = mergedGroups.get(1);

      TopologyInfo oldTopologyInfo = distributionManager.getTopologyInfo();
      if (!a1.contains(self)) chOld = createConsistentHash(configuration, a1, oldTopologyInfo);
      else if (!a2.contains(self)) chOld = createConsistentHash(configuration, a2, oldTopologyInfo);
      else throw new IllegalArgumentException("Neither of the merged partitions " +a1+ " and " + a2 + " contain " + self);
      distributionManager.setTopologyInfo(ti);
   }
View Full Code Here

Examples of org.infinispan.distribution.ch.TopologyInfo

   }

   @SuppressWarnings("unchecked")
   private TopologyInfo buildTopologyInfo(List<Address> newView) {
      if (configuration.getGlobalConfiguration().hasTopologyInfo()) {
         TopologyInfo oldTI = distributionManager.getTopologyInfo();
         // we are using topologies
         Set<Address> unknownAddresses = new HashSet<Address>();
         for (Address a: newView) {
            if (!oldTI.containsInfoForNode(a)) unknownAddresses.add(a);
         }

         if (!unknownAddresses.isEmpty()) {
            Collection<NodeTopologyInfo> moreTopologies = null;
            for (Address topologyProvider : unknownAddresses) {
               Map<Address, Response> r = rpcManager.invokeRemotely(Collections.singleton(topologyProvider), cf.buildRehashControlCommand(RehashControlCommand.Type.FETCH_TOPOLOGY_INFO, self), true, true);
               Response resp = r.get(topologyProvider);
               if (resp.isSuccessful() && resp.isValid()) {
                  // we have the response we need!
                  moreTopologies = (Collection<NodeTopologyInfo>) ((SuccessfulResponse) resp).getResponseValue();
                  break;
               }
            }

            if (moreTopologies == null) throw new CacheException("Unable to retrieve topology information for addresses " + unknownAddresses);
            return new TopologyInfo(oldTI, moreTopologies);
         }
         return oldTI;
      } else {
         // no topologies are used in this config
         return null;
View Full Code Here

Examples of org.infinispan.distribution.ch.TopologyInfo

            DataContainer dataContainer, DistributionManagerImpl dmi, InboundInvocationHandler inboundInvocationHandler,
            List<Address> newView, List<List<Address>> mergedGroups) {

      super(rpcManager, commandsFactory, conf, dataContainer, dmi, inboundInvocationHandler);

      TopologyInfo ti = buildTopologyInfo(newView);

      chNew = ConsistentHashHelper.createConsistentHash(configuration, newView, ti);

      if (mergedGroups.size() < 2) throw new IllegalArgumentException("Don't know how to handle a merge of " + mergedGroups.size() + " partitions!");
      if (mergedGroups.size() > 2) log.warn("Attempting to merge more than 2 partitions!  Inconsistencies may occur!  See https://issues.jboss.org/browse/ISPN-1001");

      List<Address> a1 = mergedGroups.get(0);
      List<Address> a2 = mergedGroups.get(1);

      TopologyInfo oldTopologyInfo = distributionManager.getTopologyInfo();
      if (!a1.contains(self)) chOld = createConsistentHash(configuration, a1, oldTopologyInfo);
      else if (!a2.contains(self)) chOld = createConsistentHash(configuration, a2, oldTopologyInfo);
      else throw new IllegalArgumentException("Both of the merged partitions " +a1+ " and " + a2 + " contains " + self);
      if (ti != null) distributionManager.setTopologyInfo(ti);
   }
View Full Code Here

Examples of org.infinispan.distribution.ch.TopologyInfo

   }

   @SuppressWarnings("unchecked")
   private TopologyInfo buildTopologyInfo(List<Address> newView) {
      if (configuration.getGlobalConfiguration().hasTopologyInfo()) {
         TopologyInfo oldTI = distributionManager.getTopologyInfo();
         // we are using topologies
         Set<Address> unknownAddresses = new HashSet<Address>();
         for (Address a: newView) {
            if (!oldTI.containsInfoForNode(a)) unknownAddresses.add(a);
         }

         if (!unknownAddresses.isEmpty()) {
            Collection<NodeTopologyInfo> moreTopologies = null;
            for (Address topologyProvider : unknownAddresses) {
               Map<Address, Response> r = rpcManager.invokeRemotely(Collections.singleton(topologyProvider), cf.buildRehashControlCommand(RehashControlCommand.Type.FETCH_TOPOLOGY_INFO, self), true, true);
               Response resp = r.get(topologyProvider);
               if (resp.isSuccessful() && resp.isValid()) {
                  // we have the response we need!
                  moreTopologies = (Collection<NodeTopologyInfo>) ((SuccessfulResponse) resp).getResponseValue();
                  break;
               }
            }

            if (moreTopologies == null) throw new CacheException("Unable to retrieve topology information for addresses " + unknownAddresses);
            return new TopologyInfo(oldTI, moreTopologies);
         }
         return oldTI;
      } else {
         // no topologies are used in this config
         return null;
View Full Code Here

Examples of org.infinispan.distribution.topologyaware.TopologyInfo

      protected TopologyLevel currentLevel = TopologyLevel.SITE;

      protected Builder(Hash hashFunction, int numOwners, int numSegments, List<Address> members, Map<Address, Float> capacityFactors) {
         super(hashFunction, numOwners, numSegments, members, capacityFactors);
         topologyInfo = new TopologyInfo(members, capacityFactors);
      }
View Full Code Here

Examples of org.infinispan.distribution.topologyaware.TopologyInfo

*/
public class TopologyAwareConsistentHashFactory extends DefaultConsistentHashFactory {

   @Override
   protected void addBackupOwners(Builder builder) {
      TopologyInfo topologyInfo = new TopologyInfo(builder.getMembers(), builder.getCapacityFactors());

      // 1. Remove extra owners (could be leftovers from addPrimaryOwners).
      // Don't worry about location information yet.
      removeExtraBackupOwners(builder);

View Full Code Here

Examples of org.infinispan.distribution.topologyaware.TopologyInfo

         List<Address> owners = builder.getOwners(segment);
         if (owners.size() >= builder.getActualNumOwners())
            continue;

         int maxDistinctLocations = topologyInfo.getDistinctLocationsCount(level, builder.getActualNumOwners());
         TopologyInfo ownersInfo = new TopologyInfo(owners, builder.getCapacityFactors());
         int distinctLocations = ownersInfo.getDistinctLocationsCount(level, builder.getActualNumOwners());
         if (distinctLocations == maxDistinctLocations)
            continue;

         float totalCapacity = topologyInfo.computeTotalCapacity(builder.getMembers(), builder.getCapacityFactors());
         for (Address candidate : builder.getMembers()) {
View Full Code Here

Examples of org.infinispan.distribution.topologyaware.TopologyInfo

      boolean sufficientLocations = true;
      // At this point each segment already has actualNumOwners owners.
      for (int segment = 0; segment < builder.getNumSegments(); segment++) {
         List<Address> owners = builder.getOwners(segment);
         int maxDistinctLocations = topologyInfo.getDistinctLocationsCount(level, builder.getActualNumOwners());
         TopologyInfo ownersInfo = new TopologyInfo(owners, builder.getCapacityFactors());
         int distinctLocations = ownersInfo.getDistinctLocationsCount(level, builder.getActualNumOwners());
         if (distinctLocations == maxDistinctLocations)
            continue;

         float totalCapacity = topologyInfo.computeTotalCapacity(builder.getMembers(), builder.getCapacityFactors());
         for (int i = owners.size() - 1; i >= 1; i--) {
View Full Code Here

Examples of org.infinispan.distribution.topologyaware.TopologyInfo

*/
public class TopologyAwareConsistentHashFactory extends DefaultConsistentHashFactory {

   @Override
   protected void addBackupOwners(Builder builder) {
      TopologyInfo topologyInfo = new TopologyInfo(builder.getMembers());
      int minSegments = builder.getActualNumOwners() * builder.getNumSegments() / builder.getNumNodes();

      // 1. Remove extra owners (could be leftovers from addPrimaryOwners).
      // Don't worry about location information yet.
      removeExtraBackupOwners(builder, minSegments);
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.