public class RESTApiClusterManager extends org.apache.hadoop.conf.Configured implements ClusterManager
| Modifier and Type | Class and Description |
|---|---|
private static class |
RESTApiClusterManager.RoleCommand |
private static class |
RESTApiClusterManager.Service |
ClusterManager.ServiceType| Modifier and Type | Field and Description |
|---|---|
private static String |
API_VERSION |
private javax.ws.rs.client.Client |
client |
private String |
clusterName |
private static String |
DEFAULT_CLUSTER_NAME |
private static String |
DEFAULT_SERVER_HOSTNAME |
private static String |
DEFAULT_SERVER_PASSWORD |
private static String |
DEFAULT_SERVER_USERNAME |
private ClusterManager |
hBaseClusterManager |
private static org.slf4j.Logger |
LOG |
private static String |
REST_API_CLUSTER_MANAGER_CLUSTER_NAME |
private static String |
REST_API_CLUSTER_MANAGER_HOSTNAME |
private static String |
REST_API_CLUSTER_MANAGER_PASSWORD |
private static String |
REST_API_CLUSTER_MANAGER_USERNAME |
private static Map<ClusterManager.ServiceType,RESTApiClusterManager.Service> |
roleServiceType |
private String |
serverHostname |
private String |
serverPassword |
private String |
serverUsername |
| Constructor and Description |
|---|
RESTApiClusterManager() |
| Modifier and Type | Method and Description |
|---|---|
private void |
doRoleCommand(String serviceName,
String roleName,
RESTApiClusterManager.RoleCommand roleCommand) |
private String |
getHealthSummary(String serviceName,
String roleType,
String hostId) |
private String |
getHostId(String hostname) |
private com.fasterxml.jackson.databind.JsonNode |
getJsonNodeFromURIGet(URI uri) |
private String |
getRoleName(String serviceName,
String roleType,
String hostId) |
private String |
getRolePropertyValue(String serviceName,
String roleType,
String hostId,
String property) |
private String |
getRoleState(String serviceName,
String roleType,
String hostId) |
private String |
getServiceName(RESTApiClusterManager.Service service) |
boolean |
isRunning(ClusterManager.ServiceType service,
String hostname,
int port)
Returns whether the service is running on the remote host.
|
void |
kill(ClusterManager.ServiceType service,
String hostname,
int port)
Kills the service running on the given host
|
private void |
performClusterManagerCommand(ClusterManager.ServiceType role,
String hostname,
RESTApiClusterManager.RoleCommand command) |
void |
restart(ClusterManager.ServiceType service,
String hostname,
int port)
Restart the service on the given host
|
void |
resume(ClusterManager.ServiceType service,
String hostname,
int port)
Resumes the services running on the given host
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
start(ClusterManager.ServiceType service,
String hostname,
int port)
Start the service on the given host
|
void |
stop(ClusterManager.ServiceType service,
String hostname,
int port)
Stop the service on the given host
|
void |
suspend(ClusterManager.ServiceType service,
String hostname,
int port)
Suspends the service running on the given host
|
private static final String REST_API_CLUSTER_MANAGER_HOSTNAME
private static final String REST_API_CLUSTER_MANAGER_USERNAME
private static final String REST_API_CLUSTER_MANAGER_PASSWORD
private static final String REST_API_CLUSTER_MANAGER_CLUSTER_NAME
private static final String DEFAULT_SERVER_HOSTNAME
private static final String DEFAULT_SERVER_USERNAME
private static final String DEFAULT_SERVER_PASSWORD
private static final String DEFAULT_CLUSTER_NAME
private String serverHostname
private String serverUsername
private String serverPassword
private String clusterName
private static final String API_VERSION
private javax.ws.rs.client.Client client
private ClusterManager hBaseClusterManager
private static final org.slf4j.Logger LOG
private static Map<ClusterManager.ServiceType,RESTApiClusterManager.Service> roleServiceType
RESTApiClusterManager()
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class org.apache.hadoop.conf.Configuredpublic void start(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerstart in interface ClusterManagerIOExceptionpublic void stop(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerstop in interface ClusterManagerIOExceptionpublic void restart(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerrestart in interface ClusterManagerIOExceptionpublic boolean isRunning(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerisRunning in interface ClusterManagerIOExceptionpublic void kill(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerkill in interface ClusterManagerIOExceptionpublic void suspend(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagersuspend in interface ClusterManagerIOExceptionpublic void resume(ClusterManager.ServiceType service, String hostname, int port) throws IOException
ClusterManagerresume in interface ClusterManagerIOExceptionprivate void performClusterManagerCommand(ClusterManager.ServiceType role, String hostname, RESTApiClusterManager.RoleCommand command) throws IOException
IOExceptionprivate void doRoleCommand(String serviceName, String roleName, RESTApiClusterManager.RoleCommand roleCommand)
private String getHealthSummary(String serviceName, String roleType, String hostId) throws IOException
IOExceptionprivate String getHostId(String hostname) throws IOException
IOExceptionprivate com.fasterxml.jackson.databind.JsonNode getJsonNodeFromURIGet(URI uri) throws IOException
IOExceptionprivate String getRoleName(String serviceName, String roleType, String hostId) throws IOException
IOExceptionprivate String getRolePropertyValue(String serviceName, String roleType, String hostId, String property) throws IOException
IOExceptionprivate String getRoleState(String serviceName, String roleType, String hostId) throws IOException
IOExceptionprivate String getServiceName(RESTApiClusterManager.Service service) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.