Update QNameFactory caching 92/82492/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 May 2019 10:42:02 +0000 (12:42 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 13 Aug 2019 16:29:27 +0000 (16:29 +0000)
commita2d5974fb01b623d237319086ca402259cbcd09d
treebf23b0b0add0c5cf63b582b73c9116c059d0d6b4
parentc061453b23747d53f46672e67b73d66776c3b039
Update QNameFactory caching

This eliminates the use of soft references in favor of weak ones,
so that we do not rely on GC heuristics for retention.

We also make the maximum cache size runtime-configurable via
org.opendaylight.controller.cluster.datastore.node.utils.qname-cache.max-size
property.

Finally we use QName.intern() to defer to the global QName cache,
resulting in better QName instance sharing.

JIRA: CONTROLLER-1897
Change-Id: Ice3596d23b96c4ecfc5775cb21968233b042a984
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit dc54b87a6b2fb11d233b8294b684268f4d5161de)
(cherry picked from commit 5a0b7e550a7a484cee4693b63df0849111a8236a)
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java