Package org.apache.hadoop.hbase.rest
Class NamespacesInstanceResource
java.lang.Object
org.apache.hadoop.hbase.rest.ResourceBase
org.apache.hadoop.hbase.rest.NamespacesInstanceResource
- All Implemented Interfaces:
Constants
Implements the following REST end points:
/namespaces/{namespace} GET: get namespace properties. /namespaces/{namespace} POST: create namespace. /namespaces/{namespace} PUT: alter namespace. /namespaces/{namespace} DELETE: drop namespace. /namespaces/{namespace}/tables GET: list namespace's tables.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
(package private) String
(package private) boolean
Fields inherited from class org.apache.hadoop.hbase.rest.ResourceBase
accessDeniedClazz, servlet
Fields inherited from interface org.apache.hadoop.hbase.rest.Constants
CRLF, CUSTOM_FILTERS, DEFAULT_LISTEN_PORT, DEFAULT_MAX_AGE, DEFAULT_REST_CLIENT_CONN_TIMEOUT, DEFAULT_REST_CLIENT_SOCKET_TIMEOUT, DEFAULT_REST_SCANNERCACHE_EXPIRE_TIME_MS, DEFAULT_REST_SCANNERCACHE_SIZE, FILTER, FILTER_B64, FILTER_CLASSES, KEY_ENCODING_QUERY_PARAM_NAME, MIMETYPE_BINARY, MIMETYPE_HTML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF, MIMETYPE_TEXT, MIMETYPE_XML, NOCACHE_PARAM_NAME, REST_AUTHENTICATION_PRINCIPAL, REST_AUTHENTICATION_TYPE, REST_CLIENT_CONN_TIMEOUT, REST_CLIENT_SOCKET_TIMEOUT, REST_CONNECTOR_ACCEPT_QUEUE_SIZE, REST_DNS_INTERFACE, REST_DNS_NAMESERVER, REST_KERBEROS_PRINCIPAL, REST_KEYTAB_FILE, REST_SCANNERCACHE_EXPIRE_TIME, REST_SCANNERCACHE_SIZE, REST_SSL_ENABLED, REST_SSL_EXCLUDE_CIPHER_SUITES, REST_SSL_EXCLUDE_PROTOCOLS, REST_SSL_INCLUDE_CIPHER_SUITES, REST_SSL_INCLUDE_PROTOCOLS, REST_SSL_KEYSTORE_KEYPASSWORD, REST_SSL_KEYSTORE_PASSWORD, REST_SSL_KEYSTORE_STORE, REST_SSL_KEYSTORE_TYPE, REST_SSL_TRUSTSTORE_PASSWORD, REST_SSL_TRUSTSTORE_STORE, REST_SSL_TRUSTSTORE_TYPE, REST_THREAD_POOL_TASK_QUEUE_SIZE, REST_THREAD_POOL_THREAD_IDLE_TIMEOUT, REST_THREAD_POOL_THREADS_MAX, REST_THREAD_POOL_THREADS_MIN, ROW_KEYS_PARAM_NAME, SCAN_BATCH_SIZE, SCAN_CACHE_BLOCKS, SCAN_COLUMN, SCAN_END_ROW, SCAN_END_TIME, SCAN_FETCH_SIZE, SCAN_FILTER, SCAN_LIMIT, SCAN_MAX_VERSIONS, SCAN_REVERSED, SCAN_START_ROW, SCAN_START_TIME, VERSION_STRING
-
Constructor Summary
ConstructorDescriptionNamespacesInstanceResource
(String namespace) Constructor for standard NamespaceInstanceResource.NamespacesInstanceResource
(String namespace, boolean queryTables) Constructor for querying namespace table list via NamespaceInstanceResource. -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hbase.thirdparty.javax.ws.rs.core.Response
createOrUpdate
(NamespacesInstanceModel model, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo, Admin admin, boolean updateExisting) org.apache.hbase.thirdparty.javax.ws.rs.core.Response
deleteNoBody
(byte[] message, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo, org.apache.hbase.thirdparty.javax.ws.rs.core.HttpHeaders headers) Build a response for DELETE delete namespace.private boolean
doesNamespaceExist
(Admin admin, String namespaceName) org.apache.hbase.thirdparty.javax.ws.rs.core.Response
get
(javax.servlet.ServletContext context, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for GET namespace description or GET list of namespace tables.getNamespaceInstanceResource
(String namespace) Dispatch to NamespaceInstanceResource for getting list of tables.org.apache.hbase.thirdparty.javax.ws.rs.core.Response
post
(NamespacesInstanceModel model, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for POST create namespace with properties specified.private org.apache.hbase.thirdparty.javax.ws.rs.core.Response
processUpdate
(NamespacesInstanceModel model, boolean updateExisting, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) org.apache.hbase.thirdparty.javax.ws.rs.core.Response
put
(NamespacesInstanceModel model, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for PUT alter namespace with properties specified.Methods inherited from class org.apache.hadoop.hbase.rest.ResourceBase
processException
-
Field Details
-
LOG
-
namespace
-
queryTables
boolean queryTables
-
-
Constructor Details
-
NamespacesInstanceResource
Constructor for standard NamespaceInstanceResource.- Throws:
IOException
-
NamespacesInstanceResource
Constructor for querying namespace table list via NamespaceInstanceResource.- Throws:
IOException
-
-
Method Details
-
get
@GET @Produces({"text/plain","text/xml","application/json","application/x-protobuf","application/protobuf"}) public org.apache.hbase.thirdparty.javax.ws.rs.core.Response get(@Context javax.servlet.ServletContext context, @Context org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for GET namespace description or GET list of namespace tables.- Parameters:
context
- servlet contexturiInfo
- (JAX-RS context variable) request URL- Returns:
- A response containing NamespacesInstanceModel for a namespace descriptions and TableListModel for a list of namespace tables.
-
put
@PUT @Consumes({"text/xml","application/json","application/x-protobuf","application/protobuf"}) public org.apache.hbase.thirdparty.javax.ws.rs.core.Response put(NamespacesInstanceModel model, @Context org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for PUT alter namespace with properties specified.- Parameters:
model
- properties used for alter.uriInfo
- (JAX-RS context variable) request URL- Returns:
- response code.
-
post
@POST @Consumes({"text/xml","application/json","application/x-protobuf","application/protobuf"}) public org.apache.hbase.thirdparty.javax.ws.rs.core.Response post(NamespacesInstanceModel model, @Context org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) Build a response for POST create namespace with properties specified.- Parameters:
model
- properties used for create.uriInfo
- (JAX-RS context variable) request URL- Returns:
- response code.
-
processUpdate
private org.apache.hbase.thirdparty.javax.ws.rs.core.Response processUpdate(NamespacesInstanceModel model, boolean updateExisting, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo) -
createOrUpdate
private org.apache.hbase.thirdparty.javax.ws.rs.core.Response createOrUpdate(NamespacesInstanceModel model, org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo, Admin admin, boolean updateExisting) -
doesNamespaceExist
- Throws:
IOException
-
deleteNoBody
@DELETE public org.apache.hbase.thirdparty.javax.ws.rs.core.Response deleteNoBody(byte[] message, @Context org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo uriInfo, @Context org.apache.hbase.thirdparty.javax.ws.rs.core.HttpHeaders headers) Build a response for DELETE delete namespace.- Parameters:
message
- value not used.headers
- value not used.- Returns:
- response code.
-
getNamespaceInstanceResource
@Path("tables") public NamespacesInstanceResource getNamespaceInstanceResource(@PathParam("tables") String namespace) throws IOException Dispatch to NamespaceInstanceResource for getting list of tables.- Throws:
IOException
-