本文整理汇总了Java中org.apache.hive.service.cli.CLIServiceClient类的典型用法代码示例。如果您正苦于以下问题:Java CLIServiceClient类的具体用法?Java CLIServiceClient怎么用?Java CLIServiceClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CLIServiceClient类属于org.apache.hive.service.cli包,在下文中一共展示了CLIServiceClient类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitForStart
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
private void waitForStart() throws InterruptedException, TimeoutException, HiveSQLException {
int waitTime = 0;
long pollPeriod = 100L;
long startupTimeout = 1000L * 1000L;
CLIServiceClient hiveClient = getClient();
SessionHandle sessionHandle;
do {
Thread.sleep(pollPeriod);
waitTime += pollPeriod;
if (waitTime > startupTimeout) {
throw new TimeoutException("Couldn't access new HiveServer2: " + getJdbcURL());
}
try {
Map<String, String> sessionConf = new HashMap<>();
sessionHandle = hiveClient.openSession("foo", "bar", sessionConf);
} catch (Exception e) {
continue;
}
hiveClient.closeSession(sessionHandle);
break;
} while (true);
}
示例2: getClient
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
@Override
public CLIServiceClient getClient() throws LensException {
if (!connected) {
try {
log.info("HiveDriver connecting to HiveServer @ {}:{}",
conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST),
conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT));
hs2Client = RetryingThriftCLIServiceClient.newRetryingCLIServiceClient(conf);
log.info("HiveDriver connected to HiveServer @ {}:{}",
conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST),
conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT));
} catch (HiveSQLException e) {
throw new LensException(e);
}
connected = true;
}
return hs2Client;
}
示例3: getServiceClientInternal
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
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");
}
示例4: waitForStartup
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
private void waitForStartup() throws Exception {
int waitTime = 0;
long startupTimeout = 1000L * 1000L;
CLIServiceClient hs2Client = getServiceClientInternal();
SessionHandle sessionHandle = null;
do {
Thread.sleep(500L);
waitTime += 500L;
if (waitTime > startupTimeout) {
throw new TimeoutException("Couldn't access new HiveServer2: " + getJdbcURL());
}
try {
Map <String, String> sessionConf = new HashMap<String, String>();
/**
if (isUseMiniKdc()) {
getMiniKdc().loginUser(getMiniKdc().getDefaultUserPrincipal());
sessionConf.put("principal", serverPrincipal);
}
*/
sessionHandle = hs2Client.openSession("foo", "bar", sessionConf);
} catch (Exception e) {
// service not started yet
continue;
}
hs2Client.closeSession(sessionHandle);
break;
} while (true);
}
示例5: getClient
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
private CLIServiceClient getClient() {
for (Service service : hiveServer.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");
}
示例6: getServiceClient
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
public CLIServiceClient getServiceClient() {
verifyStarted();
return getServiceClientInternal();
}
示例7: HivePersistentResultSet
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
/**
* Instantiates a new hive persistent result set.
*
* @param resultSetPath the result set path
* @param opHandle the op handle
* @param client the client
* @throws HiveSQLException the hive sql exception
*/
public HivePersistentResultSet(Path resultSetPath, OperationHandle opHandle, CLIServiceClient client)
throws HiveSQLException {
this.path = resultSetPath;
this.metadata = client.getResultSetMetadata(opHandle);
}
示例8: getClient
import org.apache.hive.service.cli.CLIServiceClient; //导入依赖的package包/类
/**
* Gets the client.
*
* @return the client
* @throws LensException the lens exception
*/
CLIServiceClient getClient() throws LensException;