當前位置: 首頁>>代碼示例>>Java>>正文


Java HiveMetaHookLoader類代碼示例

本文整理匯總了Java中org.apache.hadoop.hive.metastore.HiveMetaHookLoader的典型用法代碼示例。如果您正苦於以下問題:Java HiveMetaHookLoader類的具體用法?Java HiveMetaHookLoader怎麽用?Java HiveMetaHookLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HiveMetaHookLoader類屬於org.apache.hadoop.hive.metastore包,在下文中一共展示了HiveMetaHookLoader類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMetaStoreClient

import org.apache.hadoop.hive.metastore.HiveMetaHookLoader; //導入依賴的package包/類
private IMetaStoreClient createMetaStoreClient() throws MetaException {
  HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
    @Override
    public HiveMetaHook getHook(Table tbl) throws MetaException {
      if (tbl == null) {
        return null;
      }

      try {
        HiveStorageHandler storageHandler =
            HiveUtils.getStorageHandler(hiveConf, tbl.getParameters().get(META_TABLE_STORAGE));
        return storageHandler == null ? null : storageHandler.getMetaHook();
      } catch (HiveException e) {
        LOG.error(e.toString());
        throw new MetaException("Failed to get storage handler: " + e);
      }
    }
  };

  return RetryingMetaStoreClient.getProxy(hiveConf, hookLoader, HiveMetaStoreClient.class.getName());
}
 
開發者ID:apache,項目名稱:incubator-gobblin,代碼行數:22,代碼來源:HiveMetaStoreClientFactory.java

示例2: newInstance

import org.apache.hadoop.hive.metastore.HiveMetaHookLoader; //導入依賴的package包/類
@Override
public CloseableMetaStoreClient newInstance(HiveConf conf, String name) {
  LOG.debug("Connecting to '{}' metastore at '{}'", name, conf.getVar(ConfVars.METASTOREURIS));
  try {
    return CloseableMetaStoreClientFactory
        .newInstance(RetryingMetaStoreClient.getProxy(conf, new HiveMetaHookLoader() {
          @Override
          public HiveMetaHook getHook(Table tbl) throws MetaException {
            return null;
          }
        }, HiveMetaStoreClient.class.getName()));
  } catch (MetaException | RuntimeException e) {
    String message = String.format("Unable to connect to '%s' metastore at '%s'", name,
        conf.getVar(ConfVars.METASTOREURIS));
    throw new MetaStoreClientException(message, e);
  }
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:18,代碼來源:ThriftMetaStoreClientFactory.java

示例3: SentryHiveMetaStoreClient

import org.apache.hadoop.hive.metastore.HiveMetaHookLoader; //導入依賴的package包/類
public SentryHiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader)
    throws MetaException {
  super(conf, hookLoader);
}
 
開發者ID:apache,項目名稱:incubator-sentry,代碼行數:5,代碼來源:SentryHiveMetaStoreClient.java


注:本文中的org.apache.hadoop.hive.metastore.HiveMetaHookLoader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。