Update QNameFactory caching 15/82315/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 May 2019 10:42:02 +0000 (12:42 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 29 May 2019 18:00:20 +0000 (18:00 +0000)
commit5a0b7e550a7a484cee4693b63df0849111a8236a
tree436f8bf410daba92a4a8ec24ddad4579100dc80b
parent5cc558ac2fa4d221e26b76df725bade5b44ee794
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)
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java