public interface Clusters
| Modifier and Type | Method and Description |
|---|---|
void |
addCluster(String clusterName,
StackId stackId)
Add a new Cluster
|
void |
addCluster(String clusterName,
StackId stackId,
SecurityType securityType)
Add a new cluster
|
void |
addHost(String hostname)
Add a Host object to be managed by this server
|
void |
addSessionAttributes(String name,
Map<String,Object> attributes)
Add the given map of attributes to the session for the cluster identified by the given name.
|
boolean |
checkPermission(String clusterName,
boolean readOnly)
Determine whether or not access to the cluster resource identified
by the given cluster name should be allowed based on the permissions
granted to the current user.
|
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(Long clusterId)
Gets the Cluster given the cluster id
|
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
|
int |
getClusterSize(String clusterName)
Returns the number of hosts that form the cluster identified by the given name.
|
Host |
getHost(String hostname)
Get a Host object managed by this server
|
Host |
getHostById(Long hostId)
Get a Host object managed by this server
|
Map<Long,Host> |
getHostIdsForCluster(String clusterName)
Gets all the host Ids associated with the cluster
|
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
|
Map<String,Object> |
getSessionAttributes(String name)
Get the map of session attributes for the cluster identified by the given name.
|
boolean |
hostExists(String hostname)
Check if host exists
|
void |
invalidate(Cluster cluster)
Invalidates the specified cluster by retrieving it from the database and
refreshing all of the internal stateful collections.
|
void |
invalidateAllClusters()
Invalidates all clusters by retrieving each from the database and refreshing all of its internal
stateful collections.
|
boolean |
isHostMappedToCluster(long clusterId,
String hostName)
Gets whether the specified cluster has a mapping for the specified host.
|
void |
mapAndPublishHostsToCluster(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 |
publishHostsDeletion(Set<Long> hostIds,
Set<String> hostNames)
Publish event set of hosts were removed
|
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 |
updateHostMappings(Host host)
Updates the internal mappings of hosts using the specified host.
|
void |
updateHostWithClusterAndAttributes(Map<String,Set<String>> hostsClusters,
Map<String,Map<String,String>> hostAttributes)
Update the host set for clusters and the host attributes associated with the hosts
|
void addCluster(String clusterName, StackId stackId) throws org.apache.ambari.server.AmbariException
clusterName - the cluster name (not null).stackId - the stack for the cluster (not null).org.apache.ambari.server.AmbariExceptionvoid addCluster(String clusterName, StackId stackId, SecurityType securityType) throws org.apache.ambari.server.AmbariException
clusterName - the cluster name (not null).stackId - the stack for the cluster (not null).securityType - the cluster will be created with this security type.org.apache.ambari.server.AmbariExceptionCluster getCluster(String clusterName) throws org.apache.ambari.server.AmbariException
clusterName - Name of the Cluster to retrieveCluster identified by the given nameorg.apache.ambari.server.AmbariExceptionCluster getCluster(Long clusterId) throws org.apache.ambari.server.AmbariException
clusterId - Id of the Cluster to retrieveCluster identified by the given idorg.apache.ambari.server.AmbariExceptionMap<String,Cluster> getClusters()
Map of clusters with cluster name as keyList<Host> getHosts()
List of HostSet<Cluster> getClustersForHost(String hostname) throws org.apache.ambari.server.AmbariException
hostname - org.apache.ambari.server.AmbariExceptionHost getHost(String hostname) throws org.apache.ambari.server.AmbariException
hostname - Name of the host requestedorg.apache.ambari.server.AmbariExceptionboolean hostExists(String hostname)
hostname - Name of the host requestedboolean isHostMappedToCluster(long clusterId,
String hostName)
clusterId - the cluster IDhostName - the host (not null).true if the host belongs to the cluster, false
otherwise.Host getHostById(Long hostId) throws org.apache.ambari.server.AmbariException
hostId - Host Id from the HostEntity objectyorg.apache.ambari.server.AmbariExceptionvoid updateHostMappings(Host host)
host - the host to update the internal mappings for.void addHost(String hostname) throws org.apache.ambari.server.AmbariException
hostname - Host to be addedorg.apache.ambari.server.AmbariExceptionvoid mapHostToCluster(String hostname, String clusterName) throws org.apache.ambari.server.AmbariException
hostname - clusterName - org.apache.ambari.server.AmbariExceptionvoid mapAndPublishHostsToCluster(Set<String> hostnames, String clusterName) throws org.apache.ambari.server.AmbariException
hostnames - clusterName - org.apache.ambari.server.AmbariExceptionvoid updateClusterName(String oldName, String newName)
oldName - newName - org.apache.ambari.server.AmbariExceptionCluster getClusterById(long id) throws org.apache.ambari.server.AmbariException
id - The identifier associated with the clusterCluster identified by the identifierorg.apache.ambari.server.AmbariExceptionvoid debugDump(StringBuilder sb)
sb - The string buffer to add the debug dump toMap<String,Host> getHostsForCluster(String clusterName)
clusterName - The name of the clusterMap containing host name and HostMap<Long,Host> getHostIdsForCluster(String clusterName) throws org.apache.ambari.server.AmbariException
clusterName - The name of the clusterMap containing host id and Hostorg.apache.ambari.server.AmbariExceptionvoid deleteCluster(String clusterName) throws org.apache.ambari.server.AmbariException
clusterName - The name of the clusterorg.apache.ambari.server.AmbariExceptionvoid updateHostWithClusterAndAttributes(Map<String,Set<String>> hostsClusters, Map<String,Map<String,String>> hostAttributes) throws org.apache.ambari.server.AmbariException
hostsClusters - hostAttributes - org.apache.ambari.server.AmbariExceptionvoid unmapHostFromCluster(String hostname, String clusterName) throws org.apache.ambari.server.AmbariException
hostname - clusterName - org.apache.ambari.server.AmbariExceptionvoid deleteHost(String hostname) throws org.apache.ambari.server.AmbariException
addHost(String)hostname - org.apache.ambari.server.AmbariExceptionvoid publishHostsDeletion(Set<Long> hostIds, Set<String> hostNames) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionboolean checkPermission(String clusterName, boolean readOnly)
clusterName - the cluster namereadOnly - indicate whether or not this check is for a read only operationvoid addSessionAttributes(String name, Map<String,Object> attributes)
name - the cluster nameattributes - the session attributesMap<String,Object> getSessionAttributes(String name)
name - the cluster nameint getClusterSize(String clusterName)
clusterName - the name that identifies the clustervoid invalidate(Cluster cluster)
cluster - the cluster to invalidate and refresh (not null).void invalidateAllClusters()
Copyright © 2022 Apache Software Foundation. All rights reserved.