@Test public void testRemoveEdge() throws Exception { Source src = new StreamlineSource(Collections.singleton(new Stream("f1", "f2"))); Sink sink = new StreamlineSink(); Processor processor = new StreamlineProcessor(Collections.singleton(new Stream("r1"))); topology.add(src).add(processor).add(sink); topology.addEdge(src, processor); topology.addEdge(processor, sink); assertEquals(2, topology.getEdges(processor).size()); topology.removeEdge(processor, sink); assertEquals(1, topology.getEdges(processor).size()); assertEquals(1, topology.getEdges(src).size()); assertEquals(0, topology.getEdges(sink).size()); }
public void removeEdge(OutputComponent from, InputComponent to) { ensureValid(from, to); Iterator<Edge> it = dag.get(from).iterator(); while (it.hasNext()) { if (it.next().getTo().equals(to)) { it.remove(); } } }
TopologyDag implements Serializable { public void removeEdge(OutputComponent from, InputComponent to) { ensureValid(from, to); Iterator<Edge> it = dag.get(from).iterator(); while (it.hasNext()) { if (it.next().getTo().equals(to)) { it.remove(); } } } }
TopologyDag implements Serializable { public void removeEdge(OutputComponent from, InputComponent to) { ensureValid(from, to); Iterator<Edge> it = dag.get(from).iterator(); while (it.hasNext()) { if (it.next().getTo().equals(to)) { it.remove(); } } }  }
TopologyDag implements Serializable { public void removeEdge(OutputComponent from, InputComponent to) { ensureValid(from, to); Iterator<Edge> it = dag.get(from).iterator(); while (it.hasNext()) { if (it.next().getTo().equals(to)) { it.remove(); } } }  TopologyDag add(OutputComponent component); Set<OutputComponent> getOutputComponents(); TopologyDag add(InputComponent component); Set<InputComponent> getInputComponents(); TopologyDag add(Processor processor); Set<Component> getComponents(); void addEdge(OutputComponent from, InputComponent to); void addEdge(String id, OutputComponent from, InputComponent to, String streamId); void addEdge(String id, OutputComponent from, InputComponent to, String streamId, Stream.Grouping grouping); void addEdge(Edge edge); void addEdge(String id, OutputComponent from, InputComponent to, StreamGrouping streamGrouping); void removeEdge(OutputComponent from, InputComponent to); void removeEdge(OutputComponent from, InputComponent to, String streamId, Stream.Grouping grouping); List<Edge> getEdgesFrom(Component component); List<Edge> getEdgesTo(Component component); List<Edge> getEdges(Component component); List<Edge> getAllEdges(); List<Component> adjacent(Component component); void traverse(TopologyDagVisitor visitor); @Override String toString(); }
TopologyDag implements Serializable { public void removeEdge(OutputComponent from, InputComponent to) { ensureValid(from, to); Iterator<Edge> it = dag.get(from).iterator(); while (it.hasNext()) { if (it.next().getTo().equals(to)) { it.remove(); } } }  TopologyDag add(OutputComponent component); Set<OutputComponent> getOutputComponents(); TopologyDag add(InputComponent component); Set<InputComponent> getInputComponents(); TopologyDag add(Processor processor); Set<Component> getComponents(); void addEdge(OutputComponent from, InputComponent to); void addEdge(String id, OutputComponent from, InputComponent to, String streamId); void addEdge(String id, OutputComponent from, InputComponent to, String streamId, Stream.Grouping grouping); void addEdge(Edge edge); void addEdge(String id, OutputComponent from, InputComponent to, StreamGrouping streamGrouping); void removeEdge(OutputComponent from, InputComponent to); void removeEdge(OutputComponent from, InputComponent to, String streamId, Stream.Grouping grouping); List<Edge> getEdgesFrom(Component component); List<Edge> getEdgesTo(Component component); List<Edge> getEdges(Component component); List<Edge> getAllEdges(); List<Component> adjacent(Component component); void traverse(TopologyDagVisitor visitor); @Override String toString();  }