@InterfaceAudience.Public public class RemoteAdmin extends Object
Modifier and Type | Field and Description |
---|---|
(package private) String |
accessToken |
(package private) Client |
client |
(package private) org.apache.hadoop.conf.Configuration |
conf |
(package private) int |
maxRetries |
(package private) long |
sleepTime |
private static Unmarshaller |
versionClusterUnmarshaller |
Constructor and Description |
---|
RemoteAdmin(Client client,
org.apache.hadoop.conf.Configuration conf)
Constructor
|
RemoteAdmin(Client client,
org.apache.hadoop.conf.Configuration conf,
String accessToken)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
createTable(HTableDescriptor desc)
Creates a new table.
|
void |
deleteTable(byte[] tableName)
Deletes a table.
|
void |
deleteTable(String tableName)
Deletes a table.
|
StorageClusterStatusModel |
getClusterStatus() |
StorageClusterVersionModel |
getClusterVersion() |
private XMLStreamReader |
getInputStream(Response response)
Convert the REST server's response to an XML reader.
|
VersionModel |
getRestVersion() |
TableListModel |
getTableList() |
(package private) static Unmarshaller |
getUnmarsheller() |
boolean |
isTableAvailable(byte[] tableName) |
boolean |
isTableAvailable(String tableName) |
final org.apache.hadoop.conf.Configuration conf
final String accessToken
final int maxRetries
final long sleepTime
private static volatile Unmarshaller versionClusterUnmarshaller
public RemoteAdmin(Client client, org.apache.hadoop.conf.Configuration conf)
client
- conf
- public RemoteAdmin(Client client, org.apache.hadoop.conf.Configuration conf, String accessToken)
client
- conf
- accessToken
- static Unmarshaller getUnmarsheller() throws JAXBException
JAXBException
public boolean isTableAvailable(String tableName) throws IOException
tableName
- name of table to checkIOException
- if a remote or network exception occurspublic VersionModel getRestVersion() throws IOException
IOException
- if the endpoint does not exist, there is a timeout, or some other
general failure modepublic StorageClusterStatusModel getClusterStatus() throws IOException
IOException
- if the endpoint does not exist, there is a timeout, or some other general failure modepublic StorageClusterVersionModel getClusterVersion() throws IOException
IOException
- if the endpoint does not exist, there is a timeout, or some other
general failure modepublic boolean isTableAvailable(byte[] tableName) throws IOException
tableName
- name of table to checkIOException
- if a remote or network exception occurspublic void createTable(HTableDescriptor desc) throws IOException
desc
- table descriptor for tableIOException
- if a remote or network exception occurspublic void deleteTable(String tableName) throws IOException
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic void deleteTable(byte[] tableName) throws IOException
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic TableListModel getTableList() throws IOException
IOException
- if the endpoint does not exist, there is a timeout, or some other
general failure modeprivate XMLStreamReader getInputStream(Response response) throws IOException
response
- The REST server's response.IOException
- If the document fails to parseCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.