More helpful debug logging for AnalyticsManager. 28/1728/1
authorKatrina LaCurts <katrina.lacurts@plexxi.com>
Mon, 7 Oct 2013 15:50:33 +0000 (11:50 -0400)
committerKatrina LaCurts <katrina.lacurts@plexxi.com>
Mon, 7 Oct 2013 15:50:33 +0000 (11:50 -0400)
Signed-off-by: Katrina LaCurts <katrina.lacurts@plexxi.com>
analytics/implementation/src/main/java/org/opendaylight/affinity/analytics/internal/AnalyticsManager.java

index 79d73c388210c4582b72da04e2fb54d8766d07f6..859b348d5907969925de7757b0555e363476cbfb 100644 (file)
@@ -257,8 +257,18 @@ public class AnalyticsManager implements IReadServiceListener, IAnalyticsManager
             Host srcHost = getSourceHostFromFlow(f.getFlow(), allHosts);
             Host dstHost = getDestinationHostFromFlow(f.getFlow(), allHosts);
 
-            if (srcHost == null || dstHost == null) {
-                log.debug("Error: source or destination is null in nodeFlowStatisticsUpdated");
+            // Source host being null is okay; it indicates that the
+            // source of this particular flow is a switch, not a host.
+            //
+            // TODO: It would be useful, at least for debugging
+            // output, to differentiate between when the source is a
+            // switch and when it's a host that the hosttracker
+            // doesn't know about. The latter would be an error.
+            if (srcHost == null) {
+                log.debug("Source host is null for Flow " + f.getFlow() + ". This is NOT necessarily an error.");
+                continue;
+            } else if (dstHost == null) {
+                log.debug("Error: Destination host is null for Flow " + f.getFlow());
                 continue;
             }