[YANGTOOLS-1426] Consider bits type storage Created: 11/Apr/22  Updated: 21/Dec/23

Status: In Progress
Project: yangtools
Component/s: data-impl, data-util
Affects Version/s: None
Fix Version/s: 14.0.0

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

Issue Links:
Relates
relates to MDSAL-746 Improve BitsTypeObject storage Confirmed

 Description   

YANG 'bits' type is currently mapped to a Set<String>. This has pros (like model-independence) and cons (storage overhead).
Assuming schema-informedness, we should be able to provide a Set which is backed by an int (or a long, or a byte[]) plus a offset-to-name mapping. This would lower our storage requirements in places where we can assume such a mapping.



 Comments   
Comment by Ivan Martiniak [ 18/Oct/22 ]

I have a few questions regarding this issue, compared to https://jira.opendaylight.org/browse/MDSAL-746, I was working with bit values (0 or 1).
In this case, storing these values was pretty straightforward, as these primitive types consist of booleans.
However currently, I do not work with bit values, I work with bit names only. Hence, if will transform Set<String> to Integer,
I still need to have this set of string names stored somewhere and mapped to the bit position.

1. How is envisioned to replace Set<String> with Set backed by primitive data types such as int, long, and byte[]?
2. How would this lower storage requirement when this set of bit names still needs to exist?
3. What exactly is meant by offset-to-name mapping?

rovarga do you have any thoughts/advice?

Comment by Ruslan Kashapov [ 01/Dec/22 ]

changes below are obsolete and can abandoned
https://git.opendaylight.org/gerrit/c/yangtools/+/102901
https://git.opendaylight.org/gerrit/c/yangtools/+/103058
https://git.opendaylight.org/gerrit/c/mdsal/+/103029

Comment by Ruslan Kashapov [ 13/Dec/22 ]

final change introducing dedicated Bits artifact
https://git.opendaylight.org/gerrit/c/yangtools/+/103659
addresses https://git.opendaylight.org/gerrit/c/yangtools/+/102901/comments/e0f469a5_4d2d8317

 

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