本文整理汇总了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");
}
示例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);
}
示例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());
}
}
示例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);
}
示例5: hdfsTemporaryDirectory
import org.apache.hadoop.hive.conf.HiveConf; //导入方法依赖的package包/类
private static String hdfsTemporaryDirectory(HiveConf hiveConf) {
return hiveConf.get("hadoop.tmp.dir", "/tmp");
}