Package org.opendaylight.algo.impl
Class AbstractPathComputation
- java.lang.Object
-
- org.opendaylight.algo.impl.AbstractPathComputation
-
- All Implemented Interfaces:
PathComputationAlgorithm
- Direct Known Subclasses:
ConstrainedShortestPathFirst
,Samcra
,ShortestPathFirst
public abstract class AbstractPathComputation extends Object implements PathComputationAlgorithm
-
-
Field Summary
Fields Modifier and Type Field Description protected PathConstraints
constraints
protected ConnectedGraph
graph
protected CspfPath
pathDestination
protected CspfPath
pathSource
protected PriorityQueue<CspfPath>
priorityQueue
protected HashMap<Long,CspfPath>
processedPath
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPathComputation(ConnectedGraph graph)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ConstrainedPath
computeP2pPath(VertexKey source, VertexKey destination, PathConstraints constraints)
Compute Point to Point Path from source to destination taking into account constraints.protected @Nullable MplsLabel
getIpv4NodeSid(ConnectedVertex cvertex)
Return the MPLS Label corresponding to the Node SID for IPv4 when the Connected Vertex is Segment Routing aware.protected @Nullable MplsLabel
getIpv6NodeSid(ConnectedVertex cvertex)
Return the MPLS Label corresponding to the Node SID for IPv6 when the Connected Vertex is Segment Routing aware.protected List<PathDescription>
getPathDescription(List<ConnectedEdge> edges)
Convert List of Connected Edges into a Path Description as a List of IPv4, IPv6 or MPLS Label depending of the requested Address Family.protected ConstrainedPathBuilder
initializePathComputation(VertexKey src, VertexKey dst)
Initialize the various parameters for Path Computation, in particular the Source and Destination CspfPath.protected boolean
pruneEdge(ConnectedEdge edge, CspfPath path)
Check if Edge need to be prune regarding all constraints including address family.
-
-
-
Field Detail
-
graph
protected final ConnectedGraph graph
-
pathSource
protected CspfPath pathSource
-
pathDestination
protected CspfPath pathDestination
-
constraints
protected PathConstraints constraints
-
priorityQueue
protected PriorityQueue<CspfPath> priorityQueue
-
-
Constructor Detail
-
AbstractPathComputation
protected AbstractPathComputation(ConnectedGraph graph)
-
-
Method Detail
-
initializePathComputation
protected ConstrainedPathBuilder initializePathComputation(VertexKey src, VertexKey dst)
Initialize the various parameters for Path Computation, in particular the Source and Destination CspfPath.- Parameters:
src
- Source Vertex Identifier in the Connected Graphdst
- Destination Vertex Identifier in the Connected Graph- Returns:
- Constrained Path Builder with status set to 'OnGoing' if initialization success, 'Failed' otherwise
-
pruneEdge
protected boolean pruneEdge(ConnectedEdge edge, CspfPath path)
Check if Edge need to be prune regarding all constraints including address family.- Returns:
- True if Edge must be prune, False if Edge must be keep
-
getIpv4NodeSid
protected @Nullable MplsLabel getIpv4NodeSid(ConnectedVertex cvertex)
Return the MPLS Label corresponding to the Node SID for IPv4 when the Connected Vertex is Segment Routing aware.- Returns:
- MPLS Label if Connected Vertex is Segment Routing aware, Null otherwise
-
getIpv6NodeSid
protected @Nullable MplsLabel getIpv6NodeSid(ConnectedVertex cvertex)
Return the MPLS Label corresponding to the Node SID for IPv6 when the Connected Vertex is Segment Routing aware.- Returns:
- MPLS Label if Connected Vertex is Segment Routing aware, Null otherwise
-
getPathDescription
protected List<PathDescription> getPathDescription(List<ConnectedEdge> edges)
Convert List of Connected Edges into a Path Description as a List of IPv4, IPv6 or MPLS Label depending of the requested Address Family.- Parameters:
edges
- List of Connected Edges- Returns:
- Path Description
-
computeP2pPath
public abstract ConstrainedPath computeP2pPath(VertexKey source, VertexKey destination, PathConstraints constraints)
Description copied from interface:PathComputationAlgorithm
Compute Point to Point Path from source to destination taking into account constraints.- Specified by:
computeP2pPath
in interfacePathComputationAlgorithm
- Parameters:
source
- Source Vertex Keydestination
- Destination Vertex Keyconstraints
- Constraints (Metric, TE Metric, Delay, Jitter, Loss, Bandwidth)- Returns:
- A Path that meet constraints or empty path otherwise. ConstrainedPath.Status indicates the result of the path computation (Completed or Failed)
-
-