Package org.apache.hadoop.hbase.http
Class InfoServer
java.lang.Object
org.apache.hadoop.hbase.http.InfoServer
Create a Jetty embedded server to answer http requests. The primary goal is to serve up status
information for the server. There are three contexts: "/stacks/" -> points to stack trace
"/static/" -> points to common static files (src/hbase-webapps/static) "/" -> the jsp
server code from (src/hbase-webapps/<name>)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInfoServer
(String name, String bindAddress, int port, boolean findPort, org.apache.hadoop.conf.Configuration c) Create a status server on the given port. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPrivilegedServlet
(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access.void
addServlet
(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Deprecated.void
addUnprivilegedServlet
(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access.void
addUnprivilegedServlet
(String name, String pathSpec, org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletHolder holder) Adds a servlet in the server that any user can access.(package private) org.apache.hadoop.security.authorize.AccessControlList
buildAdminAcl
(org.apache.hadoop.conf.Configuration conf) Builds an ACL that will restrict the users who can issue commands to endpoints on the UI which are meant only for administrators.static boolean
canUserModifyUI
(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext ctx, org.apache.hadoop.conf.Configuration conf) Returns true if and only if UI authentication (spnego) is enabled, UI authorization is enabled, and the requesting user is defined as an administrator.int
getPort()
Deprecated.Since 0.99.0void
setAttribute
(String name, Object value) void
start()
void
stop()
-
Field Details
-
HBASE_APP_DIR
- See Also:
-
httpServer
-
-
Constructor Details
-
InfoServer
public InfoServer(String name, String bindAddress, int port, boolean findPort, org.apache.hadoop.conf.Configuration c) throws IOException Create a status server on the given port. The jsp scripts are taken from src/hbase-webapps/name
.- Parameters:
name
- The name of the serverbindAddress
- address to bind toport
- The port to use on the serverfindPort
- whether the server should start at the given port and increment by 1 until it finds a free port.c
- theConfiguration
to build the server- Throws:
IOException
- if getting one of the password fails or the server cannot be created
-
-
Method Details
-
buildAdminAcl
org.apache.hadoop.security.authorize.AccessControlList buildAdminAcl(org.apache.hadoop.conf.Configuration conf) Builds an ACL that will restrict the users who can issue commands to endpoints on the UI which are meant only for administrators. -
addServlet
@Deprecated public void addServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Deprecated.UseaddUnprivilegedServlet(String, String, Class)
oraddPrivilegedServlet(String, String, Class)
instead of this method which does not state outwardly what kind of authz rules will be applied to this servlet.Explicitly invokeaddPrivilegedServlet(String, String, Class)
oraddUnprivilegedServlet(String, String, Class)
instead of this method. This method will add a servlet which any authenticated user can access. -
addUnprivilegedServlet
public void addUnprivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access. -
addUnprivilegedServlet
public void addUnprivilegedServlet(String name, String pathSpec, org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletHolder holder) Adds a servlet in the server that any user can access. -
addPrivilegedServlet
public void addPrivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access. -
setAttribute
-
start
- Throws:
IOException
-
getPort
Deprecated.Since 0.99.0- Returns:
- the port of the info server
-
stop
- Throws:
Exception
-
canUserModifyUI
public static boolean canUserModifyUI(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext ctx, org.apache.hadoop.conf.Configuration conf) Returns true if and only if UI authentication (spnego) is enabled, UI authorization is enabled, and the requesting user is defined as an administrator. If the UI is set to readonly, this method always returns false.
-
addUnprivilegedServlet(String, String, Class)
oraddPrivilegedServlet(String, String, Class)
instead of this method which does not state outwardly what kind of authz rules will be applied to this servlet.