BUG-2078 Stats not being collected from all nodes, dangling nodes left in oper data...
[controller.git] / opendaylight / md-sal / statistics-manager / src / main / java / org / opendaylight / controller / md / statistics / manager / impl / StatListenCommitGroup.java
index 41d97f080a4f9f001782298bb4795b835c1c473d..f351132f7f816bcc98151e9e6cb991c7ea911310 100644 (file)
@@ -155,7 +155,7 @@ public class StatListenCommitGroup extends StatAbstractListenCommit<Group, Opend
                     LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
                 }
                 if (node.isPresent()) {
-                    tx.put(LogicalDatastoreType.OPERATIONAL, groupFeatureIdent, stats, true);
+                    tx.put(LogicalDatastoreType.OPERATIONAL, groupFeatureIdent, stats);
                 }
             }
         });
@@ -225,7 +225,7 @@ public class StatListenCommitGroup extends StatAbstractListenCommit<Group, Opend
                 LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
             }
             if (fNode.isPresent()) {
-                trans.put(LogicalDatastoreType.OPERATIONAL, gsIdent, stats, true);
+                trans.put(LogicalDatastoreType.OPERATIONAL, gsIdent, stats);
             }
         }
     }
@@ -271,8 +271,8 @@ public class StatListenCommitGroup extends StatAbstractListenCommit<Group, Opend
             LOG.trace("Read Operational/DS for FlowCapableNode fail! Node {} doesn't exist.", fNodeIdent);
             return;
         }
-        final List<Group> existGroups = fNode.get().getGroup().isEmpty()
-                ? Collections.<Group> emptyList() : fNode.get().getGroup();
+        final List<Group> existGroups = fNode.get().getGroup() != null
+                ? fNode.get().getGroup() : Collections.<Group> emptyList();
         /* Add all existed groups paths - no updated paths has to be removed */
         for (final Group group : existGroups) {
             if (deviceGroupKeys.remove(group.getKey())) {