Search in sources :

Example 1 with PropCacheKey

use of org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey in project accumulo by apache.

the class NamespaceConfiguration method getPropCacheAccessor.

private synchronized ZooCachePropertyAccessor getPropCacheAccessor() {
    if (propCacheAccessor == null) {
        synchronized (propCaches) {
            PropCacheKey key = new PropCacheKey(inst.getInstanceID(), namespaceId.canonicalID());
            ZooCache propCache = propCaches.get(key);
            if (propCache == null) {
                propCache = zcf.getZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(inst));
                propCaches.put(key, propCache);
            }
            propCacheAccessor = new ZooCachePropertyAccessor(propCache);
        }
    }
    return propCacheAccessor;
}
Also used : PropCacheKey(org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey) ZooCache(org.apache.accumulo.fate.zookeeper.ZooCache)

Example 2 with PropCacheKey

use of org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey in project accumulo by apache.

the class TableConfiguration method getPropCacheAccessor.

private synchronized ZooCachePropertyAccessor getPropCacheAccessor() {
    if (propCacheAccessor == null) {
        synchronized (propCaches) {
            PropCacheKey key = new PropCacheKey(instance.getInstanceID(), tableId.canonicalID());
            ZooCache propCache = propCaches.get(key);
            if (propCache == null) {
                propCache = zcf.getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), new TableConfWatcher(instance));
                propCaches.put(key, propCache);
            }
            propCacheAccessor = new ZooCachePropertyAccessor(propCache);
        }
    }
    return propCacheAccessor;
}
Also used : PropCacheKey(org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey) ZooCache(org.apache.accumulo.fate.zookeeper.ZooCache)

Aggregations

ZooCache (org.apache.accumulo.fate.zookeeper.ZooCache)2 PropCacheKey (org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey)2