org.apache.hive.service.server.HiveServer2.getServices()方法的使用及代码示例

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

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

HiveServer2.getServices介绍

暂无

代码示例

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

static ThriftCLIServiceClient getServiceClientInternal() {
 for (Service service : hiveServer2.getServices()) {
  if (service instanceof ThriftBinaryCLIService) {
   return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
  }
  if (service instanceof ThriftHttpCLIService) {
   return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
  }
 }
 throw new IllegalStateException("HiveServer2 not running Thrift service");
}

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

protected static ThriftCLIServiceClient getServiceClientInternal() {
 for (Service service : hiveServer2.getServices()) {
  if (service instanceof ThriftBinaryCLIService) {
   return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
  }
  if (service instanceof ThriftHttpCLIService) {
   return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
  }
 }
 throw new IllegalStateException("HiveServer2 not running Thrift service");
}

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

startHiveServer();
CLIService service = null;
for (Service s : server.getServices()) {
 if (s instanceof CLIService) {
  service = (CLIService) s;

代码示例来源:origin: linkedin/transport

private void createHiveServer() {
 HiveServer2 server = new HiveServer2();
 server.init(new HiveConf());
 for (Service service : server.getServices()) {
  if (service instanceof CLIService) {
   _client = (CLIService) service;
  }
 }
 Preconditions.checkNotNull(_client, "CLI service not found in local Hive server");
 try {
  _sessionHandle = _client.openSession(null, null, null);
  _functionRegistry = SessionState.getRegistryForWrite();
  // "map_from_entries" UDF is required to create maps with non-primitive key types
  _functionRegistry.registerGenericUDF("map_from_entries", MapFromEntriesWrapper.class);
  // TODO: This is a hack. Hive's public API does not have a way to register an already created GenericUDF object
  // It only accepts a class name after which the parameterless constructor of the class is called to create a
  // GenericUDF object. This does not work for HiveTestStdUDFWrapper as it accepts the UDF classes as parameters.
  // However, Hive has an internal method which does allow passing GenericUDF objects instead of classes.
  _functionRegistryAddFunctionMethod =
    _functionRegistry.getClass().getDeclaredMethod("addFunction", String.class, FunctionInfo.class);
  _functionRegistryAddFunctionMethod.setAccessible(true);
 } catch (HiveSQLException | NoSuchMethodException e) {
  throw new RuntimeException(e);
 }
}

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

public CLIServiceClient getServiceClientInternal() {
 for (Service service : hiveServer2.getServices()) {
  if (service instanceof ThriftBinaryCLIService) {
   return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
  }
  if (service instanceof ThriftHttpCLIService) {
   return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
  }
 }
 throw new IllegalStateException("HiveServer2 not running Thrift service");
}

代码示例来源:origin: klarna/HiveRunner

for (Service service : hiveServer2.getServices()) {
  if (service instanceof CLIService) {
    client = (CLIService) service;

代码示例来源:origin: com.klarna/hiverunner

for (Service service : hiveServer2.getServices()) {
  if (service instanceof CLIService) {
    client = (CLIService) service;

相关文章