Class ZookeeperStatusHandler

    • Constructor Detail

      • ZookeeperStatusHandler

        public ZookeeperStatusHandler​(CoreContainer cc)
    • Method Detail

      • 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