本文整理匯總了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());
}
示例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);
}
}
示例3: SentryHiveMetaStoreClient
import org.apache.hadoop.hive.metastore.HiveMetaHookLoader; //導入依賴的package包/類
public SentryHiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader)
throws MetaException {
super(conf, hookLoader);
}