[MDSAL-834] Support multiple schemas/module-sets by YangLibraryContentBuilder Created: 19/Jul/23  Updated: 19/Jul/23

Status: Open
Project: mdsal
Component/s: yanglib
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Medium
Reporter: Ruslan Kashapov Assignee: Robert Varga
Resolution: Unresolved Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to NETCONF-668 RFC7895/RFC8525 implementation should... Resolved
relates to NETCONF-1093 Join yang resource providers from res... Open

 Description   

RESTCONF yang-library services are using different sources to generate different parts of same yang-library data node:

restconf-nb PUTs modules data belonging to global schema context, while yanglib collects information from custom directory then MERGEs modules data into existing data structure. Same node update by variety of services on different events it may cause data inconsistency (corruption).

Using different module-sets for different sources will allow safe override/delete module-set by key without a risk corrupting data associated with other source and/or synchronized by other component.

Currently YangLibraryContentBuilder supports only single module-set with predefined name (key). Enabling multiple multiple module-sets will resolve the issue described above. 

Expected implementation like below

final var yangLibNode = yangLib.newContentBuilder()
    .defaultContext(defaultContext)
    .moduleSetName("custom")
    .formatYangLibraryContent(); 

If custom module-set name is not defined then default one should be used.


Generated at Wed Feb 07 20:11:05 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.