Constructor and Description |
---|
ClustersImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addCluster(String clusterName)
Add a new Cluster
|
void |
addHost(String hostname)
Add a Host object to be managed by this server
|
void |
debugDump(StringBuilder sb)
Produces a debug dump into the supplied string buffer
|
void |
deleteCluster(String clusterName)
Deletes the cluster identified by the name
|
void |
deleteHost(String hostname)
Removes a host.
|
Cluster |
getCluster(String clusterName)
Gets the Cluster given the cluster name
|
Cluster |
getClusterById(long id)
Gets the cluster using the id.
|
Map<String,Cluster> |
getClusters()
Get all clusters
|
Set<Cluster> |
getClustersForHost(String hostname)
Returns all the cluster names for this hostname
|
Host |
getHost(String hostname)
Get a Host object managed by this server
|
List<Host> |
getHosts()
Get all hosts being tracked by the Ambari server
|
Map<String,Host> |
getHostsForCluster(String clusterName)
Gets all the hosts associated with the cluster
|
void |
mapHostsToCluster(Set<String> hostnames,
String clusterName)
Maps a set of hosts to the given cluster
|
void |
mapHostToCluster(String hostname,
String clusterName)
Map host to the given cluster.
|
void |
setCurrentStackVersion(String clusterName,
StackId stackId)
Sets the current stack version for the cluster
|
void |
unmapHostFromCluster(String hostname,
String clusterName)
Removes a host from a cluster.
|
void |
updateClusterName(String oldName,
String newName)
Updates the name of the cluster
|
void |
updateHostWithClusterAndAttributes(Map<String,Set<String>> hostClusters,
Map<String,Map<String,String>> hostAttributes)
Update the host set for clusters and the host attributes associated with the hosts
|
public void addCluster(String clusterName) throws AmbariException
Clusters
addCluster
in interface Clusters
AmbariException
public Cluster getCluster(String clusterName) throws AmbariException
Clusters
getCluster
in interface Clusters
clusterName
- Name of the Cluster to retrieveCluster
identified by the given nameAmbariException
public Cluster getClusterById(long id) throws AmbariException
Clusters
getClusterById
in interface Clusters
id
- The identifier associated with the clusterCluster
identified by the identifierAmbariException
public void setCurrentStackVersion(String clusterName, StackId stackId) throws AmbariException
Clusters
setCurrentStackVersion
in interface Clusters
clusterName
- The name of the clusterstackId
- The identifier for the stackAmbariException
public List<Host> getHosts()
Clusters
public Set<Cluster> getClustersForHost(String hostname) throws AmbariException
Clusters
getClustersForHost
in interface Clusters
AmbariException
public Host getHost(String hostname) throws AmbariException
Clusters
getHost
in interface Clusters
hostname
- Name of the host requestedAmbariException
public void addHost(String hostname) throws AmbariException
Clusters
addHost
in interface Clusters
hostname
- Host to be addedAmbariException
public void updateHostWithClusterAndAttributes(Map<String,Set<String>> hostClusters, Map<String,Map<String,String>> hostAttributes) throws AmbariException
Clusters
updateHostWithClusterAndAttributes
in interface Clusters
AmbariException
public void mapHostToCluster(String hostname, String clusterName) throws AmbariException
Clusters
mapHostToCluster
in interface Clusters
AmbariException
public Map<String,Cluster> getClusters()
Clusters
getClusters
in interface Clusters
Map
of clusters with cluster name as keypublic void mapHostsToCluster(Set<String> hostnames, String clusterName) throws AmbariException
Clusters
mapHostsToCluster
in interface Clusters
AmbariException
public void updateClusterName(String oldName, String newName)
Clusters
updateClusterName
in interface Clusters
public void debugDump(StringBuilder sb)
Clusters
public Map<String,Host> getHostsForCluster(String clusterName) throws AmbariException
Clusters
getHostsForCluster
in interface Clusters
clusterName
- The name of the clusterMap
containing host name and Host
AmbariException
public void deleteCluster(String clusterName) throws AmbariException
Clusters
deleteCluster
in interface Clusters
clusterName
- The name of the clusterAmbariException
public void unmapHostFromCluster(String hostname, String clusterName) throws AmbariException
Clusters
unmapHostFromCluster
in interface Clusters
AmbariException
public void deleteHost(String hostname) throws AmbariException
Clusters
Clusters.addHost(String)
deleteHost
in interface Clusters
AmbariException
Copyright © 2015. All rights reserved.