Package com.alipay.bluewhale.core.cluster

Examples of com.alipay.bluewhale.core.cluster.StormBase


        system_events=new ArrayList<String>();
        system_events.add(StatusType.startup.getStatus());
        system_events.add(StatusType.monitor.getStatus());
      }
      //��ȡָ��topology��Ӧ��״̬����
      StormBase stormbase = data.getStormClusterState().storm_base(topologyid, null);
      StormStatus topologyStatus=null;
      if (stormbase != null){
          topologyStatus = stormbase.getStatus();
      }
      if (topologyStatus != null) {
       
        //if(rtn==null){
          //����ÿ�λ�ȡ����״̬ת������
View Full Code Here


    Set<Entry<String, StormBase>> basesEntry = bases.entrySet();
    for (Iterator<Entry<String, StormBase>> it = basesEntry.iterator(); it.hasNext();) {
      Entry<String, StormBase> entry = it.next();
      String stormId = entry.getKey();
      StormBase base = entry.getValue();
      Assignment assignment = stormClusterState.assignment_info(stormId,null);
      if (assignment != null) {
        HashSet<NodePort> workers = new HashSet<NodePort>();
        Collection<NodePort> entryColl = assignment.getTaskToNodeport().values();
        workers.addAll(entryColl);
        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

   
    //���topology��������Ϣ�� ����ID �� componentid
    HashMap<Integer, String> taskInfo = Common.topology_task_info(stormClusterState, topologyId);// <taskid,componentid>
   
    //���topology��name������ʱ���״̬
    StormBase base = stormClusterState.storm_base(topologyId, null);
   
    //���topology�����������Ϣ
    Assignment assignment = stormClusterState.assignment_info(topologyId,null);
   
    if (base != null && assignment != null) {
      List<TaskSummary> taskSummarys = new ArrayList<TaskSummary>();
      Set<Entry<Integer, String>> taskInfoSet = taskInfo.entrySet();
      for (Iterator<Entry<Integer, String>> it = taskInfoSet.iterator(); it.hasNext();) {
        Entry<Integer, String> entry =  it.next();
        Integer taskId =  entry.getKey();
        String componentId =  entry.getValue();
        NodePort np = (NodePort) assignment.getTaskToNodeport().get(taskId);
        //���ָ��task��������Ϣ
        TaskHeartbeat heartbeat = stormClusterState.task_heartbeat(topologyId, taskId);
        if (np == null || heartbeat == null) {
          continue;
        }
        String host = (String) assignment.getNodeHost().get(np.getNode());
        List<TaskError> errors = stormClusterState.task_errors(topologyId, taskId);
        List<ErrorInfo> newErrors = new ArrayList<ErrorInfo>();

        if (errors != null) {
          int size = errors.size();
          for (int i = 0; i < size; i++) {
            TaskError e = (TaskError) errors.get(i);
            newErrors.add(new ErrorInfo(e.getError(), e.getTimSecs()));
          }
        }
        BaseStatsData status = (BaseStatsData) heartbeat.getStats();
        TaskStats tkStatus = status.getTaskStats();
        int uptimeSecs = heartbeat.getUptimeSecs();
        TaskSummary taskSummary = new TaskSummary(taskId, componentId,
            host, np.getPort(), uptimeSecs, newErrors);
        taskSummary.set_stats(tkStatus);
        taskSummarys.add(taskSummary);
      }
      topologyInfo = new TopologyInfo(topologyId,base.getStormName(), TimeUtils.time_delta(base.getLanchTimeSecs()), taskSummarys,extractStatusStr(base));
    }
   
    return topologyInfo;
  }
View Full Code Here

   */
  public void startTopology(String topologyName,
      StormClusterState stormClusterState, String stormId) {
    LOG.info("Activating " + topologyName + ": " + stormId);
    StormStatus status = new StormStatus(StatusType.active);
    StormBase stormBase = new StormBase(topologyName,
        TimeUtils.current_time_secs(), status);
    stormClusterState.activate_storm(stormId, stormBase);
  }
View Full Code Here

  @Override
  public void run() {
    // zkActive�Ѿ����̰߳�ȫ
    // synchronized (lock) {
    StormBase base = zkCluster.storm_base(topologyId, this);
    if (base == null) {
      zkActive.set(false);
    } else {
      StatusType type = base.getStatus().getStatusType();
      boolean isActive = type.equals(StatusType.active);
      zkActive.set(isActive);
    }

    // }
View Full Code Here

TOP

Related Classes of com.alipay.bluewhale.core.cluster.StormBase

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.