Package org.apache.solr.handler.admin
Class ZookeeperStatusHandler
java.lang.Object
org.apache.solr.handler.RequestHandlerBase
org.apache.solr.handler.admin.ZookeeperStatusHandler
- All Implemented Interfaces:
AutoCloseable,ApiSupport,SolrInfoBean,NestedRequestHandler,SolrMetricProducer,SolrRequestHandler,PermissionNameProvider
Zookeeper Status handler, talks to ZK using sockets and four-letter words
- Since:
- solr 7.5
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.handler.RequestHandlerBase
RequestHandlerBase.HandlerMetricsNested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProvider
PermissionNameProvider.NameNested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group -
Field Summary
Fields inherited from class org.apache.solr.handler.RequestHandlerBase
aggregateNodeLevelMetricsEnabled, appends, defaults, httpCaching, initArgs, invariants, metrics, publishCpuTime, REQUEST_CPU_TIMER_CONTEXT, solrMetricsContext, SOURCE_ATTRFields inherited from interface org.apache.solr.security.PermissionNameProvider
ANY, NULL, valuesFields inherited from interface org.apache.solr.metrics.SolrMetricProducer
CATEGORY_ATTR, HANDLER_ATTR, NAME_ATTR, OPERATION_ATTR, PLUGIN_NAME_ATTR, RESULT_ATTR, TYPE_ATTRFields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCategory of this componentSimple one or two line descriptiongetPermissionName(AuthorizationContext request) getZkRawResponse(String zkHostPort, String fourLetterWordCommand) Sends a four-letter-word command to one particular Zookeeper server and returns the response as list of stringsgetZkStatus(String zkHost, org.apache.solr.common.cloud.ZkDynamicConfig zkDynamicConfig) For each zk host, resolved either from zk connection string or from zk dynamic reconfiguration config, fetch all config and status info from ZK API and returns as a map, where key is hostnamevoidmonitorZookeeper(String zkHostPort) protected booleanvalidateZkRawResponse(List<String> response, String zkHostPort, String fourLetterWordCommand) Takes the raw response lines returned bygetZkRawResponse(String, String)and runs some validationsMethods inherited from class org.apache.solr.handler.RequestHandlerBase
getApis, getInitArgs, getMetricsForThisRequest, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, initializeMetrics, isInternalShardRequest, processErrorMetricsOnException, processReceivedException, setPluginInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.api.ApiSupport
getJerseyResources, registerV1, registerV2Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
Constructor Details
-
ZookeeperStatusHandler
-
-
Method Details
-
getDescription
Description copied from interface:SolrInfoBeanSimple one or two line description- Specified by:
getDescriptionin interfaceSolrInfoBean- Specified by:
getDescriptionin classRequestHandlerBase
-
getCategory
Description copied from interface:SolrInfoBeanCategory of this component- Specified by:
getCategoryin interfaceSolrInfoBean- Overrides:
getCategoryin classRequestHandlerBase
-
handleRequestBody
- Specified by:
handleRequestBodyin classRequestHandlerBase- Throws:
Exception
-
getZkStatus
protected Map<String,Object> getZkStatus(String zkHost, org.apache.solr.common.cloud.ZkDynamicConfig zkDynamicConfig) For each zk host, resolved either from zk connection string or from zk dynamic reconfiguration config, fetch all config and status info from ZK API and returns as a map, where key is hostname- Parameters:
zkHost- zookeeper connection stringzkDynamicConfig- list of zk dynamic config objects- Returns:
- map of zookeeper config and status per zk host
-
monitorZookeeper
protected Map<String,Object> monitorZookeeper(String zkHostPort) throws org.apache.solr.common.SolrException - Throws:
org.apache.solr.common.SolrException
-
getZkRawResponse
Sends a four-letter-word command to one particular Zookeeper server and returns the response as list of strings- Parameters:
zkHostPort- the host:port for one zookeeper server to accessfourLetterWordCommand- the custom 4-letter command to send to Zookeeper- Returns:
- a list of lines returned from Zookeeper
-
validateZkRawResponse
protected boolean validateZkRawResponse(List<String> response, String zkHostPort, String fourLetterWordCommand) Takes the raw response lines returned bygetZkRawResponse(String, String)and runs some validations- Parameters:
response- the lineszkHostPort- the hostfourLetterWordCommand- the 4lw command- Returns:
- true if validation succeeds
- Throws:
org.apache.solr.common.SolrException- if validation fails
-
getPermissionName
-