Merge "Performance Improvement: Temporal event"
authorJoseph Keenan <joseph.keenan@est.tech>
Fri, 19 Aug 2022 10:48:59 +0000 (10:48 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 19 Aug 2022 10:48:59 +0000 (10:48 +0000)
cps-application/src/main/resources/application.yml
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdogSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy
docs/cps-events.rst

index ea1b93b..1755134 100644 (file)
@@ -107,8 +107,8 @@ notification:
             enabled-dataspaces: ${NOTIFICATION_DATASPACE_FILTER_PATTERNS:""}\r
     async:\r
         executor:\r
-            core-pool-size: 10\r
-            max-pool-size: 100\r
+            core-pool-size: 2\r
+            max-pool-size: 10\r
             queue-capacity: 500\r
             wait-for-tasks-to-complete-on-shutdown: true\r
             thread-name-prefix: Async-\r
index 863977a..81268cb 100644 (file)
 
 package org.onap.cps.ncmp.api.inventory.sync
 
-import org.mockito.Mock
+
 import org.onap.cps.ncmp.api.impl.event.lcm.LcmEventsCmHandleStateHandler
 import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle
 import org.onap.cps.ncmp.api.inventory.CmHandleState
 import org.onap.cps.ncmp.api.inventory.CompositeState
-import org.onap.cps.ncmp.api.inventory.DataStoreSyncState
 import org.onap.cps.ncmp.api.inventory.InventoryPersistence
 import org.onap.cps.ncmp.api.inventory.LockReasonCategory
 import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder
index 82e9d33..fb4ca39 100644 (file)
@@ -62,13 +62,25 @@ class SyncUtilsSpec extends Specification{
     @Shared
     def dataNode = new DataNode(leaves: ['id': 'cm-handle-123'])
 
+    @Shared
+    def dataNodeAdditionalProperties = new DataNode(leaves: ['name': 'dmiProp1', 'value': 'dmiValue1'])
+
+
     def 'Get an advised Cm-Handle where ADVISED cm handle #scenario'() {
         given: 'the inventory persistence service returns a collection of data nodes'
             mockCmHandleQueries.getCmHandlesByState(CmHandleState.ADVISED) >> dataNodeCollection
+        and: 'we have some additional (dmi, private) properties'
+            dataNodeAdditionalProperties.xpath = dataNode.xpath + '/additional-properties[@name="dmiProp1"]'
+            dataNode.childDataNodes = [dataNodeAdditionalProperties]
         when: 'get advised cm handles are fetched'
             def yangModelCmHandles = objectUnderTest.getAdvisedCmHandles()
         then: 'the returned data node collection is the correct size'
             yangModelCmHandles.size() == expectedDataNodeSize
+        and: 'if there is a data node the additional (dmi, private) properties are included'
+            if (expectedDataNodeSize > 0) {
+                assert yangModelCmHandles[0].dmiProperties[0].name == 'dmiProp1'
+                assert yangModelCmHandles[0].dmiProperties[0].value == 'dmiValue1'
+            }
         and: 'yang model collection contains the correct data'
             yangModelCmHandles.stream().map(yangModel -> yangModel.id).collect(Collectors.toSet()) ==
                 dataNodeCollection.stream().map(dataNode -> dataNode.leaves.get("id")).collect(Collectors.toSet())
index a28d4b0..34b5a5f 100644 (file)
@@ -8,12 +8,6 @@
 CPS Events
 ##########
 
-CPS Core
-********
-..
-   Cps core events yet to be written
-
-
 CPS-NCMP
 ********
 
@@ -23,16 +17,7 @@ Lifecycle Management (LCM) Event
 
 Overview
 --------
-Lifecycle management events are published as cm handle state transitions from one state to another.
-
-
-LCM events and state handler
-----------------------------
-The LCM events are triggered under the state handler which has the following responsibilities:
-
-#. Updating and persisting cm handle state based on the target state of the cm handle
-
-#. Create and calls to publish the LCM event based on the cm handle state transition that occured
+LCM events for CM Handles are published when a CM Handle is created, deleted or another change in the cm handle state occurs.
 
        **3 possible event types:**
 
@@ -40,8 +25,6 @@ The LCM events are triggered under the state handler which has the following res
        * Update
        * Delete
 
-
-
 LCM Event Schema
 ----------------
 The current published LCM event is based on the following schema: