private static Hive getInternal(HiveConf c, boolean needsRefresh, boolean isFastCheck,
      boolean doRegisterAllFns) throws HiveException {
    Hive db = hiveDB.get();
    if (db == null || !db.isCurrentUserOwner() || needsRefresh
        || (c != null && !isCompatible(db, c, isFastCheck))) {
      if (db != null) {
        LOG.debug("Creating new db. db = " + db + ", needsRefresh = " + needsRefresh +
                ", db.isCurrentUserOwner = " + db.isCurrentUserOwner());
        closeCurrent();
      }
      db = create(c, doRegisterAllFns);
    }
    if (c != null) {
      db.conf = c;
    }
    return db;
  }
Same as {@link #get(HiveConf)}, except that it does not register all functions.
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java