Package com.alibaba.jstorm.daemon.nimbus

Examples of com.alibaba.jstorm.daemon.nimbus.StatusType


    }
   
   

    try {
      StatusType newTopologyStatus = StatusType.activate;
      // /ZK-DIR/topology
      StormBase base = zkCluster.storm_base(topologyId, this);
      if (base == null) {
        // @@@ normally the topology has been removed
        LOG.warn("Failed to get StromBase from ZK of " + topologyId);
        newTopologyStatus = StatusType.killed;
      } else {

        newTopologyStatus = base.getStatus().getStatusType();
      }

      // Start metrics report if metrics monitor is enabled.
      // Stop metrics report if metrics monitor is disabled.
      try {
          StormMonitor monitor = zkCluster.get_storm_monitor(topologyId);
          if (null != monitor) {
              boolean newMetricsMonitor = monitor.getMetrics();
              MetricReporter metricReporter = workerData.getMetricsReporter();
              boolean oldMetricsMonitor = metricReporter.isEnable();
         
              if (oldMetricsMonitor != newMetricsMonitor) {
                  metricReporter.setEnable(newMetricsMonitor);
                  if (true == newMetricsMonitor) {
                      LOG.info("Start metrics reporter");
                  } else {
                    LOG.info("Stop metrics reporter");
                  }
              }
          }
      } catch (Exception e) {
        LOG.warn("Failed to get monitor status of topology " + topologyId);
        LOG.debug(e);
      }
     
      // Process the topology status change
      StatusType oldTopologyStatus = workerData.getTopologyStatus();

      if (newTopologyStatus.equals(oldTopologyStatus)) {
        return;
      }
View Full Code Here


    return ToStringBuilder.reflectionToString(this,
        ToStringStyle.SHORT_PREFIX_STYLE);
  }

  public String getStatusString() {
    StatusType t = status.getStatusType();
    return t.getStatus().toUpperCase();
  }
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.daemon.nimbus.StatusType

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.