[YANGTOOLS-454] Differentiate YangInstanceIdentifier Created: 18/May/15  Updated: 10/Apr/22  Resolved: 19/May/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

YangInstanceIdentifier has inherently two ways of construction: a fixed iterable from root, or concatenation. Current implementation is geared towards the later use case, where it takes advantage of Iterables.concat().

This has an unfortunate side-effect of not being able to efficiently implement getLastPathArgument(), which is used in binding codecs and will be used heavily in defensive precautions solving BUG-3189.

Rework the implementation such that the two cases are differentiated, one using an internal ImmutableList, the other one keeping a reference to the YangInstanceIdentifier from which it was created (and storing a single PathArgument).

This will have the effect of the fixed implementation improving on various operations, as well as the stacked implementation having lower overhead and being efficient in providing the last path argument.



 Comments   
Comment by Robert Varga [ 18/May/15 ]

https://git.opendaylight.org/gerrit/20683 (split out builder)
https://git.opendaylight.org/gerrit/20684 (introduce the split)
https://git.opendaylight.org/gerrit/20685 (optional, improve to Collection)
https://git.opendaylight.org/gerrit/20686 (optional, improve to List)

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