Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # dev - zoo.cfg vs hbase-site.xml


Copy link to this message
-
zoo.cfg vs hbase-site.xml
Lars George 2011-07-03, 16:53
Hi,

Usually the zoo.cfg overrides *all* settings off the hbase-site.xml
(including the ones from hbase-default.xml) - when present. But in some
places we do not consider this, for example in HConnectionManager:

  static {
    // We set instances to one more than the value specified for {@link
    // HConstants#ZOOKEEPER_MAX_CLIENT_CNXNS}. By default, the zk default
max
    // connections to the ensemble from the one client is 30, so in that
case we
    // should run into zk issues before the LRU hit this value of 31.
    MAX_CACHED_HBASE_INSTANCES = HBaseConfiguration.create().getInt(
        HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS,
        HConstants.DEFAULT_ZOOKEPER_MAX_CLIENT_CNXNS) + 1;
    HBASE_INSTANCES = new LinkedHashMap<HConnectionKey,
HConnectionImplementation>(
        (int) (MAX_CACHED_HBASE_INSTANCES / 0.75F) + 1, 0.75F, true) {
       @Override
      protected boolean removeEldestEntry(
          Map.Entry<HConnectionKey, HConnectionImplementation> eldest) {
         return size() > MAX_CACHED_HBASE_INSTANCES;
       }
    };
This only reads it from hbase-site.xml+hbase-default.xml. This is
inconsistent, I think this should use ZKConfig.makeZKProps(conf) and then
get the value.

Thoughts?

Lars