public class ClusterTopologyImpl extends Object implements ClusterTopology
| Constructor and Description |
|---|
ClusterTopologyImpl(AmbariContext ambariContext,
TopologyRequest topologyRequest) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHostToTopology(String hostGroupName,
String host)
Add a new host to the topology.
|
Map<String,AdvisedConfiguration> |
getAdvisedConfigurations() |
Set<String> |
getAllHosts() |
AmbariContext |
getAmbariContext() |
Blueprint |
getBlueprint()
Get the blueprint associated with the cluster.
|
Long |
getClusterId()
Get the id of the cluster.
|
ConfigRecommendationStrategy |
getConfigRecommendationStrategy() |
Configuration |
getConfiguration()
Get the cluster scoped configuration for the cluster.
|
String |
getDefaultPassword() |
Collection<String> |
getHostAssignmentsForComponent(String component)
Get all hosts which are mapped to a host group which contains the specified component.
|
String |
getHostGroupForHost(String hostname)
Get the name of the host group which is mapped to the specified host.
|
Map<String,HostGroupInfo> |
getHostGroupInfo()
Get host group information.
|
Collection<String> |
getHostGroupsForComponent(String component)
Get the names of all of host groups which contain the specified component.
|
ProvisionAction |
getProvisionAction() |
boolean |
hasHadoopCompatibleService() |
RequestStatusResponse |
installHost(String hostName,
boolean skipInstallTaskCreate,
boolean skipFailure)
Install the specified host.
|
boolean |
isClusterKerberosEnabled()
Determine if the cluster is kerberos enabled.
|
boolean |
isNameNodeHAEnabled()
Determine if NameNode HA is enabled.
|
static boolean |
isNameNodeHAEnabled(Map<String,Map<String,String>> configurationProperties) |
boolean |
isYarnResourceManagerHAEnabled()
Determine if Yarn ResourceManager HA is enabled.
|
void |
removeHost(String hostname)
Removes host from stateful ClusterTopology
|
void |
setClusterId(Long clusterId)
Set the id of the cluster.
|
void |
setConfigRecommendationStrategy(ConfigRecommendationStrategy strategy) |
void |
setProvisionAction(ProvisionAction provisionAction)
Set request provision action : INSTALL vs INSTALL_AND_START
|
RequestStatusResponse |
startHost(String hostName,
boolean skipFailure)
Start the specified host.
|
void |
update(TopologyRequest topologyRequest)
Update the existing topology based on the provided topology request.
|
public ClusterTopologyImpl(AmbariContext ambariContext, TopologyRequest topologyRequest) throws InvalidTopologyException
InvalidTopologyExceptionpublic void update(TopologyRequest topologyRequest) throws InvalidTopologyException
ClusterTopologyupdate in interface ClusterTopologytopologyRequest - request modifying the topologyInvalidTopologyException - if the request specified invalid topology information or if
making the requested changes would result in an invalid topologypublic Long getClusterId()
ClusterTopologygetClusterId in interface ClusterTopologypublic void setClusterId(Long clusterId)
ClusterTopologysetClusterId in interface ClusterTopologyclusterId - cluster idpublic Blueprint getBlueprint()
ClusterTopologygetBlueprint in interface ClusterTopologypublic Configuration getConfiguration()
ClusterTopologygetConfiguration in interface ClusterTopologypublic Map<String,HostGroupInfo> getHostGroupInfo()
ClusterTopologygetHostGroupInfo in interface ClusterTopologypublic Collection<String> getHostGroupsForComponent(String component)
ClusterTopologygetHostGroupsForComponent in interface ClusterTopologycomponent - component namepublic String getHostGroupForHost(String hostname)
ClusterTopologygetHostGroupForHost in interface ClusterTopologyhostname - host namepublic void addHostToTopology(String hostGroupName, String host) throws InvalidTopologyException, NoSuchHostGroupException
ClusterTopologyaddHostToTopology in interface ClusterTopologyhostGroupName - name of associated host grouphost - name of hostInvalidTopologyException - if the host being added is already registered to a different host groupNoSuchHostGroupException - if the specified host group is invalidpublic Set<String> getAllHosts()
getAllHosts in interface ClusterTopologypublic Collection<String> getHostAssignmentsForComponent(String component)
ClusterTopologygetHostAssignmentsForComponent in interface ClusterTopologycomponent - component namepublic boolean isNameNodeHAEnabled()
ClusterTopologyisNameNodeHAEnabled in interface ClusterTopologypublic static boolean isNameNodeHAEnabled(Map<String,Map<String,String>> configurationProperties)
public boolean isYarnResourceManagerHAEnabled()
ClusterTopologyisYarnResourceManagerHAEnabled in interface ClusterTopologypublic boolean isClusterKerberosEnabled()
ClusterTopologyisClusterKerberosEnabled in interface ClusterTopologypublic RequestStatusResponse installHost(String hostName, boolean skipInstallTaskCreate, boolean skipFailure)
ClusterTopologyinstallHost in interface ClusterTopologyhostName - host namepublic RequestStatusResponse startHost(String hostName, boolean skipFailure)
ClusterTopologystartHost in interface ClusterTopologyhostName - host namepublic void setConfigRecommendationStrategy(ConfigRecommendationStrategy strategy)
setConfigRecommendationStrategy in interface ClusterTopologypublic ConfigRecommendationStrategy getConfigRecommendationStrategy()
getConfigRecommendationStrategy in interface ClusterTopologypublic ProvisionAction getProvisionAction()
getProvisionAction in interface ClusterTopologypublic void setProvisionAction(ProvisionAction provisionAction)
ClusterTopologysetProvisionAction in interface ClusterTopologyprovisionAction - @ProvisionActionpublic Map<String,AdvisedConfiguration> getAdvisedConfigurations()
getAdvisedConfigurations in interface ClusterTopologypublic AmbariContext getAmbariContext()
getAmbariContext in interface ClusterTopologypublic void removeHost(String hostname)
ClusterTopologyremoveHost in interface ClusterTopologypublic String getDefaultPassword()
getDefaultPassword in interface ClusterTopologypublic boolean hasHadoopCompatibleService()
hasHadoopCompatibleService in interface ClusterTopologyCopyright © 2022 Apache Software Foundation. All rights reserved.