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

public class ZookeeperStatusHandler extends RequestHandlerBase
Zookeeper Status handler, talks to ZK using sockets and four-letter words
Since:
solr 7.5
  • Constructor Details

    • ZookeeperStatusHandler

      public ZookeeperStatusHandler(CoreContainer cc)
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: SolrInfoBean
      Simple one or two line description
      Specified by:
      getDescription in interface SolrInfoBean
      Specified by:
      getDescription in class RequestHandlerBase
    • getCategory

      public SolrInfoBean.Category getCategory()
      Description copied from interface: SolrInfoBean
      Category of this component
      Specified by:
      getCategory in interface SolrInfoBean
      Overrides:
      getCategory in class RequestHandlerBase
    • handleRequestBody

      public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
      Specified by:
      handleRequestBody in class RequestHandlerBase
      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 string
      zkDynamicConfig - 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

      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 access
      fourLetterWordCommand - 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 by getZkRawResponse(String, String) and runs some validations
      Parameters:
      response - the lines
      zkHostPort - the host
      fourLetterWordCommand - the 4lw command
      Returns:
      true if validation succeeds
      Throws:
      org.apache.solr.common.SolrException - if validation fails
    • getPermissionName

      public PermissionNameProvider.Name getPermissionName(AuthorizationContext request)