public abstract class AbstractProviderModule extends Object implements ProviderModule, ResourceProviderObserver, JMXHostProvider, MetricHostProvider, MetricsServiceProvider
MetricsServiceProvider.MetricsService
Modifier and Type | Field and Description |
---|---|
protected AmbariEventPublisher |
eventPublisher
Used to respond to the following events:
ClusterConfigChangedEvent |
protected AmbariManagementController |
managementController |
Constructor and Description |
---|
AbstractProviderModule()
Create a default provider module.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createPropertyProviders(Resource.Type type) |
protected abstract ResourceProvider |
createResourceProvider(Resource.Type type) |
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.
|
String |
getHostName(String clusterName,
String componentName)
Get the host name for the given cluster name and component name.
|
Set<String> |
getHostNames(String clusterName,
String componentName)
Get the JMX host names for the given cluster name and component name.
|
String |
getJMXProtocol(String clusterName,
String componentName)
Get the protocol for the specified cluster name and component.
|
String |
getJMXRpcMetricTag(String clusterName,
String componentName,
String port)
Get the rpc tag for the specified cluster name, component and port number
|
MetricsServiceProvider.MetricsService |
getMetricsServiceType()
Get type of Metrics system installed.
|
String |
getPort(String clusterName,
String componentName,
String hostName,
boolean httpsEnabled)
Get the port for the specified cluster name and component.
|
List<PropertyProvider> |
getPropertyProviders(Resource.Type type)
Get the list of property providers for the given resource type.
|
String |
getPublicHostName(String clusterName,
String hostName) |
ResourceProvider |
getResourceProvider(Resource.Type type)
Get a resource adapter for the given resource type.
|
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.
|
void |
onConfigurationChangedEvent(ClusterConfigChangedEvent event)
Handles
ClusterConfigChangedEvent which means that some caches
should invalidate. |
protected void |
putPropertyProviders(Resource.Type type,
List<PropertyProvider> providers) |
protected void |
putResourceProvider(Resource.Type type,
ResourceProvider resourceProvider) |
protected void |
registerResourceProvider(Resource.Type type) |
void |
update(ResourceProviderEvent event)
Update this observer with an event from a resource provider.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExternalHostName
@Inject protected AmbariManagementController managementController
@Inject protected AmbariEventPublisher eventPublisher
public AbstractProviderModule()
public ResourceProvider getResourceProvider(Resource.Type type)
ProviderModule
getResourceProvider
in interface ProviderModule
type
- the resource typepublic List<PropertyProvider> getPropertyProviders(Resource.Type type)
ProviderModule
getPropertyProviders
in interface ProviderModule
type
- the resource typepublic void update(ResourceProviderEvent event)
ResourceProviderObserver
update
in interface ResourceProviderObserver
event
- the eventpublic MetricsServiceProvider.MetricsService getMetricsServiceType()
getMetricsServiceType
in interface MetricsServiceProvider
public 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 boolean isCollectorHostExternal(String clusterName)
MetricHostProvider
isCollectorHostExternal
in interface MetricHostProvider
clusterName
- the cluster 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 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 getPublicHostName(String clusterName, String hostName)
getPublicHostName
in interface JMXHostProvider
public Set<String> getHostNames(String clusterName, String componentName)
JMXHostProvider
getHostNames
in interface JMXHostProvider
clusterName
- the cluster namecomponentName
- the component namepublic 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 componentpublic String getPort(String clusterName, String componentName, String hostName, boolean httpsEnabled)
JMXHostProvider
getPort
in interface JMXHostProvider
clusterName
- the cluster namecomponentName
- the component namehostName
- the component hostNamehttpsEnabled
- https enabledprotected abstract ResourceProvider createResourceProvider(Resource.Type type)
protected void registerResourceProvider(Resource.Type type)
protected void putResourceProvider(Resource.Type type, ResourceProvider resourceProvider)
protected void putPropertyProviders(Resource.Type type, List<PropertyProvider> providers)
protected void createPropertyProviders(Resource.Type type)
public String getJMXProtocol(String clusterName, String componentName)
JMXHostProvider
getJMXProtocol
in interface JMXHostProvider
clusterName
- the cluster namecomponentName
- the component namepublic String getJMXRpcMetricTag(String clusterName, String componentName, String port)
JMXHostProvider
getJMXRpcMetricTag
in interface JMXHostProvider
clusterName
- the cluster namecomponentName
- the componentName nameport
- the port numberpublic void onConfigurationChangedEvent(ClusterConfigChangedEvent event)
ClusterConfigChangedEvent
which means that some caches
should invalidate.event
- the change event.Copyright © 2022 Apache Software Foundation. All rights reserved.