use of backtype.storm.generated.Grouping in project storm by nathanmarz.
the class TopologyBuilder method initCommon.
private void initCommon(String id, IComponent component, Number parallelism) {
ComponentCommon common = new ComponentCommon();
common.set_inputs(new HashMap<GlobalStreamId, Grouping>());
if (parallelism != null)
common.set_parallelism_hint(parallelism.intValue());
Map conf = component.getComponentConfiguration();
if (conf != null)
common.set_json_conf(JSONValue.toJSONString(conf));
_commons.put(id, common);
}
use of backtype.storm.generated.Grouping in project storm by nathanmarz.
the class GeneralTopologyContext method getTargets.
/**
* Gets information about who is consuming the outputs of the specified component,
* and how.
*
* @return Map from stream id to component id to the Grouping used.
*/
public Map<String, Map<String, Grouping>> getTargets(String componentId) {
Map<String, Map<String, Grouping>> ret = new HashMap<String, Map<String, Grouping>>();
for (String otherComponentId : getComponentIds()) {
Map<GlobalStreamId, Grouping> inputs = getComponentCommon(otherComponentId).get_inputs();
for (GlobalStreamId id : inputs.keySet()) {
if (id.get_componentId().equals(componentId)) {
Map<String, Grouping> curr = ret.get(id.get_streamId());
if (curr == null)
curr = new HashMap<String, Grouping>();
curr.put(otherComponentId, inputs.get(id));
ret.put(id.get_streamId(), curr);
}
}
}
return ret;
}
Aggregations