Package com.alibaba.jstorm.cluster

Examples of com.alibaba.jstorm.cluster.ClusterState


  @SuppressWarnings("rawtypes")
  private void init() throws Exception {

    NimbusClient client = null;
    ClusterState cluster_state = null;
    try {
      LOG.info("MainPage init...");
      Map conf = UIUtils.readUiConfig();
     
      if(clusterName != null && !(clusterName.equals(""))) {
        UIUtils.getClusterInfoByName(conf, clusterName);
      }
     
      client = NimbusClient.getConfiguredClient(conf);
      summ = client.getClient().getClusterInfo();

      tsumm = UIUtils.topologySummary(summ.get_topologies());
      csumm = UIUtils.clusterSummary(summ, client, conf);
      ssumm = UIUtils.supervisorSummary(summ.get_supervisors());

      cluster_state = ZkTool.mk_distributed_cluster_state(client
          .getConf());
      slaves = getNimbusSlave(cluster_state, conf);

      zkServers = getZkServer(conf);
      zkPort = String.valueOf(conf.get(Config.STORM_ZOOKEEPER_PORT));

    } catch (Exception e) {
      String errorInfo = e.getMessage();
      if (errorInfo.indexOf("No alive nimbus") == -1) {
          LOG.error("Failed to get cluster information:", e);
          throw e;
      }
    } finally {
      if (client != null) {
        client.close();
      }
      if (cluster_state != null) {
        cluster_state.close();
      }
    }
  }
View Full Code Here


  public BatchMetaSpout(MetaSpoutConfig metaSpoutConfig) {
    this.metaSpoutConfig = metaSpoutConfig;
  }
 
  public void initMetaClient() throws Exception {
    ClusterState zkClient = BatchCommon.getZkClient(conf);
    metaClient = new MetaSimpleClient(metaSpoutConfig, zkClient, taskIndex,
        taskParallel);

    metaClient.init();
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.cluster.ClusterState

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.