You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steve Rowe (JIRA)" <ji...@apache.org> on 2014/12/12 19:55:13 UTC

[jira] [Created] (SOLR-6844) Rename ConfigSolr.getZkHostPort(), which actually returns the Solr port, to .getSolrHostPort()

Steve Rowe created SOLR-6844:
--------------------------------

             Summary: Rename ConfigSolr.getZkHostPort(), which actually returns the Solr port, to .getSolrHostPort()
                 Key: SOLR-6844
                 URL: https://issues.apache.org/jira/browse/SOLR-6844
             Project: Solr
          Issue Type: Bug
            Reporter: Steve Rowe
            Assignee: Steve Rowe
            Priority: Minor


[~makuk66] pointed out to me that it was suspicious that {{ConfigSolr.getZkHostPort()}} returns {{CfgProp.SOLR_HOSTPORT}}: the method claims to report the configured Zookeeper port, while it in fact returns the configured Solr port.

The only place this method is called (outside of tests) is in {{ZkContainer.initZookeeper()}} when constructing a {{SolrZkServer}} instance: the value of {{ConfigSolr.getZkHostPort()}} is passed in for the {{solrPort}} param, which is stored by the ctor as the same-named instance variable, which is used in only one place: {{SolrZkServer.parseConfig()}}, where the default value of the ZK port is set as the Solr port + 1000: 

{code:java}
props = SolrZkServerProps.getProperties(confHome + '/' + "zoo.cfg");
SolrZkServerProps.injectServers(props, zkRun, zkHost);
zkProps.parseProperties(props);
if (zkProps.getClientPortAddress() == null) {
  zkProps.setClientPort(Integer.parseInt(solrPort)+1000);
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org