in phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java [297:326]
private void configureAndStartQueryServer(boolean tls) throws Exception {
PQS = new QueryServer(new String[0], UTIL.getConfiguration());
// Get the PQS ident for PQS to use
final UserGroupInformation ugi =
UserGroupInformation.loginUserFromKeytabAndReturnUGI(PQS_PRINCIPAL,
KEYTAB.getAbsolutePath());
PQS_EXECUTOR = Executors.newSingleThreadExecutor();
// Launch PQS, doing in the Kerberos login instead of letting PQS do it itself (which would
// break the HBase/HDFS logins also running in the same test case).
PQS_EXECUTOR.submit(new Runnable() {
@Override
public void run() {
ugi.doAs(new PrivilegedAction<Void>() {
@Override
public Void run() {
PQS.run();
return null;
}
});
}
});
PQS.awaitRunning();
PQS_PORT = PQS.getPort();
PQS_URL =
ThinClientUtil.getConnectionUrl(tls ? "https" : "http", "localhost", PQS_PORT)
+ ";authentication=SPNEGO" + (tls
? ";truststore=" + TlsUtil.getTrustStoreFile().getAbsolutePath()
+ ";truststore_password=" + TlsUtil.getTrustStorePassword()
: "");
}