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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate HttpURLConnectionConnect to the URL.private voidSend HTTP request to get log level.private voidSend HTTP request to set log level.voidparseArguments(String[] args) private intparseGetLevelArgs(String[] args, int index) private intparseProtocolArgs(String[] args, int index) private intparseSetLevelArgs(String[] args, int index) private voidConfigures the client to send HTTP request to the URL.intprivate voidSend HTTP request to the daemon.Methods 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
-
operation
-
protocol
-
hostName
-
className
-
level
-
-
Constructor Details
-
CLI
CLI(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
run
- Specified by:
runin 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
-