@Test public void testPrunedVxlanTopologyDiscard() { MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); graph.putEdge(new VxlanNode(NODE1, VNI), new VxlanNode(NODE2, VNI)); VxlanTopology initial = new VxlanTopology(graph); assertThat( prunedVxlanTopology( initial, compatibleVxlanConfigs(), new TestTracerouteEngine( ImmutableMap.of( NODE1, new TestTracerouteEngineResult(NODE2, false, true), NODE2, new TestTracerouteEngineResult(NODE1, false, true)))) .getGraph() .edges(), empty()); }
public static @Nonnull VxlanTopology prunedVxlanTopology( VxlanTopology initialVxlanTopology, Map<String, Configuration> configurations, TracerouteEngine tracerouteEngine) { Span span = GlobalTracer.get().buildSpan("VxlanTopologyUtils.prunedVxlanTopology").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; NetworkConfigurations nc = NetworkConfigurations.of(configurations); MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); initialVxlanTopology.getGraph().edges().stream() .filter(edge -> reachableEdge(edge, nc, tracerouteEngine)) .forEach(edge -> graph.putEdge(edge.nodeU(), edge.nodeV())); return new VxlanTopology(graph); } finally { span.finish(); } }
VxlanTopologyUtils { public static @Nonnull VxlanTopology prunedVxlanTopology( VxlanTopology initialVxlanTopology, Map<String, Configuration> configurations, TracerouteEngine tracerouteEngine) { Span span = GlobalTracer.get().buildSpan("VxlanTopologyUtils.prunedVxlanTopology").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; NetworkConfigurations nc = NetworkConfigurations.of(configurations); MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); initialVxlanTopology.getGraph().edges().stream() .filter(edge -> reachableEdge(edge, nc, tracerouteEngine)) .forEach(edge -> graph.putEdge(edge.nodeU(), edge.nodeV())); return new VxlanTopology(graph); } finally { span.finish(); } } }
VxlanTopologyUtils { public static @Nonnull VxlanTopology prunedVxlanTopology( VxlanTopology initialVxlanTopology, Map<String, Configuration> configurations, TracerouteEngine tracerouteEngine) { Span span = GlobalTracer.get().buildSpan("VxlanTopologyUtils.prunedVxlanTopology").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; NetworkConfigurations nc = NetworkConfigurations.of(configurations); MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); initialVxlanTopology.getGraph().edges().stream() .filter(edge -> reachableEdge(edge, nc, tracerouteEngine)) .forEach(edge -> graph.putEdge(edge.nodeU(), edge.nodeV())); return new VxlanTopology(graph); } finally { span.finish(); } } private  VxlanTopologyUtils(); }
VxlanTopologyUtils { public static @Nonnull VxlanTopology prunedVxlanTopology( VxlanTopology initialVxlanTopology, Map<String, Configuration> configurations, TracerouteEngine tracerouteEngine) { Span span = GlobalTracer.get().buildSpan("VxlanTopologyUtils.prunedVxlanTopology").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; NetworkConfigurations nc = NetworkConfigurations.of(configurations); MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); initialVxlanTopology.getGraph().edges().stream() .filter(edge -> reachableEdge(edge, nc, tracerouteEngine)) .forEach(edge -> graph.putEdge(edge.nodeU(), edge.nodeV())); return new VxlanTopology(graph); } finally { span.finish(); } } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine); }
VxlanTopologyUtils { public static @Nonnull VxlanTopology prunedVxlanTopology( VxlanTopology initialVxlanTopology, Map<String, Configuration> configurations, TracerouteEngine tracerouteEngine) { Span span = GlobalTracer.get().buildSpan("VxlanTopologyUtils.prunedVxlanTopology").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; NetworkConfigurations nc = NetworkConfigurations.of(configurations); MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); initialVxlanTopology.getGraph().edges().stream() .filter(edge -> reachableEdge(edge, nc, tracerouteEngine)) .forEach(edge -> graph.putEdge(edge.nodeU(), edge.nodeV())); return new VxlanTopology(graph); } finally { span.finish(); } } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine);  }