[YANGTOOLS-1398] Reconsider LeafSetNode storage Created: 11/Feb/22  Updated: 05/Jan/24

Status: Confirmed
Project: yangtools
Component/s: data-api, data-impl
Affects Version/s: None
Fix Version/s: 14.0.0

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


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


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