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
public class ZookeeperStatusHandler extends RequestHandlerBase
Zookeeper Status handler, talks to ZK using sockets and four-letter words- Since:
- solr 7.5
-
-
Nested Class Summary
-
Nested 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
appends, defaults, httpCaching, initArgs, invariants, solrMetricsContext
-
Fields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE
-
-
Constructor Summary
Constructors Constructor Description ZookeeperStatusHandler(CoreContainer cc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrInfoBean.Category
getCategory()
Category of this componentString
getDescription()
Simple one or two line descriptionprotected List<String>
getZkRawResponse(String zkHostPort, String fourLetterWordCommand)
Sends a four-letter-word command to one particular Zookeeper server and returns the response as list of stringsprotected Map<String,Object>
getZkStatus(String zkHost)
void
handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
protected Map<String,Object>
monitorZookeeper(String zkHostPort)
protected boolean
validateZkRawResponse(List<String> response, String zkHostPort, String fourLetterWordCommand)
Takes the raw response lines returned bygetZkRawResponse(String, String)
and runs some validations-
Methods inherited from class org.apache.solr.handler.RequestHandlerBase
getApis, 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, registerV2
-
Methods inherited from interface org.apache.solr.core.SolrInfoBean
getMetricRegistry, getMetricsSnapshot, registerMetricName
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close, initializeMetrics
-
-
-
-
Constructor Detail
-
ZookeeperStatusHandler
public ZookeeperStatusHandler(CoreContainer cc)
-
-
Method Detail
-
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
-
getCategory
public SolrInfoBean.Category getCategory()
Description copied from interface:SolrInfoBean
Category of this component- Specified by:
getCategory
in interfaceSolrInfoBean
- Overrides:
getCategory
in classRequestHandlerBase
-
handleRequestBody
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
- Specified by:
handleRequestBody
in classRequestHandlerBase
- Throws:
Exception
-
monitorZookeeper
protected Map<String,Object> monitorZookeeper(String zkHostPort) throws SolrException
- Throws:
SolrException
-
getZkRawResponse
protected List<String> getZkRawResponse(String zkHostPort, String fourLetterWordCommand)
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:
SolrException
- if validation fails
-
-