Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Issue #73: replace occurrences of hard-coded port 8983 with the configure #124

Merged
merged 2 commits into from

2 participants

@cnauroth

I'd like to be able to start up Solandra on an alternative port. This is a patch that replaces a few occurrences of a hard-coded port 8983 with a lookup of the solandra.port system property. This addresses issue #73:

#73

Thanks,
--Chris

@tjake
Owner

Ah cool. Can you add this param to solandra.properties?

@cnauroth

No problem. The last commit moves the param into solandra.properties.

Thanks,
--Chris

@tjake tjake merged commit 04b2caf into tjake:solandra
@tjake
Owner

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 19, 2011
  1. @cnauroth

    Issue #73: replace occurrences of hard-coded port 8983 with the confi…

    cnauroth authored
    …gured value of the solandra.port system property.
Commits on Aug 20, 2011
  1. @cnauroth
This page is out of date. Refresh to see the latest.
View
4 resources/solandra.properties
@@ -37,6 +37,10 @@ solandra.write.buffer.queue.size = 16
#keyspace name for solandra
solandra.keyspace = L
+#The port number that the Solandra server uses to listen for client requests.
+#If unspecified, then the default is 8983.
+solandra.port = 8983
+
#The number of retries solandra will attempt before
#failing a write or read (TimeoutException)
cassandra.retries = 1024
View
3  src/lucandra/CassandraUtils.java
@@ -67,7 +67,7 @@
public static final ConsistencyLevel consistency;
public static boolean useCompression;
-
+ public static int port;
// Initialize logging in such a way that it checks for config changes every
// 10 seconds.
@@ -112,6 +112,7 @@
.name()));
useCompression = Boolean.valueOf(properties.getProperty("solandra.compression", "true"));
+ port = Integer.parseInt(properties.getProperty("solandra.port", "8983"));
try
{
View
2  src/solandra/SolandraComponent.java
@@ -165,7 +165,7 @@ public static boolean prepare(ResponseBuilder rb) throws IOException
throw new IOException("can't locate index");
InetAddress addr = endpoints.get(0);
- String shard = addr.getHostAddress() + ":8983/solandra/" + indexName + "~" + i;
+ String shard = addr.getHostAddress() + ":" + CassandraUtils.port + "/solandra/" + indexName + "~" + i;
if(logger.isDebugEnabled())
logger.debug("Adding shard(" + indexName + "): " + shard);
View
2  src/solandra/SolandraIndexWriter.java
@@ -460,7 +460,7 @@ public void deleteByQuery(DeleteUpdateCommand cmd) throws IOException
{
// delete from other shards via http
CommonsHttpSolrServer solrj = new CommonsHttpSolrServer("http://" + addr.getHostAddress()
- + ":8983/solandra/" + subIndex, new HttpClient(httpConnections));
+ + ":" + CassandraUtils.port + "/solandra/" + subIndex, new HttpClient(httpConnections));
try
{
View
4 src/solandra/SolandraServer.java
@@ -31,8 +31,6 @@ public static void main(String[] args) {
String context = System.getProperty("solandra.context", "/solandra");
- int port = Integer.parseInt(System.getProperty("solandra.port", "8983"));
-
try {
if(System.getProperty("solandra.clientmode", "false").equalsIgnoreCase("true"))
@@ -40,7 +38,7 @@ public static void main(String[] args) {
else
CassandraUtils.startupServer();
- JettySolandraRunner jetty = new JettySolandraRunner(context, port);
+ JettySolandraRunner jetty = new JettySolandraRunner(context, CassandraUtils.port);
jetty.start(false);
} catch (Exception ex) {
ex.printStackTrace();
Something went wrong with that request. Please try again.