This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

…gured value of the solandra.port system property.
  • Loading branch information...
1 parent fa8d5a4 commit 3a9f010cab9bb141e184892e656f190dd72ed658 @cnauroth cnauroth committed Aug 19, 2011
Showing with 5 additions and 2 deletions.
  1. +2 −1 src/solandra/SolandraComponent.java
  2. +3 −1 src/solandra/SolandraIndexWriter.java
@@ -50,6 +50,7 @@
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
{
@@ -165,7 +166,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() + ":" + port + "/solandra/" + indexName + "~" + i;
if(logger.isDebugEnabled())
logger.debug("Adding shard(" + indexName + "): " + shard);
@@ -109,6 +109,8 @@
"solandra.write.buffer.queue.size",
"16"));
+ private static final int port = Integer.parseInt(System.getProperty("solandra.port", "8983"));
+
public SolandraIndexWriter(SolrCore core)
{
super(core);
@@ -460,7 +462,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));
+ + ":" + port + "/solandra/" + subIndex, new HttpClient(httpConnections));
try
{

0 comments on commit 3a9f010

Please sign in to comment.