BgpRoutingProcess: proper hash for message queues
@@ -2035,7 +2035,8 @@ final class BgpRoutingProcess implements RoutingProcess<BgpTopology, BgpRoute<?,
assert _ebgpv4DeltaBestPathBuilder.isEmpty();
assert _bgpv4DeltaBuilder.isEmpty();
assert _bgpv4DeltaBestPathBuilder.isEmpty();
- return Stream.of(
+ return Streams.concat(
+ Stream.of(
// RIBs
_bgpv4Rib.getTypedRoutes(),
_evpnType3Rib.getTypedRoutes(),
@@ -2044,13 +2045,22 @@ final class BgpRoutingProcess implements RoutingProcess<BgpTopology, BgpRoute<?,
_ebgpv4DeltaPrev,
_ebgpv4DeltaPrevBestPath,
_bgpv4DeltaPrev,
- _bgpv4DeltaPrevBestPath,
- // Message queues
- _evpnType3IncomingRoutes,
- _evpnType5IncomingRoutes)
+ _bgpv4DeltaPrevBestPath),
+ messageQueueStream(_evpnType3IncomingRoutes),
+ messageQueueStream(_evpnType5IncomingRoutes))
.collect(toOrderedHashCode());
}
+ private static <T> Stream<Object> edgeQueueStream(
+ Entry<EdgeId, Queue<RouteAdvertisement<T>>> entry) {
+ return Streams.concat(Stream.of(entry.getKey()), entry.getValue().stream());
+ }
+
+ private static <T> Stream<Object> messageQueueStream(
+ Map<EdgeId, Queue<RouteAdvertisement<T>>> input) {
+ return input.entrySet().stream().flatMap(BgpRoutingProcess::edgeQueueStream);
+ }
+
public void importCrossVrfV4Routes(
Stream<RouteAdvertisement<Bgpv4Route>> routesToLeak, BgpVrfLeakConfig bgpConfig) {
@Nullable
