Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Commit

Permalink
Issue #73: move solandra.port configuration into solandra.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
cnauroth committed Aug 20, 2011
1 parent 3a9f010 commit 574f488
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions resources/solandra.properties
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/lucandra/CassandraUtils.java
Expand Up @@ -67,7 +67,7 @@ public class CassandraUtils
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.
Expand Down Expand Up @@ -112,6 +112,7 @@ public class CassandraUtils
.name()));

useCompression = Boolean.valueOf(properties.getProperty("solandra.compression", "true"));
port = Integer.parseInt(properties.getProperty("solandra.port", "8983"));

try
{
Expand Down
3 changes: 1 addition & 2 deletions src/solandra/SolandraComponent.java
Expand Up @@ -50,7 +50,6 @@ public final class SolandraComponent
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
{
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/solandra/SolandraIndexWriter.java
Expand Up @@ -109,8 +109,6 @@ public class SolandraIndexWriter extends UpdateHandler
"solandra.write.buffer.queue.size",
"16"));

private static final int port = Integer.parseInt(System.getProperty("solandra.port", "8983"));

public SolandraIndexWriter(SolrCore core)
{
super(core);
Expand Down Expand Up @@ -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
{
Expand Down
4 changes: 1 addition & 3 deletions src/solandra/SolandraServer.java
Expand Up @@ -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();
Expand Down

0 comments on commit 574f488

Please sign in to comment.