// current status is inactive
Map<StatusType, Callback> inactiveMap = new HashMap<StatusType, Callback>();
inactiveMap.put(StatusType.monitor, new ReassignTransitionCallback(
data, topologyid, new StormStatus(StatusType.inactive)));
inactiveMap.put(StatusType.inactivate, null);
inactiveMap.put(StatusType.startup, null);
inactiveMap.put(StatusType.activate, new ActiveTransitionCallback());
inactiveMap.put(StatusType.kill, new KillTransitionCallback(data,
topologyid));
inactiveMap.put(StatusType.remove, null);
inactiveMap.put(StatusType.rebalance, new RebalanceTransitionCallback(
data, topologyid, currentStatus));
inactiveMap.put(StatusType.do_rebalance, null);
rtn.put(StatusType.inactive, inactiveMap);
// current status is killed
Map<StatusType, Callback> killedMap = new HashMap<StatusType, Callback>();
killedMap.put(StatusType.monitor, null);
killedMap.put(StatusType.inactivate, null);
killedMap.put(StatusType.startup, new KillTransitionCallback(data,
topologyid));
killedMap.put(StatusType.activate, null);
killedMap.put(StatusType.kill, new KillTransitionCallback(data,
topologyid));
killedMap.put(StatusType.remove, new RemoveTransitionCallback(data,
topologyid));
killedMap.put(StatusType.rebalance, null);
killedMap.put(StatusType.do_rebalance, null);
rtn.put(StatusType.killed, killedMap);
// current status is under rebalancing
Map<StatusType, Callback> rebalancingMap = new HashMap<StatusType, Callback>();
StatusType rebalanceOldStatus = StatusType.active;
if (currentStatus.getOldStatus() != null) {
rebalanceOldStatus = currentStatus.getOldStatus().getStatusType();
// fix double rebalance, make the status always as rebalacing
if (rebalanceOldStatus == StatusType.rebalance) {
rebalanceOldStatus = StatusType.active;
}
}
rebalancingMap.put(StatusType.monitor, null);
rebalancingMap.put(StatusType.inactivate, null);
rebalancingMap.put(StatusType.startup, new RebalanceTransitionCallback(
data, topologyid, new StormStatus(rebalanceOldStatus)));
rebalancingMap.put(StatusType.activate, null);
rebalancingMap.put(StatusType.kill, null);
rebalancingMap.put(StatusType.remove, null);
rebalancingMap
.put(StatusType.rebalance, new RebalanceTransitionCallback(
data, topologyid, currentStatus));
rebalancingMap.put(StatusType.do_rebalance,
new DoRebalanceTransitionCallback(data, topologyid,
new StormStatus(rebalanceOldStatus)));
rtn.put(StatusType.rebalancing, rebalancingMap);
/**
* @@@ just handling 4 kind of status, maybe add later
*/