Update QNameFactory caching 75/82275/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 May 2019 10:42:02 +0000 (12:42 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 29 May 2019 16:31:53 +0000 (16:31 +0000)
commitdc54b87a6b2fb11d233b8294b684268f4d5161de
tree8e86170cd78c4946c4c719644382e9bb790c15d5
parentc9ca1a93d44cfb7681079b7ca3c56ea89ac3ef1b
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>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java