public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider
JMXPropertyProvider
is used to retrieve JMX metrics from a given
Request
. This class will delegate responsibility for actually
retrieving JMX data from a remote URL to the MetricsRetrievalService
.
It will also leverage the MetricsRetrievalService
to provide cached
JMXMetricHolder
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 JMX data is
retrieved.
In general, this type of federated data collection is a poor design. Even
with a large enough threadpool there are simple use cases where the model
breaks down:
JMXPropertyProvider
will use a completely
asynchronous model through the MetricsRetrievalService
. It should be
noted that this provider is still an instance of a
ThreadPoolEnabledPropertyProvider
due to the nature of how the cached
JMXMetricHolder
instances need to be looped over an parsed.ThreadPoolEnabledPropertyProvider.Ticket
healthyStates
Modifier and Type | Method and Description |
---|---|
protected Resource |
populateResource(Resource resource,
Request request,
Predicate predicate,
ThreadPoolEnabledPropertyProvider.Ticket ticket)
Populate a resource by obtaining the requested JMX properties.
|
Set<Resource> |
populateResources(Set<Resource> resources,
Request request,
Predicate predicate)
Populate the given set of resource with any properties that this property
provider can provide and return a populated set of resources.
|
getCacheKeyForException, getHost, getSpec, init, isRequestedPropertyId, logException, rethrowSystemException, setPopulateTimeout
checkAuthorizationForMetrics, checkPropertyCategory, getClustersNameFromResources, getClustersResourceId, getComponentMetrics, getPropertyInfoMap, getResourceTypeFromResources, getValue, isSupportedPropertyId, substituteArgument, updateComponentMetricMap, updatePropertyInfo, updatePropertyInfoMap
checkCategory, checkConfigPropertyIds, checkPropertyIds, containsArguments, getCategoryIds, getPropertyIds, getRegexEntry, getRegexGroups, getRequestPropertyIds, isPatternKey, isPropertyCategoryRequested, isPropertyEntryRequested, isPropertyRequested, setResourceProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPropertyIds
public Set<Resource> populateResources(Set<Resource> resources, Request request, Predicate predicate) throws SystemException
PropertyProvider
populateResources
in interface PropertyProvider
populateResources
in class ThreadPoolEnabledPropertyProvider
resources
- the resources to be populatedrequest
- the request object which defines the desired set of propertiespredicate
- the predicate object which filters which resources are returnedSystemException
- thrown if resources cannot be populatedprotected 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 predicateticket
- a valid ticketSystemException
Copyright © 2022 Apache Software Foundation. All rights reserved.