From e069a67938c03ffac351b8fddaa2cc09cab1be88 Mon Sep 17 00:00:00 2001 From: Madhavan Kasthurirangan Date: Tue, 16 Apr 2013 12:47:07 -0700 Subject: [PATCH] Fix comments in Path.java. Also, Max Throughput dijkstra modification. Signed-off-by: Madhavan Kasthurirangan --- .../internal/DijkstraImplementation.java | 22 ++++++------------- .../controller/sal/core/Path.java | 12 +++++----- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java b/opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java index 05ec5d4053..64cc3fbe01 100644 --- a/opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java +++ b/opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java @@ -111,22 +111,14 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware { .getNodeConnectorProp(dstNC, Bandwidth.BandwidthPropName); - if ((bwSrc == null) || (bwDst == null)) { - log.error("bwSrc:{} or bwDst:{} is null", bwSrc, bwDst); - return (double) -1; - } - - long srcLinkSpeed = bwSrc.getValue(); - if (srcLinkSpeed == 0) { - log.trace("Edge {}: srcLinkSpeed is 0. Setting to {}!", - e, DEFAULT_LINK_SPEED); - srcLinkSpeed = DEFAULT_LINK_SPEED; + long srcLinkSpeed = 0, dstLinkSpeed = 0; + if ((bwSrc == null) || ((srcLinkSpeed = bwSrc.getValue()) == 0)) { + log.debug("srcNC: {} - Setting srcLinkSpeed to Default!",srcNC); + srcLinkSpeed = DEFAULT_LINK_SPEED; } - - long dstLinkSpeed = bwDst.getValue(); - if (dstLinkSpeed == 0) { - log.trace("Edge {}: dstLinkSpeed is 0. Setting to {}!", - e, DEFAULT_LINK_SPEED); + + if ((bwDst == null) || ((dstLinkSpeed = bwDst.getValue()) == 0)) { + log.debug("dstNC: {} - Setting dstLinkSpeed to Default!",dstNC); dstLinkSpeed = DEFAULT_LINK_SPEED; } diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Path.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Path.java index 5584cd9461..5f2dc92aee 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Path.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Path.java @@ -11,7 +11,7 @@ * @file Path.java * * @brief Describe a path as a sequence of Edge such that from - * each of its Tail Node there is an link to the next Head Node in the sequence + * each of its Head Node there is an link to the next Tail Node in the sequence * */ package org.opendaylight.controller.sal.core; @@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlElement; /** * Describe a path as a sequence of Edge such that from - * each of its Tail Node there is an link to the next Head Node in the + * each of its Head Node there is an link to the next Tail Node in the * sequence * */ @@ -50,15 +50,15 @@ public class Path implements Serializable { /** * Construct an object representing a path, the constructor will * check if the passed list of edges is such that for every - * consecutive edges the tailnode of the first edge coincide with - * the head node of the subsequent in order for connectivity to be there. + * consecutive edges the head node of the first edge coincide with + * the tail node of the subsequent in order for connectivity to be there. * * @param edges Edges of the path * */ public Path(List edges) throws ConstructionException { - // Lets check if the list of edges is such that the tail node - // of an edge is also the head node of the subsequent one + // Lets check if the list of edges is such that the head node + // of an edge is also the tail node of the subsequent one boolean sequential = true; if (edges.size() >= 2) { for (int i = 0; i < edges.size() - 1; i++) { -- 2.36.6