Shashikanth VH
Committed by Gerrit Code Review

Naming convention

Change-Id: I2e2bbce6397dd95e841bcdc67ee125c1626671b3
...@@ -44,8 +44,8 @@ public class DefaultRoutingHandler { ...@@ -44,8 +44,8 @@ public class DefaultRoutingHandler {
44 44
45 private SegmentRoutingManager srManager; 45 private SegmentRoutingManager srManager;
46 private RoutingRulePopulator rulePopulator; 46 private RoutingRulePopulator rulePopulator;
47 - private HashMap<DeviceId, ECMPShortestPathGraph> currentEcmpSpgMap; 47 + private HashMap<DeviceId, EcmpShortestPathGraph> currentEcmpSpgMap;
48 - private HashMap<DeviceId, ECMPShortestPathGraph> updatedEcmpSpgMap; 48 + private HashMap<DeviceId, EcmpShortestPathGraph> updatedEcmpSpgMap;
49 private DeviceConfiguration config; 49 private DeviceConfiguration config;
50 private final Lock statusLock = new ReentrantLock(); 50 private final Lock statusLock = new ReentrantLock();
51 private volatile Status populationStatus; 51 private volatile Status populationStatus;
...@@ -103,7 +103,7 @@ public class DefaultRoutingHandler { ...@@ -103,7 +103,7 @@ public class DefaultRoutingHandler {
103 continue; 103 continue;
104 } 104 }
105 105
106 - ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(sw.id(), srManager); 106 + EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(sw.id(), srManager);
107 if (!populateEcmpRoutingRules(sw.id(), ecmpSpg)) { 107 if (!populateEcmpRoutingRules(sw.id(), ecmpSpg)) {
108 log.debug("populateAllRoutingRules: populationStatus is ABORTED"); 108 log.debug("populateAllRoutingRules: populationStatus is ABORTED");
109 populationStatus = Status.ABORTED; 109 populationStatus = Status.ABORTED;
...@@ -149,8 +149,8 @@ public class DefaultRoutingHandler { ...@@ -149,8 +149,8 @@ public class DefaultRoutingHandler {
149 if (!srManager.mastershipService.isLocalMaster(sw.id())) { 149 if (!srManager.mastershipService.isLocalMaster(sw.id())) {
150 continue; 150 continue;
151 } 151 }
152 - ECMPShortestPathGraph ecmpSpgUpdated = 152 + EcmpShortestPathGraph ecmpSpgUpdated =
153 - new ECMPShortestPathGraph(sw.id(), srManager); 153 + new EcmpShortestPathGraph(sw.id(), srManager);
154 updatedEcmpSpgMap.put(sw.id(), ecmpSpgUpdated); 154 updatedEcmpSpgMap.put(sw.id(), ecmpSpgUpdated);
155 } 155 }
156 156
...@@ -200,7 +200,7 @@ public class DefaultRoutingHandler { ...@@ -200,7 +200,7 @@ public class DefaultRoutingHandler {
200 // When only the source device is defined, reinstall routes to all other devices 200 // When only the source device is defined, reinstall routes to all other devices
201 if (link.size() == 1) { 201 if (link.size() == 1) {
202 log.trace("repopulateRoutingRulesForRoutes: running ECMP graph for device {}", link.get(0)); 202 log.trace("repopulateRoutingRulesForRoutes: running ECMP graph for device {}", link.get(0));
203 - ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(link.get(0), srManager); 203 + EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(link.get(0), srManager);
204 if (populateEcmpRoutingRules(link.get(0), ecmpSpg)) { 204 if (populateEcmpRoutingRules(link.get(0), ecmpSpg)) {
205 log.debug("Populating flow rules from {} to all is successful", 205 log.debug("Populating flow rules from {} to all is successful",
206 link.get(0)); 206 link.get(0));
...@@ -228,7 +228,7 @@ public class DefaultRoutingHandler { ...@@ -228,7 +228,7 @@ public class DefaultRoutingHandler {
228 link.get(0), link.get(1)); 228 link.get(0), link.get(1));
229 DeviceId src = link.get(0); 229 DeviceId src = link.get(0);
230 DeviceId dst = link.get(1); 230 DeviceId dst = link.get(1);
231 - ECMPShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst); 231 + EcmpShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst);
232 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = 232 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
233 ecmpSpg.getAllLearnedSwitchesAndVia(); 233 ecmpSpg.getAllLearnedSwitchesAndVia();
234 for (Integer itrIdx : switchVia.keySet()) { 234 for (Integer itrIdx : switchVia.keySet()) {
...@@ -275,7 +275,7 @@ public class DefaultRoutingHandler { ...@@ -275,7 +275,7 @@ public class DefaultRoutingHandler {
275 if (!srManager.mastershipService.isLocalMaster(sw.id())) { 275 if (!srManager.mastershipService.isLocalMaster(sw.id())) {
276 continue; 276 continue;
277 } 277 }
278 - ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id()); 278 + EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
279 if (ecmpSpg == null) { 279 if (ecmpSpg == null) {
280 log.error("No existing ECMP graph for switch {}", sw.id()); 280 log.error("No existing ECMP graph for switch {}", sw.id());
281 continue; 281 continue;
...@@ -330,7 +330,7 @@ public class DefaultRoutingHandler { ...@@ -330,7 +330,7 @@ public class DefaultRoutingHandler {
330 } 330 }
331 331
332 log.debug("Checking route change for switch {}", sw.id()); 332 log.debug("Checking route change for switch {}", sw.id());
333 - ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id()); 333 + EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
334 if (ecmpSpg == null) { 334 if (ecmpSpg == null) {
335 log.debug("No existing ECMP graph for device {}", sw.id()); 335 log.debug("No existing ECMP graph for device {}", sw.id());
336 ArrayList<DeviceId> route = new ArrayList<>(); 336 ArrayList<DeviceId> route = new ArrayList<>();
...@@ -338,7 +338,7 @@ public class DefaultRoutingHandler { ...@@ -338,7 +338,7 @@ public class DefaultRoutingHandler {
338 routes.add(route); 338 routes.add(route);
339 continue; 339 continue;
340 } 340 }
341 - ECMPShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id()); 341 + EcmpShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id());
342 //currentEcmpSpgMap.put(sw.id(), newEcmpSpg); 342 //currentEcmpSpgMap.put(sw.id(), newEcmpSpg);
343 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = 343 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
344 ecmpSpg.getAllLearnedSwitchesAndVia(); 344 ecmpSpg.getAllLearnedSwitchesAndVia();
...@@ -414,7 +414,7 @@ public class DefaultRoutingHandler { ...@@ -414,7 +414,7 @@ public class DefaultRoutingHandler {
414 } 414 }
415 415
416 private boolean populateEcmpRoutingRules(DeviceId destSw, 416 private boolean populateEcmpRoutingRules(DeviceId destSw,
417 - ECMPShortestPathGraph ecmpSPG) { 417 + EcmpShortestPathGraph ecmpSPG) {
418 418
419 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = ecmpSPG 419 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = ecmpSPG
420 .getAllLearnedSwitchesAndVia(); 420 .getAllLearnedSwitchesAndVia();
......
...@@ -36,7 +36,7 @@ import java.util.List; ...@@ -36,7 +36,7 @@ import java.util.List;
36 * calculated. The paths are snapshot paths at the point of the class 36 * calculated. The paths are snapshot paths at the point of the class
37 * instantiation. 37 * instantiation.
38 */ 38 */
39 -public class ECMPShortestPathGraph { 39 +public class EcmpShortestPathGraph {
40 LinkedList<DeviceId> deviceQueue = new LinkedList<>(); 40 LinkedList<DeviceId> deviceQueue = new LinkedList<>();
41 LinkedList<Integer> distanceQueue = new LinkedList<>(); 41 LinkedList<Integer> distanceQueue = new LinkedList<>();
42 HashMap<DeviceId, Integer> deviceSearched = new HashMap<>(); 42 HashMap<DeviceId, Integer> deviceSearched = new HashMap<>();
...@@ -46,7 +46,7 @@ public class ECMPShortestPathGraph { ...@@ -46,7 +46,7 @@ public class ECMPShortestPathGraph {
46 DeviceId rootDevice; 46 DeviceId rootDevice;
47 private SegmentRoutingManager srManager; 47 private SegmentRoutingManager srManager;
48 private static final Logger log = LoggerFactory 48 private static final Logger log = LoggerFactory
49 - .getLogger(ECMPShortestPathGraph.class); 49 + .getLogger(EcmpShortestPathGraph.class);
50 50
51 /** 51 /**
52 * Constructor. 52 * Constructor.
...@@ -55,7 +55,7 @@ public class ECMPShortestPathGraph { ...@@ -55,7 +55,7 @@ public class ECMPShortestPathGraph {
55 * @param linkListToAvoid link list to avoid 55 * @param linkListToAvoid link list to avoid
56 * @param deviceIdListToAvoid device list to avoid 56 * @param deviceIdListToAvoid device list to avoid
57 */ 57 */
58 - public ECMPShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid, 58 + public EcmpShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid,
59 List<Link> linkListToAvoid) { 59 List<Link> linkListToAvoid) {
60 this.rootDevice = rootDevice; 60 this.rootDevice = rootDevice;
61 calcECMPShortestPathGraph(deviceIdListToAvoid, linkListToAvoid); 61 calcECMPShortestPathGraph(deviceIdListToAvoid, linkListToAvoid);
...@@ -67,7 +67,7 @@ public class ECMPShortestPathGraph { ...@@ -67,7 +67,7 @@ public class ECMPShortestPathGraph {
67 * @param rootDevice root of the BFS tree 67 * @param rootDevice root of the BFS tree
68 * @param srManager SegmentRoutingManager object 68 * @param srManager SegmentRoutingManager object
69 */ 69 */
70 - public ECMPShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) { 70 + public EcmpShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) {
71 this.rootDevice = rootDevice; 71 this.rootDevice = rootDevice;
72 this.srManager = srManager; 72 this.srManager = srManager;
73 calcECMPShortestPathGraph(); 73 calcECMPShortestPathGraph();
......