Package org.onosproject.segmentrouting
Class EcmpShortestPathGraph
- java.lang.Object
-
- org.onosproject.segmentrouting.EcmpShortestPathGraph
-
public class EcmpShortestPathGraph extends Object
This class creates breadth-first-search (BFS) tree for a given root device and returns paths from the root Device to leaf Devices (target devices). The paths are snapshot paths at the point of the class instantiation.
-
-
Constructor Summary
Constructors Constructor Description EcmpShortestPathGraph(org.onosproject.net.DeviceId rootDevice, SegmentRoutingManager srManager)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashMap<Integer,HashMap<org.onosproject.net.DeviceId,ArrayList<ArrayList<org.onosproject.net.DeviceId>>>>getAllLearnedSwitchesAndVia()Returns the complete info of the computed ECMP paths for each target device learned in multiple iterations from the root Device.HashMap<Integer,HashMap<org.onosproject.net.DeviceId,ArrayList<org.onosproject.net.Path>>>getCompleteLearnedDeviceesAndPaths()Return the complete info of the computed ECMP paths for each Device learned in multiple iterations from the root Device.ArrayList<org.onosproject.net.Path>getECMPPaths(org.onosproject.net.DeviceId targetDevice)Return the computed ECMP paths from the root Device to a given Device in the network.org.onosproject.net.DeviceIdgetRootDevice()Return root Device for the graph.StringtoString()
-
-
-
Constructor Detail
-
EcmpShortestPathGraph
public EcmpShortestPathGraph(org.onosproject.net.DeviceId rootDevice, SegmentRoutingManager srManager)Constructor.- Parameters:
rootDevice- root of the BFS treesrManager- SegmentRoutingManager object
-
-
Method Detail
-
getRootDevice
public org.onosproject.net.DeviceId getRootDevice()
Return root Device for the graph.- Returns:
- root Device
-
getECMPPaths
public ArrayList<org.onosproject.net.Path> getECMPPaths(org.onosproject.net.DeviceId targetDevice)
Return the computed ECMP paths from the root Device to a given Device in the network.- Parameters:
targetDevice- the target Device- Returns:
- the list of ECMP Paths from the root Device to the target Device
-
getCompleteLearnedDeviceesAndPaths
public HashMap<Integer,HashMap<org.onosproject.net.DeviceId,ArrayList<org.onosproject.net.Path>>> getCompleteLearnedDeviceesAndPaths()
Return the complete info of the computed ECMP paths for each Device learned in multiple iterations from the root Device.- Returns:
- the hash table of Devices learned in multiple Dijkstra iterations and corresponding ECMP paths to it from the root Device
-
getAllLearnedSwitchesAndVia
public HashMap<Integer,HashMap<org.onosproject.net.DeviceId,ArrayList<ArrayList<org.onosproject.net.DeviceId>>>> getAllLearnedSwitchesAndVia()
Returns the complete info of the computed ECMP paths for each target device learned in multiple iterations from the root Device. The computed info returned is per iteration (Integer key of outer HashMap). In each iteration, for the target devices reached (DeviceId key of inner HashMap), the ECMP paths are detailed (2D array).- Returns:
- the hash table of target Devices learned in multiple Dijkstra iterations and corresponding ECMP paths in terms of Devices to be traversed (via) from the root Device to the target Device
-
-