Apache Lucene open-source search software
SOLR-4622: Hardcoded SolrCloud defaults for hostContext and hostPort that were deprecated in 4.3 have been removed completely.
Chris M. Hostettera039f476c85d
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex baff5e25325..e32cb246126 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -38,6 +38,12 @@ TBD...Detailed Change List----------------------+Other Changes+----------------------++* SOLR-4622: Hardcoded SolrCloud defaults for hostContext and hostPort that+ were deprecated in 4.3 have been removed completely. (hossman)+================== 4.4.0 ==================Versions of Major Componentsdiff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.javaindex 8733e42a9df..22c93504c1a 100644--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java@@ -1113,12 +1113,12 @@ public class CoreContainercoresAttribs.put("defaultCoreName", defaultCoreName);}- addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_HOSTPORT, "hostPort",zkSys.getHostPort(), ZkContainer.DEFAULT_HOST_PORT);+ addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_HOSTPORT, "hostPort",zkSys.getHostPort(), null);addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_ZKCLIENTTIMEOUT, "zkClientTimeout",intToString(this.zkClientTimeout),Integer.toString(DEFAULT_ZK_CLIENT_TIMEOUT));addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_HOSTCONTEXT, "hostContext",- zkSys.getHostContext(), ZkContainer.DEFAULT_HOST_CONTEXT);+ zkSys.getHostContext(), null);addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_LEADERVOTEWAIT, "leaderVoteWait",zkSys.getLeaderVoteWait(), LEADER_VOTE_WAIT);addCoresAttrib(coresAttribs, ConfigSolr.CfgProp.SOLR_CORELOADTHREADS, "coreLoadThreads",diff --git a/solr/core/src/java/org/apache/solr/core/ZkContainer.java b/solr/core/src/java/org/apache/solr/core/ZkContainer.javaindex 57580c72f8c..c9ed9b3eb59 100644--- a/solr/core/src/java/org/apache/solr/core/ZkContainer.java+++ b/solr/core/src/java/org/apache/solr/core/ZkContainer.java@@ -43,11 +43,6 @@ import org.xml.sax.InputSource;public class ZkContainer {protected static Logger log = LoggerFactory.getLogger(ZkContainer.class);- /** @deprecated will be remove in Solr 5.0 (SOLR-4622) */- public static final String DEFAULT_HOST_CONTEXT = "solr";- /** @deprecated will be remove in Solr 5.0 (SOLR-4622) */- public static final String DEFAULT_HOST_PORT = "8983";-protected ZkController zkController;private SolrZkServer zkServer;private int zkClientTimeout;@@ -119,21 +114,14 @@ public class ZkContainer {if (zkRun == null && zookeeperHost == null)return; // not in zk mode-- // BEGIN: SOLR-4622: deprecated hardcoded defaults for hostPort & hostContextif (null == hostPort) {- // throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR,- // "'hostPort' must be configured to run SolrCloud");- log.warn("Solr 'hostPort' has not be explicitly configured, using hardcoded default of " + DEFAULT_HOST_PORT + ". This default has been deprecated and will be removed in future versions of Solr, please configure this value explicitly");- hostPort = DEFAULT_HOST_PORT;+ throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR,+ "'hostPort' must be configured to run SolrCloud");}if (null == hostContext) {- // throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR,- // "'hostContext' must be configured to run SolrCloud");- log.warn("Solr 'hostContext' has not be explicitly configured, using hardcoded default of " + DEFAULT_HOST_CONTEXT + ". This default has been deprecated and will be removed in future versions of Solr, please configure this value explicitly");- hostContext = DEFAULT_HOST_CONTEXT;+ throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR,+ "'hostContext' must be configured to run SolrCloud");}- // END: SOLR-4622// zookeeper in quorum mode currently causes a failure when trying to// register log4j mbeans. See SOLR-2369diff --git a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.javaindex a5968201ed7..2df2f10b559 100644--- a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java+++ b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java@@ -183,8 +183,8 @@ public class TestHarness extends BaseTestHarness {String solrHome = SolrResourceLoader.locateSolrHome();container = new CoreContainer(new SolrResourceLoader(solrHome)) {{- String hostPort = System.getProperty("hostPort");- String hostContext = "solr";+ String hostPort = System.getProperty("hostPort", "8983");+ String hostContext = System.getProperty("hostContext", "solr");defaultCoreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;initShardHandler();zkSys.initZooKeeper(this, solrHome, System.getProperty("zkHost"), 30000, hostPort, hostContext, null, "30000", 30000, 30000);