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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Callback to run the Avatica server action as the remote (proxy) user instead of the server.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for use from ToolRunner.
    QueryServer(String[] argv, org.apache.hadoop.conf.Configuration conf)
    Constructor for use as Runnable.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Calling thread waits until the server is running.
    void
    awaitRunning(long timeout, TimeUnit unit)
    Calling thread waits until the server is running.
    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)
     
    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)
     
     
    int
     
     
    int
     
     
    static void
    Log information about the currently running JVM.
    static void
    logProcessInfo(org.apache.hadoop.conf.Configuration conf)
    Logs information about the currently running JVM process including the environment variables.
    static void
    main(String[] argv)
     
    boolean
     
    void
    run()
     
    int
    run(String[] args)
     
    void
    setRemoteUserExtractorIfNecessary(org.apache.calcite.avatica.server.HttpServer.Builder builder, org.apache.hadoop.conf.Configuration conf)
     
    void
     
    boolean
     

    Methods inherited from class org.apache.hadoop.conf.Configured

    getConf, setConf

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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 from ToolRunner.
    • QueryServer

      public QueryServer(String[] argv, org.apache.hadoop.conf.Configuration conf)
      Constructor for use as Runnable.
  • 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 -1 if the server is not running.
    • getRetCode

      public int getRetCode()
      Returns:
      the return code from running as a Tool.
    • getThrowable

      public Throwable getThrowable()
      Returns:
      the throwable from an unsuccessful run, or null otherwise.
    • awaitRunning

      public void awaitRunning() throws InterruptedException
      Calling thread waits until the server is running.
      Throws:
      InterruptedException
    • awaitRunning

      public void awaitRunning(long timeout, TimeUnit unit) throws InterruptedException
      Calling thread waits until the server is running.
      Throws:
      InterruptedException
    • run

      public int run(String[] args) throws Exception
      Specified by:
      run in interface org.apache.hadoop.util.Tool
      Throws:
      Exception
    • stop

      public void stop()
    • registerToServiceProvider

      public boolean registerToServiceProvider(String hostName)
    • getLoadBalanceConfiguration

      public LoadBalanceZookeeperConf getLoadBalanceConfiguration()
    • getRegistry

      public Registry getRegistry()
    • unRegister

      public boolean unRegister()
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • 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

      public static void main(String[] argv) throws Exception
      Throws:
      Exception