Change listener registration to Operation Data Store and DataChangeScope to Base
authorAnil Vishnoi <vishnoianil@gmail.com>
Thu, 19 Mar 2015 20:43:57 +0000 (02:13 +0530)
committerAnil Vishnoi <vishnoianil@gmail.com>
Thu, 19 Mar 2015 20:46:36 +0000 (02:16 +0530)
Changing data change listener registration from config data store to operational
data store, because when ovs node connects to controller inventory manager write
node information to operational data store. I changed the scope of DataChange
from ONE to BASE, because with ONE we are receiving flood of DataChange events,
because of statistics manager write operation to operational data store.

Change-Id: I77b3facc99f375779898d85d42c9f2d4822d4f99
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/FlowCapableNodeDataChangeListener.java

index 878a0f29f87fde28dae5145acf1b9010c9b10365..02b649ed45568f812afb42063e393dc3252f801a 100644 (file)
@@ -49,8 +49,8 @@ public class FlowCapableNodeDataChangeListener implements DataChangeListener, Au
 
     public FlowCapableNodeDataChangeListener (DataBroker dataBroker) {
         LOG.info("Registering FlowCapableNodeChangeListener");
-        registration = dataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                createFlowCapableNodePath(), this, AsyncDataBroker.DataChangeScope.ONE);
+        registration = dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
+                createFlowCapableNodePath(), this, AsyncDataBroker.DataChangeScope.BASE);
     }
 
     @Override
@@ -88,7 +88,7 @@ public class FlowCapableNodeDataChangeListener implements DataChangeListener, Au
         for (Map.Entry<InstanceIdentifier<?>, DataObject> updated : changes.getUpdatedData().entrySet()) {
             InstanceIdentifier<?> iID = updated.getKey();
             String openflowId = iID.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
-            LOG.trace(">>>>> updated iiD: {} - first: {} - NodeKey: {}",
+            LOG.info(">>>>> updated iiD: {} - first: {} - NodeKey: {}",
                     iID, iID.firstIdentifierOf(Node.class), openflowId);
             Node openFlowNode = NodeUtils.getOpenFlowNode(openflowId);
             if (nodeCache.contains(openFlowNode)) {
@@ -101,7 +101,7 @@ public class FlowCapableNodeDataChangeListener implements DataChangeListener, Au
 
     private void notifyNodeUpdated (Node openFlowNode) {
         final String openflowId = openFlowNode.getId().getValue();
-        LOG.trace("notifyNodeUpdated: Node {} from Controller's inventory Service", openflowId);
+        LOG.info("notifyNodeUpdated: Node {} from Controller's inventory Service", openflowId);
 
         // TODO: will do something amazing here, someday
     }