Class QueryServer
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.phoenix.queryserver.server.QueryServer
- All Implemented Interfaces:
Runnable,org.apache.hadoop.conf.Configurable,org.apache.hadoop.util.Tool
public final class QueryServer
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool, Runnable
A query server for Phoenix over Calcite's Avatica.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCallback to run the Avatica server action as the remote (proxy) user instead of the server. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for use fromToolRunner.QueryServer(String[] argv, org.apache.hadoop.conf.Configuration conf) Constructor for use asRunnable. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalling thread waits until the server is running.voidawaitRunning(long timeout, TimeUnit unit) Calling thread waits until the server is running.org.apache.calcite.avatica.server.AvaticaServerConfigurationenableCustomAuth(org.apache.calcite.avatica.server.HttpServer.Builder<org.eclipse.jetty.server.Server> builder, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi) voidenableServerCustomizersIfNecessary(org.apache.calcite.avatica.server.HttpServer.Builder<org.eclipse.jetty.server.Server> builder, org.apache.hadoop.conf.Configuration conf, org.apache.calcite.avatica.server.AvaticaServerConfiguration avaticaServerConfiguration) intgetPort()intstatic voidLog information about the currently running JVM.static voidlogProcessInfo(org.apache.hadoop.conf.Configuration conf) Logs information about the currently running JVM process including the environment variables.static voidbooleanregisterToServiceProvider(String hostName) voidrun()intvoidsetRemoteUserExtractorIfNecessary(org.apache.calcite.avatica.server.HttpServer.Builder builder, org.apache.hadoop.conf.Configuration conf) voidstop()booleanMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
QueryServer
public QueryServer()Constructor for use fromToolRunner. -
QueryServer
Constructor for use asRunnable.
-
-
Method Details
-
logJVMInfo
public static void logJVMInfo()Log information about the currently running JVM. -
logProcessInfo
public static void logProcessInfo(org.apache.hadoop.conf.Configuration conf) Logs information about the currently running JVM process including the environment variables. Logging of env vars can be disabled by setting"phoenix.envvars.logging.disabled"to"true".If enabled, you can also exclude environment variables containing certain substrings by setting
"phoenix.envvars.logging.skipwords"to comma separated list of such substrings. -
getPort
public int getPort()- Returns:
- the port number this instance is bound to, or
-1if the server is not running.
-
getRetCode
public int getRetCode()- Returns:
- the return code from running as a
Tool.
-
getThrowable
- Returns:
- the throwable from an unsuccessful run, or null otherwise.
-
awaitRunning
Calling thread waits until the server is running.- Throws:
InterruptedException
-
awaitRunning
Calling thread waits until the server is running.- Throws:
InterruptedException
-
run
- Specified by:
runin interfaceorg.apache.hadoop.util.Tool- Throws:
Exception
-
stop
public void stop() -
registerToServiceProvider
-
getLoadBalanceConfiguration
-
getRegistry
-
unRegister
public boolean unRegister() -
run
public void run() -
setRemoteUserExtractorIfNecessary
public void setRemoteUserExtractorIfNecessary(org.apache.calcite.avatica.server.HttpServer.Builder builder, org.apache.hadoop.conf.Configuration conf) -
enableServerCustomizersIfNecessary
public void enableServerCustomizersIfNecessary(org.apache.calcite.avatica.server.HttpServer.Builder<org.eclipse.jetty.server.Server> builder, org.apache.hadoop.conf.Configuration conf, org.apache.calcite.avatica.server.AvaticaServerConfiguration avaticaServerConfiguration) -
enableCustomAuth
public org.apache.calcite.avatica.server.AvaticaServerConfiguration enableCustomAuth(org.apache.calcite.avatica.server.HttpServer.Builder<org.eclipse.jetty.server.Server> builder, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi) -
main
- Throws:
Exception
-