hotfix Bug 1499 - deleted flow still present 88/9788/2
authorVaclav Demcak <vdemcak@cisco.com>
Thu, 7 Aug 2014 13:48:23 +0000 (15:48 +0200)
committeravishnoi <avishnoi@in.ibm.com>
Thu, 14 Aug 2014 13:25:00 +0000 (13:25 +0000)
StatisticManager needs to delete the statistics and the flows too.
* fix a path to delete whole flow (no only statistics)

Note: bugfix could help for bug 1345 too.

Change-Id: I8a8bee995d42daa9f1832cc8e26cc2c02b2e64c1
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/FlowStatsTracker.java

index edf7388a769a662a0ea7848694501c08a864ac0a..1a14de6f5d5b9049e4199ce743fc7ba95ad913e3 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.f
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,11 +53,10 @@ final class FlowStatsTracker extends AbstractListeningStatsTracker<FlowAndStatis
 
     @Override
     protected void cleanupSingleStat(final DataModificationTransaction trans, final FlowStatsEntry item) {
-        InstanceIdentifier<?> flowRef = getNodeIdentifierBuilder()
-                            .augmentation(FlowCapableNode.class)
-                            .child(Table.class, new TableKey(item.getTableId()))
-                            .child(Flow.class,item.getFlow().getKey())
-                            .augmentation(FlowStatisticsData.class).toInstance();
+        KeyedInstanceIdentifier<Flow, FlowKey> flowRef = getNodeIdentifier()
+                .augmentation(FlowCapableNode.class)
+                .child(Table.class, new TableKey(item.getTableId()))
+                .child(Flow.class, item.getFlow().getKey());
         trans.removeOperationalData(flowRef);
     }