Class LogLevel.CLI

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.http.log.LogLevel.CLI
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool
Enclosing class:
LogLevel

static class LogLevel.CLI extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
  • Field Details

  • Constructor Details

    • CLI

      CLI(org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • run

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

      private void sendLogLevelRequest() throws org.apache.hadoop.HadoopIllegalArgumentException, Exception
      Send HTTP request to the daemon.
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException - if arguments are invalid.
      Exception - if unable to connect
    • parseArguments

      public void parseArguments(String[] args) throws org.apache.hadoop.HadoopIllegalArgumentException
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException
    • parseGetLevelArgs

      private int parseGetLevelArgs(String[] args, int index) throws org.apache.hadoop.HadoopIllegalArgumentException
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException
    • parseSetLevelArgs

      private int parseSetLevelArgs(String[] args, int index) throws org.apache.hadoop.HadoopIllegalArgumentException
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException
    • parseProtocolArgs

      private int parseProtocolArgs(String[] args, int index) throws org.apache.hadoop.HadoopIllegalArgumentException
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException
    • doGetLevel

      private void doGetLevel() throws Exception
      Send HTTP request to get log level.
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException - if arguments are invalid.
      Exception - if unable to connect
    • doSetLevel

      private void doSetLevel() throws Exception
      Send HTTP request to set log level.
      Throws:
      org.apache.hadoop.HadoopIllegalArgumentException - if arguments are invalid.
      Exception - if unable to connect
    • connect

      private HttpURLConnection connect(URL url) throws Exception
      Connect to the URL. Supports HTTP and supports SPNEGO authentication. It falls back to simple authentication if it fails to initiate SPNEGO.
      Parameters:
      url - the URL address of the daemon servlet
      Returns:
      a connected connection
      Throws:
      Exception - if it can not establish a connection.
    • process

      private void process(String urlString) throws Exception
      Configures the client to send HTTP request to the URL. Supports SPENGO for authentication.
      Parameters:
      urlString - URL and query string to the daemon's web UI
      Throws:
      Exception - if unable to connect