use of storm.trident.planner.SpoutNode in project storm by nathanmarz.
the class TridentTopology method getMaxParallelism.
private static Integer getMaxParallelism(Set<Group> groups) {
Integer ret = null;
for (Group g : groups) {
if (isSpoutGroup(g)) {
SpoutNode n = (SpoutNode) g.nodes.iterator().next();
Map conf = getSpoutComponentConfig(n.spout);
if (conf == null)
conf = new HashMap();
Number maxP = (Number) conf.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
if (maxP != null) {
if (ret == null)
ret = maxP.intValue();
else
ret = Math.min(ret, maxP.intValue());
}
}
}
return ret;
}
use of storm.trident.planner.SpoutNode in project storm by nathanmarz.
the class TridentTopology method genSpoutIds.
private static Map<Node, String> genSpoutIds(Collection<SpoutNode> spoutNodes) {
Map<Node, String> ret = new HashMap();
int ctr = 0;
for (SpoutNode n : spoutNodes) {
ret.put(n, "spout" + ctr);
ctr++;
}
return ret;
}
Aggregations