Consider bits type storage
Description
Activity
Ruslan Kashapov December 13, 2022 at 11:31 AMEdited
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
Ruslan Kashapov December 1, 2022 at 12:23 PMEdited
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
Ivan Martiniak October 18, 2022 at 11:14 AMEdited
I have a few questions regarding this issue, compared to https://lf-opendaylight.atlassian.net/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?
@Robert Varga do you have any thoughts/advice?
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.