public class OverriddenMetricsHostProvider extends Object implements MetricHostProvider
MetricHostProvider
that can override default component host names.Constructor and Description |
---|
OverriddenMetricsHostProvider(Map<String,String> overriddenHosts,
MetricHostProvider metricHostProvider,
ConfigHelper configHelper) |
Modifier and Type | Method and Description |
---|---|
String |
getCollectorHostName(String clusterName,
MetricsServiceProvider.MetricsService service)
Get the metrics server host name for the given cluster name.
|
String |
getCollectorPort(String clusterName,
MetricsServiceProvider.MetricsService service)
Get the metrics server port for the given cluster name.
|
Optional<String> |
getExternalHostName(String clusterName,
String componentName)
If a component is installed to a host that is managed outside of Ambari (for example OneFS) then this method will return the external hostname.
|
String |
getHostName(String clusterName,
String componentName)
Get the host name for the given cluster name and component name.
|
boolean |
isCollectorComponentLive(String clusterName,
MetricsServiceProvider.MetricsService service)
Get the status of metrics server component for the given cluster name.
|
boolean |
isCollectorHostExternal(String clusterName)
Is the collector host external to the cluster?
|
boolean |
isCollectorHostLive(String clusterName,
MetricsServiceProvider.MetricsService service)
Get the status of metrics server host for the given cluster name.
|
public OverriddenMetricsHostProvider(Map<String,String> overriddenHosts, MetricHostProvider metricHostProvider, ConfigHelper configHelper)
public Optional<String> getExternalHostName(String clusterName, String componentName)
MetricHostProvider
getExternalHostName
in interface MetricHostProvider
public boolean isCollectorHostExternal(String clusterName)
MetricHostProvider
isCollectorHostExternal
in interface MetricHostProvider
clusterName
- the cluster namepublic String getHostName(String clusterName, String componentName) throws SystemException
MetricHostProvider
getHostName
in interface MetricHostProvider
clusterName
- the cluster namecomponentName
- the component nameSystemException
- if unable to get the JMX host namepublic String getCollectorHostName(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException
MetricHostProvider
getCollectorHostName
in interface MetricHostProvider
clusterName
- the cluster nameSystemException
- if unable to get the metrics server host namepublic String getCollectorPort(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException
MetricHostProvider
getCollectorPort
in interface MetricHostProvider
clusterName
- the cluster nameSystemException
- if unable to get the metrics server portpublic boolean isCollectorHostLive(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException
MetricHostProvider
isCollectorHostLive
in interface MetricHostProvider
clusterName
- the cluster nameSystemException
- if unable to get the status of metrics server hostpublic boolean isCollectorComponentLive(String clusterName, MetricsServiceProvider.MetricsService service) throws SystemException
MetricHostProvider
isCollectorComponentLive
in interface MetricHostProvider
clusterName
- the cluster nameSystemException
- if unable to get the status of metrics server componentCopyright © 2022 Apache Software Foundation. All rights reserved.