Permalink
Browse files

added rebalance thrift definition

  • Loading branch information...
Nathan Marz
Nathan Marz committed Dec 18, 2011
1 parent cf7a37b commit 277d4e636776c183988953af874016b103168cc3
@@ -31,7 +31,7 @@
InvalidTopologyException ClusterSummary TopologyInfo
TopologySummary TaskSummary TaskStats TaskSpecificStats
SpoutStats BoltStats ErrorInfo SupervisorSummary
- KillOptions JavaObject JavaObjectArg]))
+ KillOptions RebalanceOptions JavaObject JavaObjectArg]))
(import (quote [backtype.storm.daemon.common StormBase Assignment
TaskInfo SupervisorInfo WorkerHeartbeat TaskHeartbeat]))
(import (quote [backtype.storm.grouping CustomStreamGrouping]))
@@ -137,7 +137,9 @@
(locking (:submit-lock nimbus)
(let [[event & event-args] (if (keyword? event) [event] event)
status (topology-status nimbus storm-id)]
- (if status ; handles the case where event was scheduled but has been removed
+ ;; handles the case where event was scheduled but topology has been removed
+ (if-not status
+ (log-message "Cannot apply event " event " to " storm-id " because topology no longer exists")
(let [get-event (fn [m e]
(if (contains? m e)
(m e)
@@ -647,6 +649,14 @@
(transition-name! nimbus storm-name [:kill wait-amt] true)
))
+ (^void rebalance [this ^String storm-name ^RebalanceOptions options]
+ (check-storm-active! nimbus storm-name true)
+ (let [wait-amt (if (.is_set_wait_secs options)
+ (.get_wait_secs options)
+ )]
+ (transition-name! nimbus storm-name [:rebalance wait-amt] true)
+ ))
+
(activate [this storm-name]
(transition-name! nimbus storm-name :activate true)
)
Oops, something went wrong.

0 comments on commit 277d4e6

Please sign in to comment.