mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-12-17 07:11:27 +01:00
Renamed bgpRoutes field in Router class to ribTable.
No functional changes. Change-Id: I1b5de1b93dc1264adfcd7c4cad9c2a315c1b8992
This commit is contained in:
parent
b834920a2a
commit
64c1ed1f72
@ -74,7 +74,7 @@ public class Router implements RouteListener {
|
|||||||
|
|
||||||
// Store all route updates in a radix tree.
|
// Store all route updates in a radix tree.
|
||||||
// The key in this tree is the binary string of prefix of the route.
|
// The key in this tree is the binary string of prefix of the route.
|
||||||
private InvertedRadixTree<RouteEntry> bgpRoutes;
|
private InvertedRadixTree<RouteEntry> ribTable;
|
||||||
|
|
||||||
// Stores all incoming route updates in a queue.
|
// Stores all incoming route updates in a queue.
|
||||||
private final BlockingQueue<Collection<RouteUpdate>> routeUpdatesQueue;
|
private final BlockingQueue<Collection<RouteUpdate>> routeUpdatesQueue;
|
||||||
@ -114,7 +114,7 @@ public class Router implements RouteListener {
|
|||||||
|
|
||||||
this.hostListener = new InternalHostListener();
|
this.hostListener = new InternalHostListener();
|
||||||
|
|
||||||
bgpRoutes = new ConcurrentInvertedRadixTree<>(
|
ribTable = new ConcurrentInvertedRadixTree<>(
|
||||||
new DefaultByteArrayNodeFactory());
|
new DefaultByteArrayNodeFactory());
|
||||||
routeUpdatesQueue = new LinkedBlockingQueue<>();
|
routeUpdatesQueue = new LinkedBlockingQueue<>();
|
||||||
routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
|
routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
|
||||||
@ -151,7 +151,7 @@ public class Router implements RouteListener {
|
|||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
// Cleanup all local state
|
// Cleanup all local state
|
||||||
bgpRoutes = new ConcurrentInvertedRadixTree<>(
|
ribTable = new ConcurrentInvertedRadixTree<>(
|
||||||
new DefaultByteArrayNodeFactory());
|
new DefaultByteArrayNodeFactory());
|
||||||
routeUpdatesQueue.clear();
|
routeUpdatesQueue.clear();
|
||||||
routesWaitingOnArp.clear();
|
routesWaitingOnArp.clear();
|
||||||
@ -255,8 +255,7 @@ public class Router implements RouteListener {
|
|||||||
Ip4Prefix prefix = routeEntry.prefix();
|
Ip4Prefix prefix = routeEntry.prefix();
|
||||||
Ip4Address nextHop = null;
|
Ip4Address nextHop = null;
|
||||||
RouteEntry foundRouteEntry =
|
RouteEntry foundRouteEntry =
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(prefix),
|
ribTable.put(RouteEntry.createBinaryString(prefix), routeEntry);
|
||||||
routeEntry);
|
|
||||||
if (foundRouteEntry != null) {
|
if (foundRouteEntry != null) {
|
||||||
nextHop = foundRouteEntry.nextHop();
|
nextHop = foundRouteEntry.nextHop();
|
||||||
}
|
}
|
||||||
@ -394,7 +393,7 @@ public class Router implements RouteListener {
|
|||||||
log.debug("Processing route delete: {}", routeEntry);
|
log.debug("Processing route delete: {}", routeEntry);
|
||||||
Ip4Prefix prefix = routeEntry.prefix();
|
Ip4Prefix prefix = routeEntry.prefix();
|
||||||
|
|
||||||
if (bgpRoutes.remove(RouteEntry.createBinaryString(prefix))) {
|
if (ribTable.remove(RouteEntry.createBinaryString(prefix))) {
|
||||||
//
|
//
|
||||||
// Only withdraw intents if an entry was actually removed from the
|
// Only withdraw intents if an entry was actually removed from the
|
||||||
// tree. If no entry was removed, the <prefix, nexthop> wasn't
|
// tree. If no entry was removed, the <prefix, nexthop> wasn't
|
||||||
@ -435,7 +434,7 @@ public class Router implements RouteListener {
|
|||||||
Ip4Prefix prefix = routeEntry.prefix();
|
Ip4Prefix prefix = routeEntry.prefix();
|
||||||
String binaryString = RouteEntry.createBinaryString(prefix);
|
String binaryString = RouteEntry.createBinaryString(prefix);
|
||||||
RouteEntry foundRouteEntry =
|
RouteEntry foundRouteEntry =
|
||||||
bgpRoutes.getValueForExactKey(binaryString);
|
ribTable.getValueForExactKey(binaryString);
|
||||||
if (foundRouteEntry != null &&
|
if (foundRouteEntry != null &&
|
||||||
foundRouteEntry.nextHop().equals(routeEntry.nextHop())) {
|
foundRouteEntry.nextHop().equals(routeEntry.nextHop())) {
|
||||||
// We only push prefix flows if the prefix is still in the
|
// We only push prefix flows if the prefix is still in the
|
||||||
@ -471,7 +470,7 @@ public class Router implements RouteListener {
|
|||||||
*/
|
*/
|
||||||
public Collection<RouteEntry> getRoutes() {
|
public Collection<RouteEntry> getRoutes() {
|
||||||
Iterator<KeyValuePair<RouteEntry>> it =
|
Iterator<KeyValuePair<RouteEntry>> it =
|
||||||
bgpRoutes.getKeyValuePairsForKeysStartingWith("").iterator();
|
ribTable.getKeyValuePairsForKeysStartingWith("").iterator();
|
||||||
|
|
||||||
List<RouteEntry> routes = new LinkedList<>();
|
List<RouteEntry> routes = new LinkedList<>();
|
||||||
|
|
||||||
|
|||||||
@ -291,24 +291,24 @@ public class IntentSyncTest extends AbstractIntentTest {
|
|||||||
MultiPointToSinglePointIntent intent6 = intentBuilder(
|
MultiPointToSinglePointIntent intent6 = intentBuilder(
|
||||||
routeEntry6.prefix(), "00:00:00:00:00:01", SW1_ETH1);
|
routeEntry6.prefix(), "00:00:00:00:00:01", SW1_ETH1);
|
||||||
|
|
||||||
// Set up the bgpRoutes field in Router class and routeIntents fields
|
// Set up the ribTable field in Router class and routeIntents fields
|
||||||
// in IntentSynchronizer class
|
// in IntentSynchronizer class
|
||||||
InvertedRadixTree<RouteEntry> bgpRoutes =
|
InvertedRadixTree<RouteEntry> ribTable =
|
||||||
new ConcurrentInvertedRadixTree<>(
|
new ConcurrentInvertedRadixTree<>(
|
||||||
new DefaultByteArrayNodeFactory());
|
new DefaultByteArrayNodeFactory());
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry1.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry1.prefix()),
|
||||||
routeEntry1);
|
routeEntry1);
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry3.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry3.prefix()),
|
||||||
routeEntry3);
|
routeEntry3);
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry4Update.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry4Update.prefix()),
|
||||||
routeEntry4Update);
|
routeEntry4Update);
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry5.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry5.prefix()),
|
||||||
routeEntry5);
|
routeEntry5);
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry6.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry6.prefix()),
|
||||||
routeEntry6);
|
routeEntry6);
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry7.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry7.prefix()),
|
||||||
routeEntry7);
|
routeEntry7);
|
||||||
TestUtils.setField(router, "bgpRoutes", bgpRoutes);
|
TestUtils.setField(router, "ribTable", ribTable);
|
||||||
|
|
||||||
ConcurrentHashMap<Ip4Prefix, MultiPointToSinglePointIntent>
|
ConcurrentHashMap<Ip4Prefix, MultiPointToSinglePointIntent>
|
||||||
routeIntents = new ConcurrentHashMap<>();
|
routeIntents = new ConcurrentHashMap<>();
|
||||||
|
|||||||
@ -268,9 +268,9 @@ public class RouterAsyncArpTest extends AbstractIntentTest {
|
|||||||
// Construct the existing MultiPointToSinglePointIntent intent
|
// Construct the existing MultiPointToSinglePointIntent intent
|
||||||
MultiPointToSinglePointIntent intent = staticIntentBuilder();
|
MultiPointToSinglePointIntent intent = staticIntentBuilder();
|
||||||
|
|
||||||
// Set up the bgpRoutes field of Router class with existing route, and
|
// Set up the ribTable field of Router class with existing route, and
|
||||||
// routeIntents field with the corresponding existing intent
|
// routeIntents field with the corresponding existing intent
|
||||||
setBgpRoutesField(routeEntry);
|
setRibTableField(routeEntry);
|
||||||
setRouteIntentsField(routeEntry, intent);
|
setRouteIntentsField(routeEntry, intent);
|
||||||
|
|
||||||
// Start to construct a new route entry and new intent
|
// Start to construct a new route entry and new intent
|
||||||
@ -359,9 +359,9 @@ public class RouterAsyncArpTest extends AbstractIntentTest {
|
|||||||
// Construct the existing MultiPointToSinglePointIntent intent
|
// Construct the existing MultiPointToSinglePointIntent intent
|
||||||
MultiPointToSinglePointIntent intent = staticIntentBuilder();
|
MultiPointToSinglePointIntent intent = staticIntentBuilder();
|
||||||
|
|
||||||
// Set up the bgpRoutes field of Router class with existing route, and
|
// Set up the ribTable field of Router class with existing route, and
|
||||||
// routeIntents field with the corresponding existing intent
|
// routeIntents field with the corresponding existing intent
|
||||||
setBgpRoutesField(routeEntry);
|
setRibTableField(routeEntry);
|
||||||
setRouteIntentsField(routeEntry, intent);
|
setRouteIntentsField(routeEntry, intent);
|
||||||
|
|
||||||
// Set up expectation
|
// Set up expectation
|
||||||
@ -412,19 +412,19 @@ public class RouterAsyncArpTest extends AbstractIntentTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets bgpRoutesField in Router class.
|
* Sets ribTable Field in Router class.
|
||||||
*
|
*
|
||||||
* @throws TestUtilsException
|
* @throws TestUtilsException
|
||||||
*/
|
*/
|
||||||
private void setBgpRoutesField(RouteEntry routeEntry)
|
private void setRibTableField(RouteEntry routeEntry)
|
||||||
throws TestUtilsException {
|
throws TestUtilsException {
|
||||||
|
|
||||||
InvertedRadixTree<RouteEntry> bgpRoutes =
|
InvertedRadixTree<RouteEntry> ribTable =
|
||||||
new ConcurrentInvertedRadixTree<>(
|
new ConcurrentInvertedRadixTree<>(
|
||||||
new DefaultByteArrayNodeFactory());
|
new DefaultByteArrayNodeFactory());
|
||||||
bgpRoutes.put(RouteEntry.createBinaryString(routeEntry.prefix()),
|
ribTable.put(RouteEntry.createBinaryString(routeEntry.prefix()),
|
||||||
routeEntry);
|
routeEntry);
|
||||||
TestUtils.setField(router, "bgpRoutes", bgpRoutes);
|
TestUtils.setField(router, "ribTable", ribTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user