Package com.alibaba.jstorm.task

Examples of com.alibaba.jstorm.task.TaskMetricInfo


  }

  public void buildTaskJsonMsg(String topologyId, Set<Integer> taskSet, boolean metricPerf) {
    for (Integer taskId : taskSet) {
      try {
          TaskMetricInfo taskMetric = cluster.get_task_metric(topologyId, taskId);
          if (taskMetric == null) continue;
         
          // Task KV structure
          Map<String, Object> taskKV = new HashMap<String, Object>();
          taskKV.put("Topology_Name", topologyId);
          taskKV.put("Task_Id", String.valueOf(taskId));
          taskKV.put("Component", taskMetric.getComponent());
          taskKV.putAll(taskMetric.getGaugeData());
          taskKV.putAll(taskMetric.getCounterData());
          taskKV.putAll(taskMetric.getMeterData());
          if (metricPerf == true) {
              taskKV.putAll(taskMetric.getTimerData());
              taskKV.putAll(taskMetric.getHistogramData());
          }
         
          jsonMsgTasks.add(taskKV);
      } catch (Exception e) {
        LOG.error("Failed to buildTaskJsonMsg, taskID=" + taskId + ", e=" + e);
View Full Code Here


        String taskId = entry.getKey();
        List<MetricInfo> MetricList = entry.getValue();
       
        try {
          String component = clusterState.task_info(topologyId, Integer.valueOf(taskId)).getComponentId();
            TaskMetricInfo taskMetricInfo = new TaskMetricInfo(taskId, component);
           
              for(MetricInfo metricInfo : MetricList) {
              taskMetricInfo.updateMetricData(metricInfo);
              }
             
              List<String> errors = taskMetricInfo.anyQueueFull();
              if (errors.size() > 0) {
                for (String error : errors)
                      clusterState.report_task_error(topologyId, Integer.valueOf(taskId), error);
              }
             
View Full Code Here

    cluster_state.delete_node(monitorUserPath);
  }
 
  @Override
  public TaskMetricInfo get_task_metric(String topologyId, int taskId) throws Exception {
    TaskMetricInfo taskMetric = null;
   
    String monitorTaskPath = Cluster.monitor_task_path(topologyId, String.valueOf(taskId))
    taskMetric = (TaskMetricInfo)(Cluster.maybe_deserialize(
        cluster_state.get_data(monitorTaskPath, false)));
   
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.task.TaskMetricInfo

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.