@Override
  public ExternalFooterCachesByConf.Cache getCache(HiveConf conf) throws IOException {
    // TODO: we wish we could cache the Hive object, but it's not thread safe, and each
    //       threadlocal we "cache" would need to be reinitialized for every query. This is
    //       a huge PITA. Hive object will be cached internally, but the compat check will be
    //       done every time inside get().
    try {
      return new HBaseCache(Hive.getWithFastCheck(conf));
    } catch (HiveException e) {
      throw new IOException(e);
    }
  }
An implementation of external cache and factory based on metastore.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/MetastoreExternalCachesByConf.java