cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r759299 - in /incubator/cassandra/trunk: conf/storage-conf.xml src/org/apache/cassandra/config/DatabaseDescriptor.java src/org/apache/cassandra/service/CassandraServer.java
Date Fri, 27 Mar 2009 18:39:50 GMT
Author: jbellis
Date: Fri Mar 27 18:39:49 2009
New Revision: 759299

URL: http://svn.apache.org/viewvc?rev=759299&view=rev
Log:
patch from Jun Rao make Thrift port configureable.  Also add sample to config/.  fixes #10

Modified:
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java

Modified: incubator/cassandra/trunk/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=759299&r1=759298&r2=759299&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Fri Mar 27 18:39:49 2009
@@ -16,6 +16,7 @@
    <JobJarFileLocation>C:\Engagements\Cassandra-Nexus</JobJarFileLocation>
    <StoragePort>7000</StoragePort>
    <ControlPort>7001</ControlPort>
+   <ThriftPort>7001</ThriftPort>
    <ColumnIndexSizeInKB>256</ColumnIndexSizeInKB>
    <HttpPort>7002</HttpPort>
    <MetadataDirectory>/var/cassandra/system</MetadataDirectory>

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java?rev=759299&r1=759298&r2=759299&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/config/DatabaseDescriptor.java Fri
Mar 27 18:39:49 2009
@@ -46,6 +46,7 @@
     private static int storagePort_ = 7000;
     private static int controlPort_ = 7001;
     private static int httpPort_ = 7002;
+    private static int thriftPort_ = 9160;
     private static String clusterName_ = "Test";
     private static int replicationFactor_ = 3;
     private static long rpcTimeoutInMillis_ = 2000;
@@ -180,6 +181,12 @@
             if ( port != null )
                 httpPort_ = Integer.parseInt(port);
 
+            /* get the thrift port from conf file */
+            port = xmlUtils.getNodeValue("/Storage/ThriftPort");
+            if (port != null)
+                thriftPort_ = Integer.parseInt(port);
+
+
             /* Touch Key Cache Size */
             String touchKeyCacheSize = xmlUtils.getNodeValue("/Storage/TouchKeyCacheSize");
             if ( touchKeyCacheSize != null )
@@ -621,6 +628,11 @@
         return httpPort_;
     }
 
+    public static int getThriftPort()
+    {
+        return thriftPort_;
+    }
+
     public static int getReplicationFactor()
     {
         return replicationFactor_;

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java?rev=759299&r1=759298&r2=759299&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java Fri Mar
27 18:39:49 2009
@@ -997,7 +997,7 @@
 
 	public static void main(String[] args) throws Throwable
 	{
-		int port = 9160;		
+		int port = DatabaseDescriptor.getThriftPort();		
 		try
 		{
 			CassandraServer peerStorageServer = new CassandraServer();



Mime
View raw message