Package com.alibaba.jstorm.ui.model

Examples of com.alibaba.jstorm.ui.model.ComponentTask


  private List<ComponentTask> getComponentTasks(List<TaskSummary> taskList,
      String window) {
    List<ComponentTask> ret = new ArrayList<ComponentTask>();

    for (TaskSummary task : taskList) {
      ComponentTask componentTask = UIUtils.getComponentTask(task, topologyid);
     
      if (componentTask.getStatus().equals(ConfigExtension.TASK_STATUS_ACTIVE)) {
          TaskStats taskStats = task.get_stats();

          Map<String, Long> emitted = UIUtils.mergeStream(
              taskStats.get_emitted(), Long.valueOf(0));
          Map<String, Double> sendTps = UIUtils.mergeStream(
              taskStats.get_send_tps(), Double.valueOf(0));
          Map<String, Double> recvTps = UIUtils.mergeStream(
              taskStats.get_recv_tps(), Double.valueOf(0));
          Map<String, Long> acked = UIUtils.mergeStream(
              taskStats.get_acked(), Long.valueOf(0));
          Map<String, Long> failed = UIUtils.mergeStream(
              taskStats.get_failed(), Long.valueOf(0));
          Map<String, Double> process = UIUtils.mergeStream(
              taskStats.get_process_ms_avg(), Double.valueOf(0));
     
          componentTask.setEmitted(JStormUtils.formatValue(emitted
              .get(window)));
          componentTask.setSendTps(JStormUtils.formatValue(sendTps
              .get(window)));
          componentTask.setRecvTps(JStormUtils.formatValue(recvTps
              .get(window)));
          componentTask.setAcked(JStormUtils.formatValue(acked.get(window)));
          componentTask
              .setFailed(JStormUtils.formatValue(failed.get(window)));
          componentTask.setProcess(JStormUtils.formatValue(process
              .get(window)));
      }
      ret.add(componentTask);
    }
View Full Code Here


      if (taskSummary == null) {
        throw new NotAliveException("topologyid=" + topologyid
            + ", taskid=" + taskid);
      }

      ComponentTask componentTask = UIUtils.getComponentTask(taskSummary,
          topologyid);

      host = componentTask.getHost();

//      logFileName = componentTask.getTopologyid() + "-worker-"
//          + componentTask.getPort() + ".log";
      logFileName = JStormUtils.genLogName(summ.get_name(),
          Integer.valueOf(componentTask.getPort()));

    } catch (TException e) {
      LOG.error(e.getCause(), e);
      throw e;
    } catch (NotAliveException e) {
View Full Code Here

   * @return
   */
  public static ComponentTask getComponentTask(TaskSummary task,
      String topologyid) {

    ComponentTask componentTask = new ComponentTask();

    componentTask.setComponentid(task.get_component_id());
    componentTask.setTaskid(String.valueOf(task.get_task_id()));
    componentTask.setHost(task.get_host());
    componentTask.setPort(String.valueOf(task.get_port()));
   
    componentTask.setStatus(task.get_status());
   
    if (componentTask.getStatus().equals(ConfigExtension.TASK_STATUS_ACTIVE)) {
        componentTask.setUptime(StatBuckets.prettyUptimeStr(task
            .get_uptime_secs()));
        componentTask.setLastErr(UIUtils.getTaskError(task.get_errors()));
    }

    componentTask.setIp(NetWorkUtils.host2Ip(task.get_host()));

    componentTask.setTopologyid(topologyid);

    return componentTask;
  }
View Full Code Here

  private List<ComponentTask> getComponentTasks(List<TaskSummary> taskList,
      String window) {
    List<ComponentTask> ret = new ArrayList<ComponentTask>();

    for (TaskSummary task : taskList) {
      ComponentTask componentTask = UIUtils.getComponentTask(task, topologyid);
     
      if (componentTask.getStatus().equals(ConfigExtension.TASK_STATUS_ACTIVE)) {
          TaskStats taskStats = task.get_stats();

          Map<String, Long> emitted = UIUtils.mergeStream(
              taskStats.get_emitted(), Long.valueOf(0));
          Map<String, Double> sendTps = UIUtils.mergeStream(
              taskStats.get_send_tps(), Double.valueOf(0));
          Map<String, Double> recvTps = UIUtils.mergeStream(
              taskStats.get_recv_tps(), Double.valueOf(0));
          Map<String, Long> acked = UIUtils.mergeStream(
              taskStats.get_acked(), Long.valueOf(0));
          Map<String, Long> failed = UIUtils.mergeStream(
              taskStats.get_failed(), Long.valueOf(0));
          Map<String, Double> process = UIUtils.mergeStream(
              taskStats.get_process_ms_avg(), Double.valueOf(0));   

          componentTask.setEmitted(JStormUtils.formatValue(emitted
              .get(window)));
          componentTask.setSendTps(JStormUtils.formatValue(sendTps
              .get(window)));
          componentTask.setRecvTps(JStormUtils.formatValue(recvTps
              .get(window)));
          componentTask.setAcked(JStormUtils.formatValue(acked.get(window)));
          componentTask
              .setFailed(JStormUtils.formatValue(failed.get(window)));
          componentTask.setProcess(JStormUtils.formatValue(process
              .get(window)));
      }

      ret.add(componentTask);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.ui.model.ComponentTask

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.