public class MasterHostResolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MasterHostResolver.Service |
protected static class |
MasterHostResolver.Status
Union of status for several services.
|
Constructor and Description |
---|
MasterHostResolver(Cluster cluster,
ConfigHelper configHelper,
UpgradeContext upgradeContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Collection<Host> |
getCandidateHosts(Cluster cluster,
ExecuteHostType executeHostType,
String serviceName,
String componentName)
Gets hosts which match the supplied criteria.
|
Cluster |
getCluster()
Gets the cluster that this instance of the
MasterHostResolver is
initialized with. |
HostsType |
getMasterAndHosts(String serviceName,
String componentName)
Get the master hostname of the given service and component.
|
String |
getValueFromDesiredConfigurations(String configType,
String propertyName)
Find Config value for current Cluster using configType and propertyName
|
boolean |
isNameNodeHA()
Determine if HDFS is present and it has NameNode High Availability.
|
protected String |
queryJmxBeanValue(String hostname,
int port,
String beanName,
String attributeName,
boolean asQuery) |
protected String |
queryJmxBeanValue(String hostname,
int port,
String beanName,
String attributeName,
boolean asQuery,
boolean encrypted)
Query the JMX attribute at http(s)://$server:$port/jmx?qry=$query or http(s)://$server:$port/jmx?get=$bean::$attribute
|
public MasterHostResolver(Cluster cluster, ConfigHelper configHelper, UpgradeContext upgradeContext)
configHelper
- Configuration HelperupgradeContext
- the upgrade contextpublic Cluster getCluster()
MasterHostResolver
is
initialized with.null
).public HostsType getMasterAndHosts(String serviceName, String componentName)
serviceName
- ServicecomponentName
- Componentpublic static Collection<Host> getCandidateHosts(Cluster cluster, ExecuteHostType executeHostType, String serviceName, String componentName)
cluster
- executeHostType
- serviceName
- componentName
- public boolean isNameNodeHA() throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public String getValueFromDesiredConfigurations(String configType, String propertyName)
configType
- Config TypepropertyName
- Property Nameprotected String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName, boolean asQuery)
protected String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName, boolean asQuery, boolean encrypted)
hostname
- host nameport
- port numberbeanName
- if asQuery is false, then search for this bean nameattributeName
- if asQuery is false, then search for this attribute nameasQuery
- whether to search bean or queryencrypted
- true if using https instead of http.Copyright © 2022 Apache Software Foundation. All rights reserved.