当前位置: 首页>>代码示例>>Java>>正文


Java StormTopology.get_bolts方法代码示例

本文整理汇总了Java中backtype.storm.generated.StormTopology.get_bolts方法的典型用法代码示例。如果您正苦于以下问题:Java StormTopology.get_bolts方法的具体用法?Java StormTopology.get_bolts怎么用?Java StormTopology.get_bolts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backtype.storm.generated.StormTopology的用法示例。


在下文中一共展示了StormTopology.get_bolts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: componentType

import backtype.storm.generated.StormTopology; //导入方法依赖的package包/类
public static String componentType(StormTopology topology, String id) {
	Map<String, Bolt> bolts = topology.get_bolts();
	Map<String, SpoutSpec> spouts = topology.get_spouts();
	String type = "";
	if (bolts.containsKey(id)) {
		type = BOLT_STR;
	} else if (spouts.containsKey(id)) {
		type = SPOUT_STR;
	}
	return type;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:UIUtils.java

示例2: setBoltInfo

import backtype.storm.generated.StormTopology; //导入方法依赖的package包/类
private int setBoltInfo(StormTopology oldTopology, StormTopology newTopology, int cnt, StormClusterState clusterState) throws Exception {
    Map<String, Bolt> oldBolts = oldTopology.get_bolts();
    Map<String, Bolt> bolts = newTopology.get_bolts();
    for (Entry<String, Bolt> entry : oldBolts.entrySet()) {
        String boltName = entry.getKey();
        Bolt oldBolt = entry.getValue();
        Bolt bolt = bolts.get(boltName);
        if (oldBolt.get_common().get_parallelism_hint() > bolt.get_common().get_parallelism_hint()) {
            int removedTaskNum = oldBolt.get_common().get_parallelism_hint() - bolt.get_common().get_parallelism_hint();
            TreeSet<Integer> taskIds = new TreeSet<Integer>(clusterState.task_ids_by_componentId(topologyid, boltName));
            Iterator<Integer> descendIterator = taskIds.descendingIterator();
            while (--removedTaskNum >= 0) {
                int taskId = descendIterator.next();
                removeTask(topologyid, taskId, clusterState);
                LOG.info("Remove bolt task, taskId=" + taskId + " for " + boltName);
            }
        } else if (oldBolt.get_common().get_parallelism_hint() == bolt.get_common().get_parallelism_hint()) {
            continue;
        } else {
            int delta = bolt.get_common().get_parallelism_hint() - oldBolt.get_common().get_parallelism_hint();
            Map<Integer, TaskInfo> taskInfoMap = new HashMap<Integer, TaskInfo>();

            for (int i = 1; i <= delta; i++) {
                cnt++;
                TaskInfo taskInfo = new TaskInfo((String) entry.getKey(), "bolt");
                taskInfoMap.put(cnt, taskInfo);
                newTasks.add(cnt);
                LOG.info("Setup new bolt task, taskId=" + cnt + " for " + boltName);
            }
            clusterState.add_task(topologyid, taskInfoMap);
        }
    }

    return cnt;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:36,代码来源:DoRebalanceTransitionCallback.java

示例3: _asGraph

import backtype.storm.generated.StormTopology; //导入方法依赖的package包/类
private ListenableDirectedGraph<NamedNode, DefaultEdge> _asGraph(StormTopology t) {
	final Map<String, Bolt> bolts = t.get_bolts();
	final Map<String, SpoutSpec> spouts = t.get_spouts();
	final ListenableDirectedGraph<NamedNode, DefaultEdge> ret = new ListenableDirectedGraph<NamedNode, DefaultEdge>(
			DefaultEdge.class);

	createSpouts(spouts, ret);
	createBolts(bolts, ret);
	createConnections(bolts, ret);
	return ret;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:12,代码来源:StormGraphCreator.java


注:本文中的backtype.storm.generated.StormTopology.get_bolts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。