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

Close GraphNodeFinder#findNode
This commit is contained in:
彭勇升 Buddha 2017-12-07 16:41:53 +08:00 committed by GitHub
commit a9046ac018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 28 deletions

View File

@ -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);

View File

@ -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);