未验证 提交 a9046ac0 编写于 作者: 彭勇升 Buddha 提交者: GitHub

Merge pull request #648 from OpenSkywalking/feature/close-graph-find-node

Close GraphNodeFinder#findNode
......@@ -30,25 +30,6 @@ public class GraphNodeFinder {
this.graph = graph;
}
/**
* Find an exist node to build the graph.
*
* @param handlerId of specific node in graph.
* @param outputClass of the found node
* @param <NODEOUTPUT> type of given output class
* @return Node instance.
*/
public <NODEOUTPUT> Node<?, NODEOUTPUT> findNode(int handlerId, Class<NODEOUTPUT> outputClass) {
ConcurrentHashMap<Integer, Node> graphNodeIndex = graph.getNodeIndex();
Node node = graphNodeIndex.get(handlerId);
if (node == null) {
throw new NodeNotFoundException("Can't find node with handlerId="
+ handlerId
+ " in graph[" + graph.getId() + "]");
}
return node;
}
public Next findNext(int handlerId) {
ConcurrentHashMap<Integer, Node> graphNodeIndex = graph.getNodeIndex();
Node node = graphNodeIndex.get(handlerId);
......
......@@ -105,15 +105,6 @@ public class GraphManagerTest {
Next next = GraphManager.INSTANCE.findGraph(5).toFinder().findNext(3);
}
@Test
public void testFindNode() {
Graph<String> graph = GraphManager.INSTANCE.createIfAbsent(6, String.class);
graph.addNode(new Node1Processor()).addNext(new Node2Processor());
Node<?, Integer> foundNode = GraphManager.INSTANCE.findGraph(6).toFinder().findNode(2, Integer.class);
foundNode.addNext(new Node4Processor());
}
@Test
public void testDeadEndWay() {
Graph<String> graph = GraphManager.INSTANCE.createIfAbsent(7, String.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册