Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: Windows
Platform: PC
-
902
Description
I have an ODL controller running with 198 nodes; each node with 104 NodeConnectors.
My code queries each of the 198 nodes for the nodeConnectors using the following code:
public static List<NodeConnector> getNodeConnectors(DataProviderService dps, String nodeId) {
// Create a Type-safe reader so that casting isn't necessary.
TypeSafeDataReader reader = TypeSafeDataReader.forReader(dps);
// Create the inventory node Id key:
NodeId inventoryNodeId = new NodeId(nodeId);
NodeKey inventoryNodeKey = new NodeKey(inventoryNodeId);
// Get the child node Id:
InstanceIdentifierBuilder<Node> nodeChild = InstanceIdentifier.builder(Nodes.class).child(Node.class,
inventoryNodeKey);
InstanceIdentifier<Node> nodePath = nodeChild.toInstance();
// Read the node from the Operational Data store:
Node node = reader.readOperationalData(nodePath);
if (node == null)
{ throw new RuntimeException("MD-SAL Node not found for nodeId:" + nodeId); } return node.getNodeConnector();
}
This takes about 12 seconds to run on a standard Windows desktop.
An Analysis of the CPU performance using JProfiler shows a very high number of calls to SchemaAwareDataStoreAdapter$MergeFirstLevelReader$2.apply, with the bulk of CPU time spent in this method (specifically Map.equals).
See attachment for screen snapshot of the JProfiler analysis.
For any questions, feel free to contact.