Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1398

Reconsider LeafSetNode storage

    XMLWordPrintable

Details

    • Improvement
    • Status: Confirmed
    • Medium
    • Resolution: Unresolved
    • None
    • 14.0.0
    • data-api, data-impl
    • None

    Description

      LeafSetNode implementations currently store their children in maps, which leads to a few bad interactions:

      1. the fact that SystemLeafSetNode in fact contains Set<LeafSetEntryNode> is not exposed
      2. the fact that UserLeafSetNode in fact contains a List<LeafSetEntryNode> with unique values is not exposed
      3. UserLeafSetNode uses an inefficient LinkedHashMap implementation internally
      4. UserLeafSetNode offset access performs iteration on values

      We should address these concerns by making LeafSetEntryNodes transient, similar to how LeafNodes are transient in containers.
      We should also use a simple Set for SystemLeafSetNode storage and use a List for UserLeafSetNode storage.

      The latter also needs a suitable UniqueList interface defined in yang.common, which is an extension of java.util.List with an additional guarantee of values being unique (similar to java.util.Set).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: