public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvider
MetricsRetrievalService
. It will also
leverage the MetricsRetrievalService
to provide cached Map
instances for given URLs.
This is because the REST API workflow will attempt to read data from this
provider during the context of a live Jetty thread. As a result, any attempt
to read remote resources will cause a delay in returning a response code. On
small clusters this mormally isn't a problem. However, as the cluster
increases in size, the thread pool would not be able to keep pace and would
eventually cause REST API request threads to wait while remote JSON data is
retrieved.ThreadPoolEnabledPropertyProvider.Ticket
Modifier and Type | Field and Description |
---|---|
static String |
DOCUMENT_PATH_SEPARATOR
Symbol that separates names of nested JSON sections in metrics path
|
static String |
URL_PATH_SEPARATOR
String that separates JSON URL from path inside JSON in metrics path
|
healthyStates, hostNamePropertyId
Modifier and Type | Method and Description |
---|---|
Set<String> |
checkPropertyIds(Set<String> propertyIds)
Check whether the set of given property ids is supported by this resource
provider.
|
protected Resource |
populateResource(Resource resource,
Request request,
Predicate predicate,
ThreadPoolEnabledPropertyProvider.Ticket ticket)
Populate a resource by obtaining the requested REST properties.
|
protected String |
resolvePort(Cluster cluster,
String hostname,
String componentName,
Map<String,String> metricsProperties,
String protocol)
If protocol is equal to HTTPS_PROTOCOL than returns HTTPS_PORT_PROPERTY_NAME_PROPERTY value from PORT_CONFIG_TYPE_PROPERTY
else uses port_config_type, port_property_name, default_port parameters from
metricsProperties to find out right port value for service
|
getCacheKeyForException, getHost, getSpec, init, isRequestedPropertyId, logException, populateResources, rethrowSystemException, setPopulateTimeout
checkAuthorizationForMetrics, checkPropertyCategory, getClustersNameFromResources, getClustersResourceId, getComponentMetrics, getPropertyInfoMap, getResourceTypeFromResources, getValue, isSupportedPropertyId, substituteArgument, updateComponentMetricMap, updatePropertyInfo, updatePropertyInfoMap
checkCategory, checkConfigPropertyIds, containsArguments, getCategoryIds, getPropertyIds, getRegexEntry, getRegexGroups, getRequestPropertyIds, isPatternKey, isPropertyCategoryRequested, isPropertyEntryRequested, isPropertyRequested, setResourceProperty
public static final String URL_PATH_SEPARATOR
public static final String DOCUMENT_PATH_SEPARATOR
protected Resource populateResource(Resource resource, Request request, Predicate predicate, ThreadPoolEnabledPropertyProvider.Ticket ticket) throws SystemException
populateResource
in class ThreadPoolEnabledPropertyProvider
resource
- the resource to be populatedrequest
- the requestpredicate
- the predicateSystemException
public Set<String> checkPropertyIds(Set<String> propertyIds)
PropertyProvider
checkPropertyIds
in interface PropertyProvider
checkPropertyIds
in class BaseProvider
protected String resolvePort(Cluster cluster, String hostname, String componentName, Map<String,String> metricsProperties, String protocol) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
Copyright © 2022 Apache Software Foundation. All rights reserved.