Examples of TaskHeartbeat


Examples of com.alibaba.jstorm.task.heartbeat.TaskHeartbeat

  private TopoCommStatsInfo getCommStatsData(String topologyId) {
    try
    {  
      String taskId;
      String componentId;
        TaskHeartbeat taskHb;
       
        TopoCommStatsInfo commStatsInfo = topologyMap.get(topologyId);
        if (commStatsInfo == null) {LOG.warn("commStatsInfo is null, topoId=" + topologyId);}
       
        Map<String, TaskHeartbeat> heartbeats = clusterState.task_heartbeat(topologyId);
        if (heartbeats == null || heartbeats.size() == 0) return null;
       
        for (Entry<String, TaskHeartbeat> entry : heartbeats.entrySet()) {
          taskId = entry.getKey();
            taskHb = entry.getValue();
           
            TaskInfo taskInfo = clusterState.task_info(topologyId, Integer.parseInt(taskId));
            if (taskInfo == null ) {
              LOG.warn("Task information can not be found in ZK for task-" + taskId);
              continue;
            }
            componentId = taskInfo.getComponentId();
           
            //update taskHb into the corresponding component map
            if (taskHb.getComponentType().equals("spout")) {
              commStatsInfo.addToSpoutList(componentId, taskId, taskHb);
            } else {
              commStatsInfo.addToBoltList(componentId, taskId, taskHb);
            }
        }
View Full Code Here

Examples of com.alibaba.jstorm.task.heartbeat.TaskHeartbeat

    String idStr = " topology:" + topologyId + ",taskid:" + taskId;

    Integer zkReportTime = null;

    StormClusterState stormClusterState = data.getStormClusterState();
    TaskHeartbeat zkTaskHeartbeat = null;
    try {
      zkTaskHeartbeat = stormClusterState.task_heartbeat(topologyId,
          taskId);
      if (zkTaskHeartbeat != null) {
        zkReportTime = zkTaskHeartbeat.getTimeSecs();
      }
    } catch (Exception e) {
      LOG.error("Failed to get ZK task hearbeat " + idStr, e);
      return true;
    }
View Full Code Here

Examples of com.alibaba.jstorm.task.heartbeat.TaskHeartbeat

                  .getTimSecs()));
            }
          }
          taskSummary.set_errors(newErrors);
       
        TaskHeartbeat heartbeat = zkClusterState.task_heartbeat(
            topologyId, taskId);
        if (heartbeat == null) {
          LOG.warn("Topology " + topologyId + " task " + taskId
              + " hasn't been started");
          taskSummary.set_status(ConfigExtension.TASK_STATUS_STARTING);
        } else {
            taskSummary.set_uptime_secs(heartbeat.getUptimeSecs());
            taskSummary.set_stats(heartbeat.getStats().getTaskStats());
            taskSummary.set_status(ConfigExtension.TASK_STATUS_ACTIVE);
        }

        taskSummaries.put(taskId, taskSummary);
      }
View Full Code Here

Examples of com.alibaba.jstorm.task.heartbeat.TaskHeartbeat

        statsDataMap.put(componentId, comStatsData);
      }
      comStatsData.resetData();
     
      for (Entry<String, TaskHeartbeat> compEntry : compList.entrySet()) {
        TaskHeartbeat taskHb = compEntry.getValue();
        CommonStatsData statsData = taskHb.getStats();
        comStatsData.updateStatsData(statsData);
      }
      double avgLatency = (comStatsData.getLatency())/(compList.size());
      comStatsData.updateLatency(avgLatency);
    }
View Full Code Here

Examples of com.alipay.bluewhale.core.task.heartbeat.TaskHeartbeat

        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);
      }
View Full Code Here

Examples of com.alipay.bluewhale.core.task.heartbeat.TaskHeartbeat

    }
    if(taskIds!=null){
       rtn = new HashSet<Integer>();
      for (Integer taskId:taskIds) {
        //��ȡtask��������
        TaskHeartbeat taskHeartbeat = stormClusterState.task_heartbeat(topologyid, taskId);

        Integer reportTime = null;
        if (taskHeartbeat != null) {
          reportTime = taskHeartbeat.getTimeSecs();
        }

        Map<Integer, Map<TkHbCacheTime, Integer>> val =taskHeartbeatsCache.get(topologyid);
        if(val==null)
        {
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.