Path Computation Algorithms assume that Unreserved Bandwidth values are
ordered by Class-Type priority which could be wrong. This patch set correct
this issue by searching the correct Unreserved Bandwidth value that corresponds
to the Class-Type instead of directly addressing the Unreserved Bandwidth list
with the Class-Type as index.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I02c03c18cfe2eee2451f05739bf6df9ce6995a38
(cherry picked from commit
0d9eadca7b948a6090130de51f80eac845afbf9d)
import org.opendaylight.graph.ConnectedGraph;
import org.opendaylight.graph.ConnectedVertex;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.edge.EdgeAttributes;
import org.opendaylight.graph.ConnectedGraph;
import org.opendaylight.graph.ConnectedVertex;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.edge.EdgeAttributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.edge.attributes.UnreservedBandwidth;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.VertexKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.VertexKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
return true;
} else {
Long bandwidth = constraints.getBandwidth().getValue().longValue();
return true;
} else {
Long bandwidth = constraints.getBandwidth().getValue().longValue();
- if (attributes.getUnreservedBandwidth().get(constraints.getClassType().intValue()).getBandwidth()
- .getValue().longValue() < bandwidth
- || attributes.getMaxLinkBandwidth().getValue().longValue() < bandwidth
+ Long unrsv = 0L;
+ for (UnreservedBandwidth unResBw : attributes.getUnreservedBandwidth()) {
+ if (unResBw.getClassType().intValue() == constraints.getClassType().intValue()) {
+ unrsv = unResBw.getBandwidth().getValue().longValue();
+ break;
+ }
+ }
+ if (unrsv < bandwidth || attributes.getMaxLinkBandwidth().getValue().longValue() < bandwidth
|| attributes.getMaxResvLinkBandwidth().getValue().longValue() < bandwidth) {
LOG.debug("Bandwidth constraint is not met");
return true;
|| attributes.getMaxResvLinkBandwidth().getValue().longValue() < bandwidth) {
LOG.debug("Bandwidth constraint is not met");
return true;