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

Reconsider LeafSetNode storage

XMLWordPrintable

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

      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).

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

              Created:
              Updated: