Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xumingming committed Jul 20, 2012
1 parent cf8d5c4 commit e737179
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/jvm/storm/DemoScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;

import backtype.storm.scheduler.Cluster;
import backtype.storm.scheduler.EvenScheduler;
import backtype.storm.scheduler.ExecutorDetails;
import backtype.storm.scheduler.IScheduler;
import backtype.storm.scheduler.SupervisorDetails;
Expand All @@ -15,8 +16,20 @@
/**
* This demo scheduler make sure a spout named <code>special-spout</code> in topology <code>special-topology</code> runs
* on a supervisor named <code>special-supervisor</code>. supervisor does not have name? You can configure it through
* the config: <code>supervisor.scheduler.meta</code> you can configure anything in it.
* the config: <code>supervisor.scheduler.meta</code> -- actually you can put any config you like in this config item.
*
* In our example, we need to put the following config in supervisor's <code>storm.yaml</code>:
* <pre>
* # give our supervisor a name: "special-supervisor"
* supervisor.scheduler.meta:
* name: "special-supervisor"
* </pre>
*
* Put the following config in <code>nimbus</code>'s <code>storm.yaml</code>:
* <pre>
* # tell nimbus to use this custom scheduler
* storm.scheduler: "storm.DemoScheduler"
* </pre>
* @author xumingmingv May 19, 2012 11:10:43 AM
*/
public class DemoScheduler implements IScheduler {
Expand Down Expand Up @@ -76,7 +89,7 @@ public void schedule(Topologies topologies, Cluster cluster) {
// let system's even scheduler handle the rest scheduling work
// you can also use your own other scheduler here, this is what
// makes storm's scheduler composable.
new backtype.storm.scheduler.EvenScheduler().schedule(topologies, cluster);
new EvenScheduler().schedule(topologies, cluster);
}

}

0 comments on commit e737179

Please sign in to comment.