Package org.apache.solr.handler.admin
Class MetricsHistoryHandler
- java.lang.Object
-
- org.apache.solr.handler.RequestHandlerBase
-
- org.apache.solr.handler.admin.MetricsHistoryHandler
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ApiSupport
,SolrInfoBean
,NestedRequestHandler
,SolrMetricProducer
,SolrRequestHandler
,PermissionNameProvider
public class MetricsHistoryHandler extends RequestHandlerBase implements PermissionNameProvider, Closeable
Collects metrics from all nodes in the system on a regular basis in a background thread.- Since:
- 7.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetricsHistoryHandler.Cmd
static class
MetricsHistoryHandler.Format
-
Nested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProvider
PermissionNameProvider.Name
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static String
COLLECT_PERIOD_PROP
static int
DEFAULT_COLLECT_PERIOD
static List<String>
DEFAULT_COLLECTION_GAUGES
static List<String>
DEFAULT_CORE_COUNTERS
static List<String>
DEFAULT_CORE_GAUGES
static List<String>
DEFAULT_JVM_GAUGES
static List<String>
DEFAULT_NODE_GAUGES
static String
ENABLE_NODES_PROP
static String
ENABLE_PROP
static String
ENABLE_REPLICAS_PROP
static String
NUM_NODES_KEY
static String
NUM_REPLICAS_KEY
static String
NUM_SHARDS_KEY
static String
SYNC_PERIOD_PROP
static String
URI_PREFIX
-
Fields inherited from class org.apache.solr.handler.RequestHandlerBase
appends, defaults, httpCaching, initArgs, invariants, solrMetricsContext
-
Fields inherited from interface org.apache.solr.security.PermissionNameProvider
ANY, NULL, values
-
Fields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE
-
-
Constructor Summary
Constructors Constructor Description MetricsHistoryHandler(String nodeName, MetricsHandler metricsHandler, SolrClient solrClient, SolrCloudManager cloudManager, Map<String,Object> pluginArgs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkSystemCollection()
void
close()
Implementations should always callSolrMetricProducer.super.close()
to ensure that metrics with the same life-cycle as this component are properly unregistered.Collection<Api>
getApis()
It is possible to support multiple v2 apis by a single requesthandlerString
getDescription()
Simple one or two line descriptionSolrRrdBackendFactory
getFactory()
PermissionNameProvider.Name
getPermissionName(AuthorizationContext request)
SolrClient
getSolrClient()
void
handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
Boolean
registerV2()
Whether this request handler must be made available at the /v2/ pathvoid
removeHistory(String registry)
-
Methods inherited from class org.apache.solr.handler.RequestHandlerBase
getCategory, getInitArgs, getMetricNames, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, initializeMetrics, setPluginInfo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.api.ApiSupport
registerV1
-
Methods inherited from interface org.apache.solr.core.SolrInfoBean
getMetricRegistry, getMetricsSnapshot, registerMetricName
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
initializeMetrics
-
-
-
-
Field Detail
-
NUM_SHARDS_KEY
public static final String NUM_SHARDS_KEY
- See Also:
- Constant Field Values
-
NUM_REPLICAS_KEY
public static final String NUM_REPLICAS_KEY
- See Also:
- Constant Field Values
-
NUM_NODES_KEY
public static final String NUM_NODES_KEY
- See Also:
- Constant Field Values
-
COLLECT_PERIOD_PROP
public static final String COLLECT_PERIOD_PROP
- See Also:
- Constant Field Values
-
SYNC_PERIOD_PROP
public static final String SYNC_PERIOD_PROP
- See Also:
- Constant Field Values
-
ENABLE_PROP
public static final String ENABLE_PROP
- See Also:
- Constant Field Values
-
ENABLE_REPLICAS_PROP
public static final String ENABLE_REPLICAS_PROP
- See Also:
- Constant Field Values
-
ENABLE_NODES_PROP
public static final String ENABLE_NODES_PROP
- See Also:
- Constant Field Values
-
DEFAULT_COLLECT_PERIOD
public static final int DEFAULT_COLLECT_PERIOD
- See Also:
- Constant Field Values
-
URI_PREFIX
public static final String URI_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetricsHistoryHandler
public MetricsHistoryHandler(String nodeName, MetricsHandler metricsHandler, SolrClient solrClient, SolrCloudManager cloudManager, Map<String,Object> pluginArgs)
-
-
Method Detail
-
checkSystemCollection
public void checkSystemCollection()
-
getSolrClient
public SolrClient getSolrClient()
-
removeHistory
public void removeHistory(String registry) throws IOException
- Throws:
IOException
-
getFactory
public SolrRrdBackendFactory getFactory()
-
close
public void close()
Description copied from interface:SolrMetricProducer
Implementations should always callSolrMetricProducer.super.close()
to ensure that metrics with the same life-cycle as this component are properly unregistered. This prevents obscure memory leaks. from: https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSolrMetricProducer
-
handleRequestBody
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
- Specified by:
handleRequestBody
in classRequestHandlerBase
- Throws:
Exception
-
getDescription
public String getDescription()
Description copied from interface:SolrInfoBean
Simple one or two line description- Specified by:
getDescription
in interfaceSolrInfoBean
- Specified by:
getDescription
in classRequestHandlerBase
-
getPermissionName
public PermissionNameProvider.Name getPermissionName(AuthorizationContext request)
- Specified by:
getPermissionName
in interfacePermissionNameProvider
-
registerV2
public Boolean registerV2()
Description copied from interface:ApiSupport
Whether this request handler must be made available at the /v2/ path- Specified by:
registerV2
in interfaceApiSupport
-
getApis
public Collection<Api> getApis()
Description copied from interface:ApiSupport
It is possible to support multiple v2 apis by a single requesthandler- Specified by:
getApis
in interfaceApiSupport
- Overrides:
getApis
in classRequestHandlerBase
- Returns:
- the list of v2 api implementations
-
-