Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

References

  1. CPS-1301 - Getting issue details... STATUS

  2. Sample Yang Module: https://github.com/YangModels/yang/blob/main/vendor/cisco/xr/534/ietf-inet-types.yan
  3. PoC by Toine Siebelink to insert prefixes based on schemaContext (ODL Model): https://gerrit.nordix.org/c/onap/cps/+/15553

Assumptions

#AssumptionNotes
1Sample (wanted) output of: /module1:A/B/module2:C/DSee also decision #3
2Prefix can be inserted before each container but this is optionalSee RFC...

Issues & Decisions


#IssueNotes Decision
1Performance issue with current solutionCurrent solution used inefficient query to populate (first) prefix property for ALL fragments although only used for top level 

Will be handled by separate Jira already in progress, see CPS-1326 - Getting issue details... STATUS

2Top level container is not always defined in first moduleThis might not be required as the first short-term solution is delivered first

Will be handled by separate Jira CPS-1344 - Getting issue details... STATUS

3Add prefix for container in same module

This is allowed but not done normally. Team concerned about performance issues and impact on URLs when using this

Ahila P will check need with her team.

Ahila P 21-10-2022: Prefix is not required for the child modules or nodes, if it carries the same prefix as parent

4Add prefix to first container when this is not the top level for the module it is definedretrieve B or C directly (without parent), in that case should the prefix stil be used ie. Module1:/B
5/module1:A/B/module2:C/D 
Which module reference should be inserted in the cpaths for 'Module1' and 'Module2'. Prefix or Name, or last token of namespace?!

See sample from https://github.com/YangModels/yang/blob/main/vendor/cisco/xr/534/ietf-inet-types.yang

ietf-inet-types.yang
module ietf-inet-types {

  namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
  prefix "inet";

(Unfortunately in above example module name and last token of namespace are the same, not sure if this just convention or mandatory
Use 'ietf-inet-types' or 'inet' to insert 

CPS Team (made-up) example

bookstore.yang
module stores {
    yang-version 1.1;
    namespace "org:onap:ccsdk:sample";

    prefix book-store;

Ahila P to check RFC to find out what is required

Ahila P 21-10-2022 : It refers to the 'prefix' in the yang model  (highlighted in the sample yang model).

module ietf-inet-types {  

namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";  

prefix "inet";

6Prefix for (additional) leaves that are defined in a separate module then the container itselfRequired, not sure how common this is. DB Solution for this might be quite difficult. Toine's POC should handle it (to be tested)
7How to handle lists (instead of container)Possibly ignore [@key=value] part. Small neglectable change of same model defined both under same parent... Toine's Poc can be modified to handle this with help from establish regular-expressions from other use cases
8Performance Considerations

SchemaContext generation is expensive. 

  1. Consider distributed cache (already used for other things in CPS) to store resolved paths 
  2. Consider normal cache for schemaContext object has they are not serializable)
  3. Consider generating matcher for all possible paths upon SChemaContext creation (would be limited number) and store in (distributed) cache (with a reasonable time to live)
Use Hazelcast to store 'simplified Model' as defined in Poc Toine
9



Road Map

  1. Short Term solution
    1. No DB changes or DB interaction (after retrieving yang resources) Based on Toine's Poc https://gerrit.nordix.org/c/onap/cps/+/15553
    2. Lazy loading of 'simplified model'
    3. Cache simplified Module (for performance reasons) Can built on te solution for CPS-1326 - Getting issue details... STATUS  here https://gerrit.onap.org/r/c/cps/+/131493
    4. This solution should handle Leaf (defined in different module) as well
  2. Medium term solution
    1. Update  CPS Internal Relation DB Schema and data insert to retain fragment - yang resource relation 
    2. Modify data retrieval to insert module references as required
    3. retain/modify short term solution for leaves-in-separate modules
  3. Long term solution
    1. Modie schema to store attribute module informat when needed i.e. when not defined in same module as container that owns those leaves
    2. Detailed analysis required


Cost estimates

TBD

Resourcing

TBD

Short Term Solution

Options

  1. iterator over schemaContext tree to generate (matchers for) all possible paths or 'normalized paths (ie. without list indexes) See also issue #8
  2. wak three using given paths which need to be resolved as needed (and cache once found)

Medium Term Solution

  1. Each Fragment needs a reference to the relevant module (on DB Level)

Long Term Solution


  • No labels