/*
 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.controller.cluster.datastore.node.utils;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import org.opendaylight.yangtools.yang.common.QName;

public final class QNameFactory {

    private static final int MAX_QNAME_CACHE_SIZE = 10000;

    private QNameFactory() {
    }

    private static final LoadingCache<String, QName> CACHE = CacheBuilder.newBuilder().maximumSize(MAX_QNAME_CACHE_SIZE)
            .softValues().build(new CacheLoader<String, QName>() {
                @Override
                public QName load(String key) {
                    return QName.create(key);
                }
            });

    public static QName create(String name) {
        return CACHE.getUnchecked(name);
    }
}

@@ -307,17 +307,16 @@
 tml%0A */%0A
-%0A
 package 
@@ -596,17 +596,16 @@
 ctory %7B%0A
-%0A
     priv
@@ -652,50 +652,124 @@
 E = 
-10000;%0A%0A    private QNameFactory() %7B%0A    %7D
+Integer.getInteger(%0A        %22org.opendaylight.controller.cluster.datastore.node.utils.qname-cache.max-size%22, 10000);
 %0A%0A  
@@ -904,12 +904,12 @@
    .
-soft
+weak
 Valu
@@ -1014,16 +1014,22 @@
 me load(
+final 
 String k
@@ -1078,16 +1078,25 @@
 ate(key)
+.intern()
 ;%0A      
@@ -1120,24 +1120,61 @@
        %7D);%0A%0A
+    private QNameFactory() %7B%0A%0A    %7D%0A%0A
     public s
@@ -1192,16 +1192,22 @@
  create(
+final 
 String n

Update QNameFactory caching