Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshk25 committed Dec 8, 2023
1 parent 9d411d9 commit 0f49f18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 1 addition & 6 deletions solr/core/src/java/org/apache/solr/cloud/ZkController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.apache.solr.common.cloud.ZkStateReader.CORE_NAME_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.CORE_NODE_NAME_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.ELECTION_NODE_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.HTTPS_PORT_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.NODE_NAME_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.REJOIN_AT_HEAD_PROP;
import static org.apache.solr.common.cloud.ZkStateReader.SHARD_ID_PROP;
Expand Down Expand Up @@ -408,11 +407,7 @@ public ZkController(

// note: Can't read cluster properties until createClusterState ^ is called
final String urlSchemeFromClusterProp =
zkStateReader.getClusterProperty(
ZkStateReader.URL_SCHEME,
StrUtils.isNotNullOrEmpty(System.getProperty(HTTPS_PORT_PROP))
? ZkStateReader.HTTPS
: ZkStateReader.HTTP);
zkStateReader.getClusterProperty(ZkStateReader.URL_SCHEME, ZkStateReader.HTTP);

this.nodeName =
generateNodeName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.apache.solr.common.util.ExecutorUtil;
import org.apache.solr.common.util.ObjectReleaseTracker;
import org.apache.solr.common.util.SolrNamedThreadFactory;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.common.util.Utils;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NoNodeException;
Expand Down Expand Up @@ -1149,6 +1150,12 @@ private void loadClusterProperties() {
ClusterProperties.convertCollectionDefaultsToNestedFormat(properties);
log.debug("Loaded cluster properties: {}", this.clusterProperties);

if (!this.clusterProperties.containsKey(URL_SCHEME)) {
if (StrUtils.isNotNullOrEmpty(System.getProperty(HTTPS_PORT_PROP))) {
this.clusterProperties.put(URL_SCHEME, "https");
}
}

for (ClusterPropertiesListener listener : clusterPropertiesListeners) {
listener.onChange(getClusterProperties());
}
Expand Down

0 comments on commit 0f49f18

Please sign in to comment.