You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2010/02/19 22:30:33 UTC

svn commit: r911989 - in /incubator/cassandra/trunk: conf/ src/java/org/apache/cassandra/avro/ src/java/org/apache/cassandra/client/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/hadoop/ src/java/org/apache/cassandra/thrift/ test/...

Author: eevans
Date: Fri Feb 19 21:30:32 2010
New Revision: 911989

URL: http://svn.apache.org/viewvc?rev=911989&view=rev
Log:
use less specific descriptors for Thrift{Address,Port}

Patch by eevans; reviewed by gdusbabek for CASSANDRA-811

Modified:
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraDaemon.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
    incubator/cassandra/trunk/test/conf/storage-conf.xml
    incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java

Modified: incubator/cassandra/trunk/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Fri Feb 19 21:30:32 2010
@@ -227,16 +227,16 @@
   <StoragePort>7000</StoragePort>
 
   <!--
-   ~ The address to bind the Thrift RPC service to. Unlike ListenAddress
-   ~ above, you *can* specify 0.0.0.0 here if you want Thrift to listen on
-   ~ all interfaces.
+   ~ The address to bind the RPC service to. Unlike ListenAddress above, you
+   ~ *can* specify 0.0.0.0 here if you want to bind the RPC service to all
+   ~ interfaces.
    ~
    ~ Leaving this blank has the same effect it does for ListenAddress,
    ~ (i.e. it will be based on the configured hostname of the node).
   -->
-  <ThriftAddress>localhost</ThriftAddress>
-  <!-- Thrift RPC port (the port clients connect to). -->
-  <ThriftPort>9160</ThriftPort>
+  <RPCAddress>localhost</RPCAddress>
+  <!-- RPC port (the port clients connect to). -->
+  <RPCPort>9160</RPCPort>
   <!-- 
    ~ Whether or not to use a framed transport for Thrift. If this option
    ~ is set to true then you must also use a framed transport on the 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraDaemon.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraDaemon.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraDaemon.java Fri Feb 19 21:30:32 2010
@@ -50,8 +50,8 @@
         String file = System.getProperty("storage-config") + File.separator + "log4j.properties";
         PropertyConfigurator.configure(file);
 
-        listenPort = DatabaseDescriptor.getThriftPort();
-        listenAddr = DatabaseDescriptor.getThriftAddress();
+        listenPort = DatabaseDescriptor.getRpcPort();
+        listenAddr = DatabaseDescriptor.getRpcAddress();
         
         /* 
          * If ThriftAddress was left completely unconfigured, then assume

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java Fri Feb 19 21:30:32 2010
@@ -48,7 +48,7 @@
     final private static Logger logger_ = Logger.getLogger(RingCache.class);
 
     private Set<String> seeds_ = new HashSet<String>();
-    final private int port_= DatabaseDescriptor.getThriftPort();
+    final private int port_= DatabaseDescriptor.getRpcPort();
     final private static IPartitioner partitioner_ = DatabaseDescriptor.getPartitioner();
     private TokenMetadata tokenMetadata;
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Fri Feb 19 21:30:32 2010
@@ -66,10 +66,10 @@
     public static final String ophf_ = "OPHF";
     private static int storagePort_ = 7000;
     private static int controlPort_ = 7001;
-    private static int thriftPort_ = 9160;
+    private static int rpcPort_ = 9160;
     private static boolean thriftFramed_ = false;
     private static InetAddress listenAddress_; // leave null so we can fall through to getLocalHost
-    private static InetAddress thriftAddress_;
+    private static InetAddress rpcAddress_;
     private static String clusterName_ = "Test";
     private static long rpcTimeoutInMillis_ = 2000;
     private static Set<InetAddress> seeds_ = new HashSet<InetAddress>();
@@ -352,20 +352,20 @@
                 }
             }
 
-            /* Local IP or hostname to bind thrift server to */
-            String thriftAddress = xmlUtils.getNodeValue("/Storage/ThriftAddress");
-            if ( thriftAddress != null )
-                thriftAddress_ = InetAddress.getByName(thriftAddress);
+            /* Local IP or hostname to bind RPC server to */
+            String rpcAddress = xmlUtils.getNodeValue("/Storage/RPCAddress");
+            if ( rpcAddress != null )
+                rpcAddress_ = InetAddress.getByName(rpcAddress);
             
             /* UDP port for control messages */
             port = xmlUtils.getNodeValue("/Storage/ControlPort");
             if ( port != null )
                 controlPort_ = Integer.parseInt(port);
 
-            /* get the thrift port from conf file */
-            port = xmlUtils.getNodeValue("/Storage/ThriftPort");
+            /* get the RPC port from conf file */
+            port = xmlUtils.getNodeValue("/Storage/RPCPort");
             if (port != null)
-                thriftPort_ = Integer.parseInt(port);
+                rpcPort_ = Integer.parseInt(port);
 
             /* Framed (Thrift) transport (default to "no") */
             String framedRaw = xmlUtils.getNodeValue("/Storage/ThriftFramedTransport");
@@ -869,9 +869,9 @@
         return controlPort_;
     }
 
-    public static int getThriftPort()
+    public static int getRpcPort()
     {
-        return thriftPort_;
+        return rpcPort_;
     }
 
     public static int getReplicationFactor(String table)
@@ -1035,9 +1035,9 @@
         return listenAddress_;
     }
     
-    public static InetAddress getThriftAddress()
+    public static InetAddress getRpcAddress()
     {
-        return thriftAddress_;
+        return rpcAddress_;
     }
 
     public static double getCommitLogSyncBatchWindow()

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java Fri Feb 19 21:30:32 2010
@@ -156,7 +156,7 @@
     {
         // TODO handle failure of range replicas & retry
         TSocket socket = new TSocket(range.endpoints.get(0),
-                                     DatabaseDescriptor.getThriftPort());
+                                     DatabaseDescriptor.getRpcPort());
         TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
         Cassandra.Client client = new Cassandra.Client(binaryProtocol);
         try
@@ -182,7 +182,7 @@
     private List<TokenRange> getRangeMap() throws IOException
     {
         TSocket socket = new TSocket(DatabaseDescriptor.getSeeds().iterator().next().getHostAddress(),
-                                     DatabaseDescriptor.getThriftPort());
+                                     DatabaseDescriptor.getRpcPort());
         TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
         Cassandra.Client client = new Cassandra.Client(binaryProtocol);
         try

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java Fri Feb 19 21:30:32 2010
@@ -75,7 +75,7 @@
             if (rows != null)
                 return;
             TSocket socket = new TSocket(getLocation(),
-                                         DatabaseDescriptor.getThriftPort());
+                                         DatabaseDescriptor.getRpcPort());
             TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
             Cassandra.Client client = new Cassandra.Client(binaryProtocol);
             try

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java Fri Feb 19 21:30:32 2010
@@ -61,8 +61,8 @@
         String file = System.getProperty("storage-config") + File.separator + "log4j.properties";
         PropertyConfigurator.configure(file);
 
-        int listenPort = DatabaseDescriptor.getThriftPort();
-        InetAddress listenAddr = DatabaseDescriptor.getThriftAddress();
+        int listenPort = DatabaseDescriptor.getRpcPort();
+        InetAddress listenAddr = DatabaseDescriptor.getRpcAddress();
         
         /* 
          * If ThriftAddress was left completely unconfigured, then assume

Modified: incubator/cassandra/trunk/test/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/conf/storage-conf.xml?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/test/conf/storage-conf.xml Fri Feb 19 21:30:32 2010
@@ -26,7 +26,7 @@
    <RpcTimeoutInMillis>5000</RpcTimeoutInMillis>
    <ListenAddress>127.0.0.1</ListenAddress>
    <StoragePort>7010</StoragePort>
-   <ThriftPort>9170</ThriftPort>
+   <RPCPort>9170</RPCPort>
    <ColumnIndexSizeInKB>4</ColumnIndexSizeInKB>
    <CommitLogDirectory>build/test/cassandra/commitlog</CommitLogDirectory>
    <CommitLogRotationThresholdInMB>128</CommitLogRotationThresholdInMB>

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java?rev=911989&r1=911988&r2=911989&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java Fri Feb 19 21:30:32 2010
@@ -98,7 +98,7 @@
             System.out.println("hosts with key " + row + " : " + hosts + "; choose " + endPoints.get(0));
 
             // now, read the row back directly from the host owning the row locally
-            setup(endPoints.get(0).getHostAddress(), DatabaseDescriptor.getThriftPort());
+            setup(endPoints.get(0).getHostAddress(), DatabaseDescriptor.getRpcPort());
             thriftClient.insert(table, row, col, "val1".getBytes(), 1, ConsistencyLevel.ONE);
             Column column=thriftClient.get(table, row, col, ConsistencyLevel.ONE).column;
             System.out.println("read row " + row + " " + new String(column.name) + ":" + new String(column.value) + ":" + column.timestamp);