Naming convention
Change-Id: I2e2bbce6397dd95e841bcdc67ee125c1626671b3
diff --git a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index e645165..b3e432c 100644
--- a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -44,8 +44,8 @@
private SegmentRoutingManager srManager;
private RoutingRulePopulator rulePopulator;
- private HashMap<DeviceId, ECMPShortestPathGraph> currentEcmpSpgMap;
- private HashMap<DeviceId, ECMPShortestPathGraph> updatedEcmpSpgMap;
+ private HashMap<DeviceId, EcmpShortestPathGraph> currentEcmpSpgMap;
+ private HashMap<DeviceId, EcmpShortestPathGraph> updatedEcmpSpgMap;
private DeviceConfiguration config;
private final Lock statusLock = new ReentrantLock();
private volatile Status populationStatus;
@@ -103,7 +103,7 @@
continue;
}
- ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(sw.id(), srManager);
+ EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(sw.id(), srManager);
if (!populateEcmpRoutingRules(sw.id(), ecmpSpg)) {
log.debug("populateAllRoutingRules: populationStatus is ABORTED");
populationStatus = Status.ABORTED;
@@ -149,8 +149,8 @@
if (!srManager.mastershipService.isLocalMaster(sw.id())) {
continue;
}
- ECMPShortestPathGraph ecmpSpgUpdated =
- new ECMPShortestPathGraph(sw.id(), srManager);
+ EcmpShortestPathGraph ecmpSpgUpdated =
+ new EcmpShortestPathGraph(sw.id(), srManager);
updatedEcmpSpgMap.put(sw.id(), ecmpSpgUpdated);
}
@@ -200,7 +200,7 @@
// When only the source device is defined, reinstall routes to all other devices
if (link.size() == 1) {
log.trace("repopulateRoutingRulesForRoutes: running ECMP graph for device {}", link.get(0));
- ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(link.get(0), srManager);
+ EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(link.get(0), srManager);
if (populateEcmpRoutingRules(link.get(0), ecmpSpg)) {
log.debug("Populating flow rules from {} to all is successful",
link.get(0));
@@ -228,7 +228,7 @@
link.get(0), link.get(1));
DeviceId src = link.get(0);
DeviceId dst = link.get(1);
- ECMPShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst);
+ EcmpShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst);
HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
ecmpSpg.getAllLearnedSwitchesAndVia();
for (Integer itrIdx : switchVia.keySet()) {
@@ -275,7 +275,7 @@
if (!srManager.mastershipService.isLocalMaster(sw.id())) {
continue;
}
- ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
+ EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
if (ecmpSpg == null) {
log.error("No existing ECMP graph for switch {}", sw.id());
continue;
@@ -330,7 +330,7 @@
}
log.debug("Checking route change for switch {}", sw.id());
- ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
+ EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
if (ecmpSpg == null) {
log.debug("No existing ECMP graph for device {}", sw.id());
ArrayList<DeviceId> route = new ArrayList<>();
@@ -338,7 +338,7 @@
routes.add(route);
continue;
}
- ECMPShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id());
+ EcmpShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id());
//currentEcmpSpgMap.put(sw.id(), newEcmpSpg);
HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
ecmpSpg.getAllLearnedSwitchesAndVia();
@@ -414,7 +414,7 @@
}
private boolean populateEcmpRoutingRules(DeviceId destSw,
- ECMPShortestPathGraph ecmpSPG) {
+ EcmpShortestPathGraph ecmpSPG) {
HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = ecmpSPG
.getAllLearnedSwitchesAndVia();
diff --git a/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java b/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
similarity index 98%
rename from src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
rename to src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
index e9a59ba..4fd5991 100644
--- a/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
+++ b/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
@@ -36,7 +36,7 @@
* calculated. The paths are snapshot paths at the point of the class
* instantiation.
*/
-public class ECMPShortestPathGraph {
+public class EcmpShortestPathGraph {
LinkedList<DeviceId> deviceQueue = new LinkedList<>();
LinkedList<Integer> distanceQueue = new LinkedList<>();
HashMap<DeviceId, Integer> deviceSearched = new HashMap<>();
@@ -46,7 +46,7 @@
DeviceId rootDevice;
private SegmentRoutingManager srManager;
private static final Logger log = LoggerFactory
- .getLogger(ECMPShortestPathGraph.class);
+ .getLogger(EcmpShortestPathGraph.class);
/**
* Constructor.
@@ -55,7 +55,7 @@
* @param linkListToAvoid link list to avoid
* @param deviceIdListToAvoid device list to avoid
*/
- public ECMPShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid,
+ public EcmpShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid,
List<Link> linkListToAvoid) {
this.rootDevice = rootDevice;
calcECMPShortestPathGraph(deviceIdListToAvoid, linkListToAvoid);
@@ -67,7 +67,7 @@
* @param rootDevice root of the BFS tree
* @param srManager SegmentRoutingManager object
*/
- public ECMPShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) {
+ public EcmpShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) {
this.rootDevice = rootDevice;
this.srManager = srManager;
calcECMPShortestPathGraph();