Use ImmutableSortedSet for small ImmutableUnsignedLongSets 21/98321/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 6 Nov 2021 13:31:20 +0000 (14:31 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 7 Nov 2021 00:28:29 +0000 (01:28 +0100)
commit1b91ac920d012e11d73b2f074502c025143ebf07
tree46696440bdcba7c8e457af640d8563302ea05c26
parent6a2d188f3f258d119f1fe29141bc5e10476c88d0
Use ImmutableSortedSet for small ImmutableUnsignedLongSets

This adds a bit of indirection, but for a few entries this ends up
using arrays instead of an RB tree, offering better density.

JIRA: CONTROLLER-2012
Change-Id: I09714c6bf3272946f6cee4360f80a106453d0e61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 318c0bbc4ecfdf532a4cc3e219508a7c5744d160)
(cherry picked from commit 48b7ce82dfd92584a0a1bfc33e72b5154a3bff79)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ImmutableUnsignedLongSet.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/MutableUnsignedLongSet.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/UnsignedLongSet.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/UnsignedLongSetTest.java