Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-341

Spike: Support multiple data tree instances under 1 anchor


    • Icon: Story Story
    • Resolution: Done
    • Icon: Low Low
    • London Release
    • None
    • CPS-Core-REST
    • None

      One anchor could support more then one data tree instance using different independent models provided in the schema-set for that anchor.

      This study needs to clarify what we already support or not. It might affect existing api methods

      • Currently it is possible to create a seconds instance tree under the same anchor assuming there is a second model.
      • most crud operations will works on multiple tree instance with the exception of operation on the anchor 'root'
      • get anchor 'root' uses an API that returns only one DataRoot so it needs special consideration (maybe separate REST and Java API methods) 

      Additional Info from CPS-139:


      The YANG specification allows multiple containers (lists etc) to be defined on a module's top level, however the eligible JSON data (having corresponding data sets) is not accepted. When data is parsed using YangUtils.parseJsonData(...) the exception like below occurs

      org.opendaylight.yangtools.yang.data.impl.schema.ResultAlreadySetException: Normalized Node result was already set.
       at org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult.setResult(NormalizedNodeResult.java:39) at org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResultBuilder.addChild(NormalizedNodeResultBuilder.java:57) at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter.writeChild(ImmutableNormalizedNodeStreamWriter.java:305) at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter.endNode(ImmutableNormalizedNodeStreamWriter.java:283) at org.opendaylight.yangtools.yang.data.util.ContainerNodeDataWithSchema.write(ContainerNodeDataWithSchema.java:37) at org.opendaylight.yangtools.yang.data.util.CompositeNodeDataWithSchema.write(CompositeNodeDataWithSchema.java:273) at org.opendaylight.yangtools.yang.data.util.AbstractNodeDataWithSchema.write(AbstractNodeDataWithSchema.java:74) at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.parse(JsonParserStream.java:170) at org.onap.cps.utils.YangUtils.parseJsonData(YangUtils.java:73)

      The data limitation by single top-level data node (despite it matches the model definition) seems artificial and not justified.


      Please consider the Notification feature when evaluating this feature. https://wiki.onap.org/x/54IEBw 


        1. json-object-multiple-data-tree.json
          0.6 kB
        2. multiple-data-tree.yang
          3 kB
        3. multiple-top.json
          0.2 kB
        4. multiple-top.yang
          0.5 kB

            arpitsingh Arpit Singh
            ToineSiebelink Toine Siebelink
            0 Vote for this issue
            3 Start watching this issue