aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main
AgeCommit message (Collapse)AuthorFilesLines
2023-02-16Improve batch delete schemasets performancedanielhanrahan3-2/+34
- Bulk delete anchors and datanodes associated with schemasets. Improves de-registration performance by approx 10% Issue-ID: CPS-1423 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ie38e8b4c64356bf5935d8c7a5d3f5bfa73fb1714
2023-02-15Bulk delete schemasets in CM handle deregistrationdanielhanrahan3-4/+31
- Batch delete schema sets in single query - Call deleteUnusedYangResourceModules once per batch, not per CM handle - Results for deregistering 10k: 14 mins before; 6 mins after Issue-ID: CPS-1423 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ia3a86a0dc88677323e2f386253a99022a7f02603
2023-02-01Create plural version of deleteDataNodedanielhanrahan6-45/+123
- Add method to CpsDataService to batch delete data nodes and lists - Use native queries to batch delete fragment entities by xpaths, for data nodes and lists - Add performance tests for batch delete - Refactor FragmentNativeRepository - Add single-column version of createTemporaryTable - Renamed metric cps.data.service.datanode.batch.delete to cps.data.service.datanode.all.delete Issue-ID: CPS-1438 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I1851f9c7ef0b1be4bd421b3352d9697a2dd23f79
2023-01-26Merge "Springboot Integration tests improvements"Sourabh Sourabh1-1/+3
2023-01-25Springboot Integration tests improvementslukegleeson1-1/+3
Creation of CpsIntegrationSpecBase Demonstration of test class implementing CpsIntegrationSpecBase in CpsPersistenceSpec Tests use reduced liquibase steps, basic bookstore yang model and bookstore json payload Issue-ID: CPS-1379 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I38202d0888808d08d85fce1aab45fc43e8b0cec3
2023-01-24Handle root xpaths in getDataNodesdanielhanrahan1-4/+13
Issue-ID: CPS-1458 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I64abf97317afe4335c8d04169689ee1396e75860
2023-01-23Use native query to delete data nodessourabh_sourabh4-2/+96
- Used hashcode to remove child fragment based on it's xpath - Used native query to delete fragment by altering fragment_parent_id_fkey CONSTRAINT. Issue-ID: CPS-1439 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: If19c449818e18f8fd666503b7346704eeb4a95d0 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-01-19Normalize xpaths for getDataNodesdanielhanrahan2-8/+27
Issue-ID: CPS-1457 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I93d19666c168aa69da73eadbfef0fc54181aec52
2023-01-16Merge "Fetch CM handles by collection of xpaths"Sourabh Sourabh5-14/+134
2023-01-11Fetch CM handles by collection of xpathsseanbeirne5-14/+134
- Added FragmentRepositoryMultiPathQuery - Removed Hibernate method for same - Added perf. test - Handle escaping of single qoutes in sql-data - Increased timing for path paser performance test Issue-ID: CPS-1422 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: Ibea12a44bffd29ed43cc1560b507d1fa7e968b8b
2023-01-11CPS PATCH operation does not merge existing datalukegleeson1-2/+14
Altered code to add attributes and not overwrite attributes + tests Issue-ID: CPS-1442 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I23c5f6a65b98ea1b05af62a38a874c228cc82067
2022-12-22Temp Table Creation improvementsToineSiebelink4-43/+111
- extracted methods for more generic temp table creation - optimized - added perf test on use case that depends on temp table creation - had some doubts about stopwatch use in recent tests, but was all OK, just renamed some Issue-ID: CPS-1422 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I22cabb9b0ba1b0aa8576a2d756d77af46eebc1b0
2022-12-21CpsPath Query OptimizationToineSiebelink5-112/+231
- Optimized CpsPathqueries with descendants that only care about the xpath (no attribuets checks) - Use native query with regular expression for target xpath and descendants - Refactored so existing sql-geneartion code can be re-used in different repository implementations - Adjusted related performance test expectations Issue-ID: CPS-1421 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I3a807a14478c4b3272a5335d31c9aa3615eb2bee
2022-12-19Fix Delete uses case with '/' in pathToineSiebelink1-8/+2
-Extend and use cpsPath parser (util) classes instead of regex Issue-ID: CPS-1409 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I230c9eb71cc34264983830b39149511b95c4b4a6
2022-12-15CPS-341 Support for multiple data tree instances under 1 anchorarpitsingh1-4/+42
- Updated the parseJsonData method so it can parse JSON with multiple data trees, now it returns a ContainerNode - ContainerNode holds a collection of NormalizedNodes - Updated DataNodeBuilder and FragmentRepository as well to support collection of NormalizedNodes - Added new methods in CpsDataPersistenceService to store multiple Data Nodes - Added new test cases - Updated existing test cases and fixed code coverage - Addressed comments from previous patch Issue-ID: CPS-341 Change-Id: Ie893e91c0fbfb139a1a406e962721b0f52412ced Signed-off-by: arpitsingh <as00745003@techmahindra.com>
2022-12-13Merge "Fixing SonarQube violations"Toine Siebelink2-6/+9
2022-12-12Fixing SonarQube violationsleventecsanyi2-6/+9
- Code smell fixes Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Issue-ID: CPS-475 Change-Id: I4b47ece82aed7e4b31aaa28e601e419fb6f06718
2022-12-09Merge "Added API to get all schema sets for a given dataspace."Toine Siebelink2-0/+37
2022-12-09Added API to get all schema sets for a given dataspace.rajesh.kumar2-0/+37
Issue-ID: CPS-1187 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0914aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-12-08Merge "Fix SonarQube Violations"Sourabh Sourabh1-2/+1
2022-12-06Merge "Upgrade Open daylight yang tool to version 8.0.6"Toine Siebelink1-1/+6
2022-12-06Upgrade Open daylight yang tool to version 8.0.6emaclee1-1/+6
- changed classes according to upgrade of yang tool - changed methods in YangUtils class to accomodate change for jSonParserStream method - updated unit tests for the upgrade Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ib62fe424150ed0695eed168e1ae21f4d9a61cdf4
2022-12-05Fix SonarQube Violationsleventecsanyi1-2/+1
Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Issue-ID: CPS-475 Change-Id: Ic5c83cf2952c649fb634c6a1660696e7575cc1c7
2022-11-18Added get APIs for dataspace.rajesh.kumar1-0/+19
Issue-ID: CPS-1186 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0829aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-11-11Node API - Find root by anchor method performancesourabh_sourabh3-11/+29
- Modified findFirstRootByAnchor - Used fragment extract to build fragment entity to get root data node. Reviewers : Toine, Priyank and Joe Issue-ID: CPS-1171 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I843f270e4781f91ae496f39b976e2a7f2a14d55e Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-11-08Node API - GET Method performance issuesourabh_sourabh1-13/+44
- Modified toDataNode call based on fetch descendants option. - Used fragment extract to build fragment entity. - Modified data set to have correct parent id for descendants. Reviewers : Toine, Priyank and Joe Issue-ID: CPS-1171 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I27a537fe72dd396722e6cfde7d8c454ed2579ec0 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-11-02Ensure prefix is correct module prefixToineSiebelink3-172/+3
- Moved Prefix logic from RI to Service layer - Prefix is no PREFIX propety, not the moduel name! == RI (DB Layer) Changes - Removed prefix logic incl hazelcast - Added new basic ri-test for getDataNode and assert prefix is null - Updated exsiting ri-test to us getDataNode - Updated existing ri-test to only use " where really needed == CPS Service Layer Changes - Introduced PrefixResolver with clear and limited responsibility - Use PrefixResolver where needed - Cache prefix map per anchor, use cached entry when available - Disabled SONAR on new Regex == REST Layer - Use PrefixResolver where needed Issue-ID: CPS-1353 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie16f0e1ee1c280f3eb69c9e64fab69a780fb692a
2022-10-27Read Performance Improvement - Using Native QueryToineSiebelink5-19/+166
- Native query for FragmentExtracts - Convert FragmentExtracts to tree of FragmentEntity - Native Query now used for all Gets with descendants (orignal hibernate option only used when descendanst ommited) - Added error handling for not-found on native query - Ommit descendants by default on many udpate use-cases (this might have a signifcant perf. improvemnt impact too) - Improved legacy tests for delete use-cases - Corrected performace test expectation - Fix TTL test realizing TTL resolution is whole seconds! Issue-ID: CPS-1301 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I658ac1b7b7036f01050f30bdf9e5bd175725ef1d
2022-10-26Creation of DataNodeBuilder with module name prefix is very slowToineSiebelink3-10/+160
- Created a new hazelcast distributed cache for anchor data config use cases. - Module name prefix is added for root data node only. - Cached module name prefix by anchor name on demand from database at first call. - Introduced a new cache holder to have module name prefix of diff. levels. Issue-ID: CPS-1326 Change-Id: I9072f5efdeea59843cd827ac556d3c0547a3a0cf Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-10-20CPS Validator Changeslukegleeson1-0/+51
Changed CPS Validator from static to non-static Moved CPSValidator implementation to rest interface layer to prevent duplicated usage Created CPSValidator interface in persistence layer Removed unnecessary tests Refactored misplaced tests Copyright fixes Copyright Check Script output formatting fix Issue-ID: CPS-1228 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I4c99a51870e7d3b8e416bc1f909aeed5dc3baa42
2022-10-14Merge "Default CMHandles to READY during upgrade"Toine Siebelink2-7/+141
2022-10-13Merge "Fix Id-searches endpoint performance degradation"Toine Siebelink1-16/+19
2022-10-12Fix Id-searches endpoint performance degradationkissand1-16/+19
- create more flexible control over fetch descendants - add a new FETCH_DIRECT_CHILDREN_ONLY option to fetch descendants options - enabel create custom fetch descendants option Reviewer: Toine, Joe, Priyank Issue-ID: CPS-1216 Change-Id: I900b32e813367aa9566c1dec986b20f009d27203 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-10-12Default CMHandles to READY during upgradelukegleeson2-7/+141
Allows upgrade from liquibase changelog 11 to 16 Sets CMHandles which do not have a state to state READY Issue-ID: CPS-1312 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I6b6b05ba6fad3d174e43e9c385cbc1f9f4e4e5e5
2022-10-05Make CPS/NCMP upgradeablelukegleeson4-1/+21
Liquibase step to add CM Handle Advised state to existing CM Handles Issue-ID: CPS-1312 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I8077e66c64946f6ce092daa96ee40cd935fe0b72
2022-10-03Remove NotNull on revision for YangResourceEntitylukegleeson1-1/+0
Issue-ID: CPS-1265 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: Icfe4d9881a3aa7d92d5bd17eaaed91bdbce0a203
2022-09-19Merge "Get Node API fix for attribute values with '/'"Sourabh Sourabh1-7/+7
2022-09-14Get Node API fix for attribute values with '/'puthuparambil.aditya1-7/+7
Issue-ID: CPS-1179 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: Iae53dbd2c6b421633355958aee3f2bbe321501a2
2022-09-13handle partial failure on batch state updatempriyank1-8/+25
- catching of failures on retry of individual nodes on batch update - test scenarios for the same Issue-ID: CPS-1232 Issue-ID: CPS-1126 Change-Id: I9dc13e7bbe44673f8ac14fbde08a85d6a5142487 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-13CmHandle registration/module sync watchdog performance improvmentsourabh_sourabh1-11/+4
- Tuned CPS DB parameters - Removed deprecated CPS DB parameter - Modified module sync watch logic - Added aditional logs - Removed logic to get FragmentEntities as stream - Removed detaching of fragment entity as it was causing NCMP to break with an exception "SQLSTATE(08006)" Issue-ID: CPS-1126 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I0bde11895f754602dece132efde701d82b377f12
2022-09-13Handle partial failure (improvements)ToineSiebelink1-7/+17
- catching of failures on retry of individual nodes - extract cm handle id from xpaths (can only report xpaths in cps core) - add test for same Issue-ID: CPS-1232 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ice2032c8b15fea97ae0aaa4d1ed642b3499228fa
2022-09-12Handle partial failurempriyank1-21/+46
- Removing the transaction boundaries as it was getting rollbacked on partial failures - Handled adding the elements in batch and if it fails try them individually - Refactored code a bit and when there is partial failure we try one more time in sequence and even if there are failures we collect the failures Issue-ID: CPS-1232 Issue-ID: CPS-1126 Change-Id: I7824c9f37f80cbaeedd5dc06d598ca0e3a69c59b Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-05Performance Improvement: Fix Insert Yang Resource IDs (Schemset)ToineSiebelink2-4/+8
- 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-4/+11
- 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-08-29Performance Improvement:save cmhandles capabilitympriyank1-0/+10
- 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-25Performance Improvement: Batch Update DataNodeslukegleeson1-12/+36
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-22Merge "Performance Improvement: Insert Yang Resources"Toine Siebelink1-10/+24
2022-08-22Merge "Performance Improvement: Retreive Yang Resources"Sourabh Sourabh4-19/+102
2022-08-22Performance Improvement: Insert Yang ResourcesToineSiebelink1-10/+24
Insert batches of yang resources for a schema set into one operation add batch-sized tests to ensure batch-size logic is covered for all branches fixed legacy issues in changed test classes Issue-ID: CPS-1208 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I5b2a54ed0895999079975d777ba89d589ed4688b
2022-08-22Performance Improvement: Retreive Yang ResourcesToineSiebelink4-19/+102
Native query to more efficiently get all yangResourceIds Combined Hibernate Fragment Repository with Native impl. Issue-ID: CPS-1206 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I93fbd5347dd8f9fc48d44e69e47e8aed2d7ac030