Package com.alipay.bluewhale.core.cluster

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


        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){
          //����ÿ�λ�ȡ����״̬ת������
          rtn=stateTransitions(data,topologyid, topologyStatus);
        //}
        //��ȡ��ǰtopology״̬��ת����״̬����
        Map<StatusType, Callback> transition_map=rtn.get(topologyStatus.getStatusType());
       
        if(transition_map.containsKey(transition_status)){
          //��ȡת���¶���ִ�з�����ִ�С�
          Callback callback=transition_map.get(transition_status);
          //�����µ�״̬����StormStatus
          if(callback!=null){
            Object obj=callback.execute(args);
            if (obj != null && obj instanceof StormStatus) {
              StormStatus newStatus=(StormStatus)obj;
              //����״̬
                data.getStormClusterState().update_storm(topologyid, newStatus);
              LOG.info("Updated " + topologyid + " with status " + newStatus);
           
          }
View Full Code Here


   * @param stormId
   */
  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

public class ActiveTransitionCallback extends BaseCallback {

  @Override
  public <T> Object execute(T... args) {
   
    return new StormStatus(StatusType.active);
  }
View Full Code Here

    }
    LOG.info("Delaying event " + StatusType.remove.getStatus() + " for " + delaySecs + " secs for " + topologyid);
   
    data.getScheduExec().schedule(new DelayEventRunnable(data,topologyid,StatusType.remove), delaySecs, TimeUnit.SECONDS);
   
    return new StormStatus(delaySecs, StatusType.killed, oldStatus);
  }
View Full Code Here

    }
    LOG.info("Delaying event " + StatusType.do_rebalance.getStatus() + " for " + delaySecs + " secs for " + topologyid);
   
    data.getScheduExec().schedule(new DelayEventRunnable(data,topologyid,StatusType.do_rebalance), delaySecs, TimeUnit.SECONDS);
   
    return new StormStatus(delaySecs, StatusType.rebalancing, oldStatus);
  }
View Full Code Here

public class InactiveTransitionCallback extends BaseCallback {

  @Override
  public <T> Object execute(T... args) {
   
    return new StormStatus(StatusType.inactive);
  }
View Full Code Here

TOP

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

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.