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


Java HiveConf.get方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hive.conf.HiveConf.get方法的典型用法代碼示例。如果您正苦於以下問題:Java HiveConf.get方法的具體用法?Java HiveConf.get怎麽用?Java HiveConf.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hive.conf.HiveConf的用法示例。


在下文中一共展示了HiveConf.get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepHiveConfAndData

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
protected static void prepHiveConfAndData() throws Exception {
  hiveConf = new HiveConf();

  // Configure metastore persistence db location on local filesystem
  final String dbUrl = String.format("jdbc:derby:;databaseName=%s;create=true",  getTempDir("metastore_db"));
  hiveConf.set(ConfVars.METASTORECONNECTURLKEY.varname, dbUrl);

  hiveConf.set(ConfVars.SCRATCHDIR.varname, "file:///" + getTempDir("scratch_dir"));
  hiveConf.set(ConfVars.LOCALSCRATCHDIR.varname, getTempDir("local_scratch_dir"));

  // Set MiniDFS conf in HiveConf
  hiveConf.set(FS_DEFAULT_NAME_KEY, dfsConf.get(FS_DEFAULT_NAME_KEY));

  whDir = hiveConf.get(ConfVars.METASTOREWAREHOUSE.varname);
  FileSystem.mkdirs(fs, new Path(whDir), new FsPermission((short) 0777));

  studentData = getPhysicalFileFromResource("student.txt");
  voterData = getPhysicalFileFromResource("voter.txt");
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:20,代碼來源:BaseTestHiveImpersonation.java

示例2: newInstance

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@Override
public CloseableThriftHiveMetastoreIface newInstance(HiveConf hiveConf, String name, int reconnectionRetries) {
  if (isEmpty(hiveConf.get(WaggleDanceHiveConfVars.SSH_ROUTE.varname))) {
    return super.newInstance(hiveConf, name, reconnectionRetries);
  }
  TunnelConnectionManagerFactory tunnelConnectionManagerFactory = createTunnelConnectionManagerFactory(hiveConf);
  URI metaStoreUri = URI.create(hiveConf.getVar(HiveConf.ConfVars.METASTOREURIS));
  String remoteHost = metaStoreUri.getHost();
  int remotePort = metaStoreUri.getPort();
  String sshRoute = hiveConf.get(WaggleDanceHiveConfVars.SSH_ROUTE.varname);
  String localHost = hiveConf.get(WaggleDanceHiveConfVars.SSH_LOCALHOST.varname, "localhost");
  TunnelConnectionManager tunnelConnectionManager = tunnelConnectionManagerFactory.create(sshRoute, localHost,
      FIRST_AVAILABLE_PORT, remoteHost, remotePort);

  tunnelHandler.openTunnel(tunnelConnectionManager, sshRoute, localHost, remoteHost, remotePort);
  HiveConf localHiveConf = createLocalHiveConf(tunnelConnectionManager, localHost, remoteHost, remotePort, hiveConf);
  LOG.info("Metastore URI {} is being proxied to {}", hiveConf.getVar(HiveConf.ConfVars.METASTOREURIS),
      localHiveConf.getVar(HiveConf.ConfVars.METASTOREURIS));

  TunnelingMetastoreClientInvocationHandler tunneledHandler = new TunnelingMetastoreClientInvocationHandler(
      tunnelConnectionManager, super.newInstance(localHiveConf, name, reconnectionRetries));
  return (CloseableThriftHiveMetastoreIface) Proxy.newProxyInstance(getClass().getClassLoader(), INTERFACES,
      tunneledHandler);
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:25,代碼來源:TunnelingMetaStoreClientFactory.java

示例3: HiveLanguageParser

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
public HiveLanguageParser(HiveConf hiveConfiguration) {
  hiveConf = new HiveConf(hiveConfiguration);
  if (hiveConf.get(HDFS_SESSION_PATH_KEY) == null) {
    hiveConf.set(HDFS_SESSION_PATH_KEY, hdfsTemporaryDirectory(hiveConf));
  }
  if (hiveConf.get(LOCAL_SESSION_PATH_KEY) == null) {
    hiveConf.set(LOCAL_SESSION_PATH_KEY, localTemporaryDirectory());
  }
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:10,代碼來源:HiveLanguageParser.java

示例4: createTunnelConnectionManagerFactory

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@VisibleForTesting
TunnelConnectionManagerFactory createTunnelConnectionManagerFactory(HiveConf hiveConf) {
  int sshPort = hiveConf.getInt(WaggleDanceHiveConfVars.SSH_PORT.varname, 22);
  String knownHosts = hiveConf.get(WaggleDanceHiveConfVars.SSH_KNOWN_HOSTS.varname);
  String privateKeys = hiveConf.get(WaggleDanceHiveConfVars.SSH_PRIVATE_KEYS.varname);

  checkArgument(sshPort > 0 && sshPort <= 65536,
      WaggleDanceHiveConfVars.SSH_PORT.varname + " must be a number between 1 and 65536");
  checkArgument(!isNullOrEmpty(privateKeys), WaggleDanceHiveConfVars.SSH_PRIVATE_KEYS.varname + " cannot be null");

  SessionFactorySupplier sessionFactorySupplier = new SessionFactorySupplier(sshPort, knownHosts,
      Arrays.asList(privateKeys.split(",")));

  return new TunnelConnectionManagerFactory(sessionFactorySupplier);
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:16,代碼來源:TunnelingMetaStoreClientFactory.java

示例5: hdfsTemporaryDirectory

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
private static String hdfsTemporaryDirectory(HiveConf hiveConf) {
  return hiveConf.get("hadoop.tmp.dir", "/tmp");
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:4,代碼來源:HiveLanguageParser.java


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