org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(235)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions()方法的一些代码示例,展示了Hive.getAllFunctions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.getAllFunctions()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:getAllFunctions

Hive.getAllFunctions介绍

暂无

代码示例

代码示例来源:origin: apache/hive

ResourceDownloader resourceDownloader =
  new ResourceDownloader(conf, udfDir.toUri().normalize().getPath());
List<Function> fns = hive.getAllFunctions();
Set<URI> srcUris = new HashSet<>();
for (Function fn : fns) {

代码示例来源:origin: apache/hive

public void reloadFunctions() throws HiveException {
 HashSet<String> registryFunctions = new HashSet<String>(
   FunctionRegistry.getFunctionNames(".+\\..+"));
 for (Function function : getAllFunctions()) {
  String functionName = function.getFunctionName();
  try {
   LOG.info("Registering function " + functionName + " " + function.getClassName());
   String qualFunc = FunctionUtils.qualifyFunctionName(functionName, function.getDbName());
   FunctionRegistry.registerPermanentFunction(qualFunc, function.getClassName(), false,
         FunctionTask.toFunctionResource(function.getResourceUris()));
   registryFunctions.remove(qualFunc);
  } catch (Exception e) {
   LOG.warn("Failed to register persistent function " +
       functionName + ":" + function.getClassName() + ". Ignore and continue.");
  }
 }
 // unregister functions from local system registry that are not in getAllFunctions()
 for (String functionName : registryFunctions) {
  try {
   FunctionRegistry.unregisterPermanentFunction(functionName);
  } catch (Exception e) {
   LOG.warn("Failed to unregister persistent function " +
     functionName + "on reload. Ignore and continue.");
  }
 }
}

代码示例来源:origin: apache/hive

public void startLocalizeAllFunctions() throws HiveException {
 Hive hive = Hive.get(false);
 // Do not allow embedded metastore in LLAP unless we are in test.
 try {
  hive.getMSC(HiveConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST), true);
 } catch (MetaException e) {
  throw new HiveException(e);
 }
 List<Function> fns = hive.getAllFunctions();
 for (Function fn : fns) {
  String fqfn = fn.getDbName() + "." + fn.getFunctionName();
  List<ResourceUri> resources = fn.getResourceUris();
  if (resources == null || resources.isEmpty()) continue; // Nothing to localize.
  FnResources result = new FnResources();
  resourcesByFn.put(fqfn, result);
  workQueue.add(new LocalizeFn(fqfn, resources, result, fn.getClassName(), false));
 }
 workQueue.add(new RefreshClassloader());
}

代码示例来源:origin: apache/drill

public void reloadFunctions() throws HiveException {
 HashSet<String> registryFunctions = new HashSet<String>(
   FunctionRegistry.getFunctionNames(".+\\..+"));
 for (Function function : getAllFunctions()) {
  String functionName = function.getFunctionName();
  try {
   LOG.info("Registering function " + functionName + " " + function.getClassName());
   String qualFunc = FunctionUtils.qualifyFunctionName(functionName, function.getDbName());
   FunctionRegistry.registerPermanentFunction(qualFunc, function.getClassName(), false,
         FunctionTask.toFunctionResource(function.getResourceUris()));
   registryFunctions.remove(qualFunc);
  } catch (Exception e) {
   LOG.warn("Failed to register persistent function " +
       functionName + ":" + function.getClassName() + ". Ignore and continue.");
  }
 }
 // unregister functions from local system registry that are not in getAllFunctions()
 for (String functionName : registryFunctions) {
  try {
   FunctionRegistry.unregisterPermanentFunction(functionName);
  } catch (Exception e) {
   LOG.warn("Failed to unregister persistent function " +
     functionName + "on reload. Ignore and continue.");
  }
 }
}

代码示例来源:origin: apache/hive

replLogger = new BootstrapDumpLogger(dbName, dumpRoot.toString(),
    Utils.getAllTables(hiveDb, dbName).size(),
    hiveDb.getAllFunctions().size());
replLogger.startLog();
Path dbRoot = dumpDbMetadata(dbName, dumpRoot, bootDumpBeginReplId, hiveDb);

代码示例来源:origin: apache/hive

when(hive.getAllFunctions()).thenReturn(Collections.emptyList());
when(queryState.getConf()).thenReturn(conf);
when(conf.getLong("hive.repl.last.repl.id", -1L)).thenReturn(1L);

代码示例来源:origin: apache/lens

/**
  * {@inheritDoc}
  */
 @Override
 public HealthStatus getHealthStatus() {
  boolean isHealthy = true;
  StringBuilder details = new StringBuilder();

  try {
   /** Try to issue command on hive **/
   Hive.get(LensServerConf.getHiveConf()).getAllFunctions();
  } catch (HiveException e) {
   isHealthy = false;
   details.append("Could not connect to Hive.");
   log.error("Could not connect to Hive.", e);
  }

  /** Check if service is up **/
  if (!this.getServiceState().equals(STATE.STARTED)) {
   isHealthy = false;
   details.append("Cube metastore service is down");
   log.error("Cube metastore service is down");
  }

  return isHealthy
   ? new HealthStatus(true, "Cube metastore service is healthy.")
   : new HealthStatus(false, details.toString());
 }
}

代码示例来源:origin: org.apache.hive/hive-llap-server

ResourceDownloader resourceDownloader =
  new ResourceDownloader(conf, udfDir.toUri().normalize().getPath());
List<Function> fns = hive.getAllFunctions();
Set<URI> srcUris = new HashSet<>();
for (Function fn : fns) {

代码示例来源:origin: org.apache.hive/hive-llap-server

public void startLocalizeAllFunctions() throws HiveException {
 Hive hive = Hive.get(false);
 // Do not allow embedded metastore in LLAP unless we are in test.
 try {
  hive.getMSC(HiveConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST), true);
 } catch (MetaException e) {
  throw new HiveException(e);
 }
 List<Function> fns = hive.getAllFunctions();
 for (Function fn : fns) {
  String fqfn = fn.getDbName() + "." + fn.getFunctionName();
  List<ResourceUri> resources = fn.getResourceUris();
  if (resources == null || resources.isEmpty()) continue; // Nothing to localize.
  FnResources result = new FnResources();
  resourcesByFn.put(fqfn, result);
  workQueue.add(new LocalizeFn(fqfn, resources, result, fn.getClassName(), false));
 }
 workQueue.add(new RefreshClassloader());
}

相关文章

Hive类方法