Package backtype.storm.generated

Examples of backtype.storm.generated.ClusterSummary


  public static void writeStormStats(Map conf) {
    final Client client = getNimbusStub(conf);
    final StringBuilder sb = new StringBuilder("");

    try {
      final ClusterSummary clusterInfo = client.getClusterInfo();
      final int numOfTopologies = clusterInfo.get_topologies_size();
      sb.append("In total there is ").append(numOfTopologies).append(" topologies.\n");

      final Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
      while (topologyIter.hasNext()) {
        final TopologySummary topologySummary = topologyIter.next();

        // print out basic information about topologies
        final String topologyName = topologySummary.get_name();
View Full Code Here


    }
   
    private static TopologySummary getTopologySummary(Client client) {
        TopologySummary topologySummary = null;
        try {
            ClusterSummary clusterInfo = client.getClusterInfo();
            int numOfTopologies = clusterInfo.get_topologies_size();
            if(numOfTopologies > 1){
                throw new RuntimeException("For multiple topologies in the cluster, statistics would not be gathered correctly.");
            }

            topologySummary = clusterInfo.get_topologies().get(0);
        }catch (TException ex) {
            ex.printStackTrace();
        }
        return topologySummary;
    }   
View Full Code Here

    public static String writeTopologyInfo(){
        Client client=getNimbusStub();
        StringBuilder sb=new StringBuilder("");

        try {
            ClusterSummary clusterInfo = client.getClusterInfo();
            int numOfTopologies = clusterInfo.get_topologies_size();
            sb.append("In total there is ").append(numOfTopologies).append(" topologies.\n");

            Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
            while(topologyIter.hasNext()){
                TopologySummary topologySummary= topologyIter.next();

                //print out basic information about topologies
                String topologyName = topologySummary.get_name();
View Full Code Here

    }
    
    private static int topDone(String topName){
        Client client=getNimbusStub();
        try {
            ClusterSummary clusterInfo = client.getClusterInfo();
            Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
            while(topologyIter.hasNext()){
                TopologySummary topologySummary= topologyIter.next();
                String topologyName = topologySummary.get_name();
                if (topologyName.equals(topName)){
                  String status = topologySummary.get_status();
View Full Code Here

        topologySummaries.add(new TopologySummary(stormId, base.getStormName(), assignment.getTaskToNodeport().size(),
            workers.size(), TimeUtils.time_delta(base
                .getLanchTimeSecs()), extractStatusStr(base)));
      }
    }
    return new ClusterSummary(supervisorSummaries, uptime,topologySummaries);
  }
View Full Code Here

    }

    private static boolean topologyNameExists(Map conf, String name) {
        NimbusClient client = NimbusClient.getConfiguredClient(conf);
        try {
            ClusterSummary summary = client.getClient().getClusterInfo();
            for(TopologySummary s : summary.get_topologies()) {
                if(s.get_name().equals(name)) { 
                    return true;
                }
            } 
            return false;
View Full Code Here

      now = System.currentTimeMillis();
    } while (now < end);
  }

  public boolean metrics(Nimbus.Client client, int size, long now, MetricsState state, String message) throws Exception {
    ClusterSummary summary = client.getClusterInfo();
    long time = now - state.lastTime;
    state.lastTime = now;
    int numSupervisors = summary.get_supervisors_size();
    int totalSlots = 0;
    int totalUsedSlots = 0;
    for (SupervisorSummary sup: summary.get_supervisors()) {
      totalSlots += sup.get_num_workers();
      totalUsedSlots += sup.get_num_used_workers();
    }
    int slotsUsedDiff = totalUsedSlots - state.slotsUsed;
    state.slotsUsed = totalUsedSlots;

    int numTopologies = summary.get_topologies_size();
    long totalTransferred = 0;
    int totalExecutors = 0;
    int executorsWithMetrics = 0;
    for (TopologySummary ts: summary.get_topologies()) {
      String id = ts.get_id();
      TopologyInfo info = client.getTopologyInfo(id);
      for (ExecutorSummary es: info.get_executors()) {
        ExecutorStats stats = es.get_stats();
        totalExecutors++;
View Full Code Here

    }

    private static boolean topologyNameExists(Map conf, String name) {
        NimbusClient client = NimbusClient.getConfiguredClient(conf);
        try {
            ClusterSummary summary = client.getClient().getClusterInfo();
            for(TopologySummary s : summary.get_topologies()) {
                if(s.get_name().equals(name)) { 
                    return true;
                }
            } 
            return false;
View Full Code Here

            sleep(30000);

            if (new File(storm_home+"/storm.yaml").exists()) {
                Map storm_conf = Config.readStormConfig(storm_home+"/storm.yaml");
                Nimbus.Client nimbus_client = NimbusClient.getConfiguredClient(storm_conf).getClient();
                ClusterSummary cluster_summary = nimbus_client.getClusterInfo();
                TopologySummary topology_summary = cluster_summary.get_topologies().get(0);
                Assert.assertEquals("ACTIVE", topology_summary.get_status());
            }

            cmd = java.util.Arrays.asList(storm_home+"/bin/storm",
                    "kill",
View Full Code Here

  }

  private static boolean topologyNameExists(Map conf, String name) {
    NimbusClient client = NimbusClient.getConfiguredClient(conf);
    try {
      ClusterSummary summary = client.getClient().getClusterInfo();
      for (TopologySummary s : summary.get_topologies()) {
        if (s.get_name().equals(name)) {
          return true;
        }
      }
      return false;
View Full Code Here

TOP

Related Classes of backtype.storm.generated.ClusterSummary

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.