use of org.apache.phoenix.queryserver.server.QueryServer in project phoenix by apache.
the class HttpParamImpersonationQueryServerIT method startQueryServer.
private static void startQueryServer() 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("localhost", PQS_PORT) + ";authentication=SPNEGO";
}
use of org.apache.phoenix.queryserver.server.QueryServer in project drill by apache.
the class QueryServerEnvironment method configureAndStartQueryServer.
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() : "");
LOG.debug("Phoenix Query Server URL: {}", PQS_URL);
}
use of org.apache.phoenix.queryserver.server.QueryServer in project phoenix by apache.
the class SecureQueryServerIT method startQueryServer.
private static void startQueryServer() 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("localhost", PQS_PORT) + ";authentication=SPNEGO";
}
Aggregations