[VOL-3001] Separating flows, groups and meters from LogicalDevice.
- This is to improve the performance of flow addition to system.
- This patch does not include separation of the flows from Device. It will be implemented in another patch.
- Flows, groups and meters are kept in store by their unique ids per logical device, and cached into a map with these unique ids per logical device again.
Accessing to this store and map is synchronized by a RWLock.
Also a lock is kept in memory per flow, meter and group to synchronize the modifications (add/modify/delete requests) per flow/meter/group.
Change-Id: Ic0135faef0bbd1664693375fa6527e0242919e6d
diff --git a/rw_core/core/api/grpc_nbi_handler_test.go b/rw_core/core/api/grpc_nbi_handler_test.go
index 2a3e71e..fa1f657 100755
--- a/rw_core/core/api/grpc_nbi_handler_test.go
+++ b/rw_core/core/api/grpc_nbi_handler_test.go
@@ -989,7 +989,8 @@
}
// Wait for logical device to have the flows (or none
var vlFunction isLogicalDevicesConditionSatisfied = func(lds *voltha.LogicalDevices) bool {
- return lds != nil && len(lds.Items) == 1 && len(lds.Items[0].Flows.Items) == expectedNumFlows
+ flows, _ := nbi.ListLogicalDeviceFlows(getContext(), &voltha.ID{Id: lds.Items[0].Id})
+ return lds != nil && len(lds.Items) == 1 && len(flows.Items) == expectedNumFlows
}
// No timeout implies a success
err := waitUntilConditionForLogicalDevices(nb.maxTimeout, nbi, vlFunction)