in phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java [101:134]
public void startQueryServer() throws Exception {
setupQueryServerConfiguration(conf);
executor = Executors.newSingleThreadExecutor();
if (principal != null && !principal.isEmpty() && null != keytab) {
// Get the PQS ident for PQS to use
final UserGroupInformation ugi = UserGroupInformation
.loginUserFromKeytabAndReturnUGI(principal, keytab.getAbsolutePath());
// 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).
executor.submit(new Runnable() {
@Override
public void run() {
ugi.doAs(new PrivilegedAction<Void>() {
@Override
public Void run() {
pqs.run();
return null;
}
});
}
});
} else {
// Launch PQS without a login
executor.submit(new Runnable() {
@Override
public void run() {
pqs.run();
}
});
}
pqs.awaitRunning();
port = pqs.getPort();
url = ThinClientUtil.getConnectionUrl("localhost", port);
}