Permalink
Browse files

Issue #73: move solandra.port configuration into solandra.properties

  • Loading branch information...
1 parent 3a9f010 commit 574f488b8d139111b43a7c297f8772a3ade30376 @cnauroth cnauroth committed Aug 20, 2011
@@ -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
@@ -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
{
@@ -50,7 +50,6 @@
private static AtomicBoolean hasSolandraSchema = new AtomicBoolean(false);
private static final Logger logger = Logger.getLogger(SolandraComponent.class);
public final static Map<String,Long> cacheCheck = new MapMaker().makeMap();
- private static final int port = Integer.parseInt(System.getProperty("solandra.port", "8983"));
public static boolean flushCache(String indexName) throws IOException
{
@@ -166,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() + ":" + port + "/solandra/" + indexName + "~" + i;
+ String shard = addr.getHostAddress() + ":" + CassandraUtils.port + "/solandra/" + indexName + "~" + i;
if(logger.isDebugEnabled())
logger.debug("Adding shard(" + indexName + "): " + shard);
@@ -109,8 +109,6 @@
"solandra.write.buffer.queue.size",
"16"));
- private static final int port = Integer.parseInt(System.getProperty("solandra.port", "8983"));
-
public SolandraIndexWriter(SolrCore core)
{
super(core);
@@ -462,7 +460,7 @@ public void deleteByQuery(DeleteUpdateCommand cmd) throws IOException
{
// delete from other shards via http
CommonsHttpSolrServer solrj = new CommonsHttpSolrServer("http://" + addr.getHostAddress()
- + ":" + port + "/solandra/" + subIndex, new HttpClient(httpConnections));
+ + ":" + CassandraUtils.port + "/solandra/" + subIndex, new HttpClient(httpConnections));
try
{
@@ -31,16 +31,14 @@ 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"))
CassandraUtils.startupClient();
else
CassandraUtils.startupServer();
- JettySolandraRunner jetty = new JettySolandraRunner(context, port);
+ JettySolandraRunner jetty = new JettySolandraRunner(context, CassandraUtils.port);
jetty.start(false);
} catch (Exception ex) {
ex.printStackTrace();

0 comments on commit 574f488

Please sign in to comment.