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
InvalidTopologyException
public void update(TopologyRequest topologyRequest) throws InvalidTopologyException
ClusterTopology
update
in interface ClusterTopology
topologyRequest
- 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()
ClusterTopology
getClusterId
in interface ClusterTopology
public void setClusterId(Long clusterId)
ClusterTopology
setClusterId
in interface ClusterTopology
clusterId
- cluster idpublic Blueprint getBlueprint()
ClusterTopology
getBlueprint
in interface ClusterTopology
public Configuration getConfiguration()
ClusterTopology
getConfiguration
in interface ClusterTopology
public Map<String,HostGroupInfo> getHostGroupInfo()
ClusterTopology
getHostGroupInfo
in interface ClusterTopology
public Collection<String> getHostGroupsForComponent(String component)
ClusterTopology
getHostGroupsForComponent
in interface ClusterTopology
component
- component namepublic String getHostGroupForHost(String hostname)
ClusterTopology
getHostGroupForHost
in interface ClusterTopology
hostname
- host namepublic void addHostToTopology(String hostGroupName, String host) throws InvalidTopologyException, NoSuchHostGroupException
ClusterTopology
addHostToTopology
in interface ClusterTopology
hostGroupName
- 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 ClusterTopology
public Collection<String> getHostAssignmentsForComponent(String component)
ClusterTopology
getHostAssignmentsForComponent
in interface ClusterTopology
component
- component namepublic boolean isNameNodeHAEnabled()
ClusterTopology
isNameNodeHAEnabled
in interface ClusterTopology
public static boolean isNameNodeHAEnabled(Map<String,Map<String,String>> configurationProperties)
public boolean isYarnResourceManagerHAEnabled()
ClusterTopology
isYarnResourceManagerHAEnabled
in interface ClusterTopology
public boolean isClusterKerberosEnabled()
ClusterTopology
isClusterKerberosEnabled
in interface ClusterTopology
public RequestStatusResponse installHost(String hostName, boolean skipInstallTaskCreate, boolean skipFailure)
ClusterTopology
installHost
in interface ClusterTopology
hostName
- host namepublic RequestStatusResponse startHost(String hostName, boolean skipFailure)
ClusterTopology
startHost
in interface ClusterTopology
hostName
- host namepublic void setConfigRecommendationStrategy(ConfigRecommendationStrategy strategy)
setConfigRecommendationStrategy
in interface ClusterTopology
public ConfigRecommendationStrategy getConfigRecommendationStrategy()
getConfigRecommendationStrategy
in interface ClusterTopology
public ProvisionAction getProvisionAction()
getProvisionAction
in interface ClusterTopology
public void setProvisionAction(ProvisionAction provisionAction)
ClusterTopology
setProvisionAction
in interface ClusterTopology
provisionAction
- @ProvisionActionpublic Map<String,AdvisedConfiguration> getAdvisedConfigurations()
getAdvisedConfigurations
in interface ClusterTopology
public AmbariContext getAmbariContext()
getAmbariContext
in interface ClusterTopology
public void removeHost(String hostname)
ClusterTopology
removeHost
in interface ClusterTopology
public String getDefaultPassword()
getDefaultPassword
in interface ClusterTopology
public boolean hasHadoopCompatibleService()
hasHadoopCompatibleService
in interface ClusterTopology
Copyright © 2022 Apache Software Foundation. All rights reserved.