paulwong

          Auto rebalance Storm

          http://stackoverflow.com/questions/15010420/storm-topology-rebalance-using-java-code


          使用Nimbus獲取STORM的信息
          http://www.andys-sundaypink.com/i/retrieve-storm-cluster-statistic-from-nimbus-java-mode/
          TSocket tsocket = new TSocket("localhost", 6627);
          TFramedTransport tTransport = new TFramedTransport(tsocket);
          TBinaryProtocol tBinaryProtocol = new TBinaryProtocol(tTransport);
          Nimbus.Client client = new Nimbus.Client(tBinaryProtocol);
          String topologyId = "test-1-234232567";


          try {

          tTransport.open();
          ClusterSummary clusterSummary = client.getClusterInfo();
          StormTopology stormTopology = client.getTopology(topologyId);
          TopologyInfo topologyInfo = client.getTopologyInfo(topologyId);
          List<ExecutorSummary> executorSummaries = topologyInfo.get_executors();

          List<TopologySummary> topologies = clusterSummary.get_topologies();
          for(ExecutorSummary executorSummary : executorSummaries){

          String id = executorSummary.get_component_id();
          ExecutorInfo executorInfo = executorSummary.get_executor_info();
          ExecutorStats executorStats = executorSummary.get_stats();
          System.out.println("executorSummary :: " + id + " emit size :: " + executorStats.get_emitted_size());
          }
          catch (TTransportException e) {
          e.printStackTrace();
          catch (TException e) {
          e.printStackTrace();
          catch (NotAliveException e) {
          e.printStackTrace();
          }




          posted on 2014-05-09 23:48 paulwong 閱讀(533) 評(píng)論(0)  編輯  收藏 所屬分類: STORM

          主站蜘蛛池模板: 平乡县| 河津市| 竹北市| 揭阳市| 沅陵县| 泰和县| 门头沟区| 新密市| 平遥县| 宿松县| 桃江县| 施秉县| 南木林县| 定州市| 怀柔区| 镇坪县| 北碚区| 昭通市| 桂平市| 什邡市| 寻乌县| 万安县| 黔南| 乐至县| 贵溪市| 图木舒克市| 平谷区| 邵阳县| 梅河口市| 疏勒县| 麻城市| 乌兰县| 安阳市| 开远市| 安吉县| 武功县| 新民市| 剑阁县| 柳州市| 靖边县| 那曲县|