if (cidSpec == null) {
return cnt;
}
Set<?> entrySet = cidSpec.entrySet();
for (Iterator<?> it = entrySet.iterator(); it.hasNext();) {
Entry entry = (Entry) it.next();
Object obj = entry.getValue();
ComponentCommon common = null;
if (obj instanceof Bolt) {
common = ((Bolt) obj).get_common();
} else if (obj instanceof SpoutSpec) {
common = ((SpoutSpec) obj).get_common();
} else if (obj instanceof SpoutSpec) {
common = ((StateSpoutSpec) obj).get_common();
}
int declared = Thrift.parallelismHint(common);
// Map tmp = (Map) Utils_clj.from_json(common.get_json_conf());
Map newStormConf = new HashMap(stormConf);
// newStormConf.putAll(tmp);
Integer maxParallelism = (Integer) newStormConf
.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
Integer parallelism = declared;
if (maxParallelism != null) {
parallelism = Math.min(maxParallelism, declared);
}
for (int i = 0; i < parallelism; i++) {
cnt++;
rtn.put(cnt, (String) entry.getKey());
}
}
return cnt;
}