Package org.apache.hadoop.hbase.http.log
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate HttpURLConnection
Connect to the URL.private void
Send HTTP request to get log level.private void
Send HTTP request to set log level.void
parseArguments
(String[] args) private int
parseGetLevelArgs
(String[] args, int index) private int
parseProtocolArgs
(String[] args, int index) private int
parseSetLevelArgs
(String[] args, int index) private void
Configures the client to send HTTP request to the URL.int
private void
Send HTTP request to the daemon.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
-
operation
-
protocol
-
hostName
-
className
-
level
-
-
Constructor Details
-
CLI
CLI(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
sendLogLevelRequest
private void sendLogLevelRequest() throws org.apache.hadoop.HadoopIllegalArgumentException, ExceptionSend HTTP request to the daemon.- Throws:
org.apache.hadoop.HadoopIllegalArgumentException
- if arguments are invalid.Exception
- if unable to connect
-
parseArguments
- 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
Send HTTP request to get log level.- Throws:
org.apache.hadoop.HadoopIllegalArgumentException
- if arguments are invalid.Exception
- if unable to connect
-
doSetLevel
Send HTTP request to set log level.- Throws:
org.apache.hadoop.HadoopIllegalArgumentException
- if arguments are invalid.Exception
- if unable to connect
-
connect
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
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
-