summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
AgeCommit message (Collapse)AuthorFilesLines
2022-09-06Merge "Code to Interface : InventoryPersistence"Toine Siebelink2-127/+208
2022-09-06Minor code change from POC ||sourabh_sourabh1-0/+3
-Explicitly use YangModelCmHandle#id to computing equals and hashcode Issue-ID: CPS-1126 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ib5332843c71522a85640f225298b680d4cd29557
2022-09-05Code to Interface : InventoryPersistencempriyank2-127/+208
- Extracted interface for InventoryPersistence using automatic extraction of IDE. - We call the InventoryPersistence to InventoryPersistenceImpl - Used the correct type in the test Issue-ID: CPS-1241 Change-Id: Ieceaec69c1063d7762abc7d8e389d36011a93860 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-05Performance Improvement: Fix Insert Yang Resource IDs (Schemset)ToineSiebelink1-13/+7
- Add robustness to handle insertion/get of empty collection - Fix business logic to pass down ALL module references during module Sync - Update Java doc etc to clarify ALL module references are needed (not just new) Issue-ID: CPS-1246 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ic8ff4bdfef646e98ef61a6732c6d5ecb4b762e29
2022-09-02Logging: get resource idsmpriyank1-3/+1
- Added logging while fetching resource ids using Module references. - Minor refactoring related to stream and forEach - Fixed minor sonar violations Issue-ID: CPS-1246 Change-Id: I631d7acd3f29e6bdc2995726e17f40bd7de118b1 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-02Performance Improvement: Use save batches of cmhandlessourabh_sourabh3-23/+31
-Used cm handle batch to persist from state handler. Issue-ID: CPS-1230 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I68b7fde7dc85818b818f1af588344c26b549d87b
2022-09-02Merge "Implement merging all ncmp datastore endpoints into one"Toine Siebelink3-63/+46
2022-09-02Code to Interface: CmHandleQueriesmpriyank2-127/+180
- Extracting the interface CmHandleQueries using IDE intelligence - Used intreface when mocking in the tests Issue-ID: CPS-1240 Change-Id: I5f537eaac992c68b65468e344830a04f1dda7e45 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-01Implement merging all ncmp datastore endpoints into onebmiklos3-63/+46
- Merging all endpoints under /v1/ch/{cm-handle}/data/ds/ncmp-datastore:* to /v1/ch/{cm-handle}/data/ds/{ncmp-datastore-name} - Implementing missing tests from parent - Introducing abstract class to keep the common code and just pass in the supplier to be executed in sync or async manner - Removed the existing get endpoints for passthrough-running, passthrough-operational and operational and merged them into a common get endpoint Issue-ID: CPS-1178 Issue-ID: CPS-1001 Change-Id: I6956c81d5acfa8fb11217bcc16cb795b62070fa3 Signed-off-by: bmiklos <miklos.baranyak@est.tech>
2022-09-01Merge "Get all cm handles by DMI plugin Identifier"Sourabh Sourabh4-7/+105
2022-09-01Merge "Performance Improvement: Enhance state handler"Sourabh Sourabh5-42/+173
2022-09-01Performance Improvement: Enhance state handlermpriyank5-42/+173
- Introduced batch handling capability to state handler - Refactored methods in CompositeStateUtils - Renamed saveCmHandleStates to saveCmHandleStateBatch - Decoupled processing of events in bulk - Test scenarios for the new functionality Issue-ID: CPS-1231 Issue-ID: CPS-1126 Change-Id: Ifacdeb7bbed14712ecf4f5e2a4d9b324bae278d8 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-01Get all cm handles by DMI plugin Identifieremaclee4-7/+105
- api added to get cm handles by dmi plugin identifier - response object refactored from RestOutputCmHandle to collection of Strings (cm handle ids) - added public and private methods in CmHandleQueries to get cm handle ID by dmi plugin - added unit tests including test to show that there are no duplicates on response Issue-ID: CPS-1136 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ia3bdc16172a90ad3a3f9ae11cddcad1352188726
2022-09-01Performance Improvement: Watchdog Parallel execution with configurationsourabh_sourabh3-26/+123
- Introduced AsyncSyncExecutor to get task and execute it with configured number of parallel threads. - Number of parallel thread can be configured from application.yml. - AsyncTaskExecutorSpec is added - Fixed existing grovvy test now async task would be submitted. Issue-ID: CPS-1200 Change-Id: I58c0368b945c90e619c2acfc7458ba58de047484 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-08-29Performance Improvement:save cmhandles capabilitympriyank1-0/+15
- add saveCmHandleBatch in InventoryPersistence - add saveListElementsBatch in CpsDataService - have addListElementsBatch in CpsDataPersistenceService - Test scenarios for the same Issue-ID: CPS-1229 Issue-ID: CPS-1126 Change-Id: I0a1401818da5a4e523d7d0751cac6a526d1611b2 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-29Merge "Performance Improvement: Use hazelcast blocking queue"Sourabh Sourabh7-161/+299
2022-08-29Performance Improvement: Use hazelcast blocking queueToineSiebelink7-161/+299
- Introducing hazelcast for queue and progress map - process batch of 100 at the time - decreased module sync watchdog sleeptime to 5 seconds - separate module sync tasks in new class and some other async preparations and easier testing - tests for batching in module sync watchdog - remove qualifiers annotation (support) where no longer needed Issue-ID: CPS-1210 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I0a7d3755bf774e27c5688741bddb01f427d4a8a7
2022-08-26Merge "Added eventSchemaVersion for async schema"Toine Siebelink1-0/+1
2022-08-25Merge "Performance Improvement: Batch Update DataNodes"Sourabh Sourabh1-1/+18
2022-08-25Performance Improvement: Batch Update DataNodeslukegleeson1-1/+18
Implemented methods to perform a batch operation on updating datanodes Refactored replace data node(s) tree methods to update data node(s) and descendants Issue-ID: CPS-1203 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I365d657422b19c9ce384110c9a23d041eaed06f4
2022-08-23Added eventSchemaVersion for async schemampriyank1-0/+1
- Added event schema version in the request and response schema. - Enhanced the mapper to adhere to new field. Issue-ID: CPS-1145 Change-Id: I408f73adefc2104b2e421bc3a3fe8f78dcba80f0 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-23Performance Improvement: LCM Eventsmpriyank2-8/+21
- Changed scope of method responsible for creating and publishing the LCM events. - Use a dedicated thread pool for publishing the LCM events. Issue-ID: CPS-1223 Change-Id: Ib46e3c1ff8d80f724ad9db30fca6e8125ca0775a Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-23Move Advised CM Handles Log to debug levellukegleeson1-1/+1
Issue-ID: CPS-1218 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I77a799cfb86fe98e526519c7555bbbd85d289f04
2022-08-22Merge "Distributed datastore solution for Data Sync Watchdog"Toine Siebelink6-81/+108
2022-08-22Distributed datastore solution for Data Sync Watchdogkissand6-81/+108
- update lombok config to handle Qualifier annotation - update Semaphore config to use ConcurrentMap - update SyncUtils to return a list of cm handles - update DataSyncWatchdog and ModuleSyncWatchdog with Qualifier - update DataSyncWatchdog to handle a list of cm handles - Use get with xpath to check cm handle state Issue-ID: CPS-1015 Change-Id: Icb39bd29f89e0020d49a1f8960476ffe81b12362 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-08-22Merge "Fix: CM Handles for only hasAllModules Query"Sourabh Sourabh1-1/+1
2022-08-22Fix: CM Handles for only hasAllModules Querylukegleeson1-1/+1
hasAllModules was returning no CMHandles when queried by itself, only when paired with another query condition e.g. hasAllProperties This fix means endpoint works as expected. Reverted null check Issue-ID: CPS-977 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: Idafad4c9877941d121f5cbb98617c56a35a1cc94
2022-08-18Performance Improvement: Tune Resttemplatempriyank1-1/+6
- Increase connection and read timeout for Resttemplate to a higer value Issue-ID: CPS-1201 Change-Id: Ia159b022698ff60dbd02a5877899f520b91bf883 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-10CmHandleState transition using state handlermpriyank4-70/+40
- Raise LCM Event when state transition happens. - Raised events for ADVISED to READY, ADVISED to LOCKED, LOCKED to ADVISED. - Refactor existing code to raise the events correctly. - Refactored existing test scenarios to comply with the code change. Issue-ID: CPS-1034 Change-Id: Ie548e644f6133304d7fa36c892ca2bec7393c074 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-04LcmEvent state handler refactoringmpriyank6-27/+351
- State handler will now handle new structure of LcmEvent. - We have 3 types of events i.e create, update and delete. - Introduced the LcmEventCreatorHelper to delegate some of the responsibility of event creation based on event type and the state. - New tests and existing refactoring - Code rebased - Refactored name as per group code review - Code rebase with other commits - Used copy constructor for deep copy operation of NcmpServiceCmhandle and CompositeState - UPCOMING : Related user stories to trigger the event publishing using state handler. Issue-ID: CPS-1128 Change-Id: I94b5a87d37d6a174c017ee0aa37cd0f0f74ba084 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-02Merge "Enable/Disable Data Sync for Cm Handle"Joseph Keenan7-18/+81
2022-08-02Merge "Incorrect response to {} for cmhandle id-searches"Joseph Keenan1-1/+3
2022-08-02Merge "Query CmHandles using CPS path"Joseph Keenan5-147/+256
2022-08-02Incorrect response to {} for cmhandle id-searcheslukegleeson1-1/+3
An empty body for the CmHandles id-searches api returns an anchor instead of all cm-handles Now returns all childnode ids for the dmi-registry Issue-ID: CPS-1175 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I358970170a4eb7905e9646605f0f373fbcd78945
2022-07-29Query CmHandles using CPS pathlukegleeson5-147/+256
Added withCpsPath condition parameter Validated to prevent misuse and blocking of querying using private properties Updated OpenAPI with examples and links to documentation Moved methods related to cmHandle querying using cps path from InventoryPersistence to CmHandleQueries Renamed private method deleteSchemaSetAndListElementByCmHandleId to deleteCmHandleByCmHandleId Issue-ID: CPS-977 Change-Id: I83827215b7e58de74f8f62cd0140516d217d93f1 Signed-off-by: lukegleeson <luke.gleeson@est.tech>
2022-07-28Enable/Disable Data Sync for Cm HandleDylanB95EST7-18/+81
-Create API Which will enable/disable data sync enabled flag -Default functionality of module sync watchdog is to set to false -Remove global config param -Will set initial sync state based on data sync enabled flag -Throws an Exception if the same data sync enabled flag tries to be set -Throws Exception if state is not in READY -Data Sync enabled must be true to complete data sync process - Delete all resource data within fragment table related to synced cm handle when data sync is set to false Issue-ID: CPS-1133 Change-Id: Ib47bbd8293f083c1d705d91bd0def74e6a105c72 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-07-27Distributed datastore solution for Module Sync Watchdogkissand2-22/+49
- use semaphore map in ModuleSyncWatchdog - increase test timeout, because it needs more time for hazelcast initialization Issue-ID: CPS-1015 Change-Id: I71feed8fbbd047af9fabba29a5f762a1f17a1c78 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-07-25CmHandle creation performance degradationsourabh_sourabh4-24/+77
- Created a dedicated threadpool for scheduler. - Tuned async threadpool of notification executor from setting RejectedExecutionHandler and application.yml. Issue-ID: CPS-1126 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I2afe3c76c1aec78751777df0d2f08ddb8dcee102
2022-07-25De-registration: send event(s) using central statesourabh_sourabh2-15/+38
- refactored method "parseAndRemoveCmHandlesInDmiRegistration" - added method to send events for DELETING and DELETED - introduced private method in state handler - updated unit tests for registration spec - added unit test to cover new private method in state handler Issue-ID: CPS-1003 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ifc1d1e94b7103d85b6352b196edf7075257c211a Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-07-20Refractor code to use the new LcmEvent schemabmiklos5-48/+83
-Old schema deleted and comments from tests are removed -EventDateTimeFormatter utility added -From LcmEventsCreator.populateLcmEvent the NcmpServiceCmHandle param removed and tests are fixed accordingly -Changes made in test of the LcmEventsCreator for payload testing to make it more clear Issue-ID: CPS-1147 Change-Id: Id87c81f2755a6617a0fc68ba92a3d0e3170fd20f Signed-off-by: bmiklos <miklos.baranyak@est.tech>
2022-07-14Code Refactoring Ncmp* to Lcm* as per new scopempriyank7-48/+44
- Refactored code to reflect the LcmEvents scope now. - Test cases updated and dependencies reviewed. - You can find few occurences of NcmpEvent for now but that will be cleaned up once we implement CPS-1104 which is for LcmEvent schema - UPCOMING: LcmEvent schema and then the code to publish the events on cmHandleStates - LATER : LcmEvents based on public properties update. Issue-ID: CPS-1137 Change-Id: I9f395ed733b4028e706205894c36a38412e3452e Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-07-08CmHandleState Handlermpriyank4-13/+234
- State handler taking care of ADVISED, READY and LOCKED state transition at the moment. - For now I have not removed the actual code but eventually state handler will take care of persisting the state and publishing of the events - Rebased code to add the global parameter related to dataSyncCache - UPCOMING : The classes will be prefixed/renamed with LCM once we have the LcmEvent created with new schema Issue-ID: CPS-1118 Change-Id: Ic45d95169eb0c06cfb35c907d34380dbcbf2da11 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-07-07Merge "Define Initial Data Sync Enabled Flag and state"Joseph Keenan1-4/+13
2022-07-07Define Initial Data Sync Enabled Flag and stateDylanB95EST1-4/+13
- Define the initial Data Sync Cache enabled through configuration parameter - Set the data sync enabled flag based on this - And in turn define the initial sync state of the Data Sync Issue-ID: CPS-1119 Change-Id: I43bf03c79481291bf47c9b672f7bf408d789df61 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-07-06Merge "Move persistence methods from NCMPproperty handler"Joseph Keenan3-41/+41
2022-07-06Merge "Distributed map setup for Module and Data Sync"Toine Siebelink1-0/+68
2022-07-06Distributed map setup for Module and Data Syncmpriyank1-0/+68
- Introduce the hazelcast dependency and check how the builds react to it. - Data Sync and Module Sync Map config. - Added basic test scenarios. - Updating the artifact-id from hazelcast-all to hazelcast-spring and version is 4.2.5. (5.1.2 is latest but has known vulnerabilities) - Refactored the code as per the onsite review session - Upcoming : Actual sub-task which will use the distributed maps in respective use cases. Issue-ID: CPS-1050 Change-Id: I60314c4ff95c267b186b20862aef93a5c389a971 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-07-05Move persistence methods from NCMPproperty handleremaclee3-41/+41
Issue-ID: CPS-1117 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: If6a0c620970a2a34a601267c6610f85e4bc07f60
2022-07-04Move persistence related methodsemaclee4-56/+118
-created new method in inventory persistence service for getting module references Issue-ID: CPS-1117 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ic1f3c180a62a7211e19982d8f3570829db58370e
2022-07-04Merge "Simplified 'External' lock reason Mapping"Joseph Keenan3-12/+12