cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1190047 [1/2] - in /cassandra/trunk: ./ bin/daemon/ conf/ contrib/ interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/m...
Date Thu, 27 Oct 2011 21:44:29 GMT
Author: jbellis
Date: Thu Oct 27 21:44:27 2011
New Revision: 1190047

URL: http://svn.apache.org/viewvc?rev=1190047&view=rev
Log:
merge from 1.0

Removed:
    cassandra/trunk/bin/daemon/
    cassandra/trunk/conf/schema-sample.txt
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/README.txt
    cassandra/trunk/build.xml
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/interface/cassandra.thrift
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java   (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/config/EncryptionOptions.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/Ec2Snitch.java
    cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
    cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/FileStreamTask.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7:1026516-1183000
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0:1125021-1130369
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
-/cassandra/branches/cassandra-1.0:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0:1167085-1190046
 /cassandra/branches/cassandra-1.0.0:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1:1102511-1125020

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Thu Oct 27 21:44:27 2011
@@ -26,9 +26,17 @@
  * CompactionManager is now responsible for checking for new candidates
    post-task execution, enabling more consistent leveled compaction 
    (CASSANDRA-3391)
+ * Cache HSHA threads (CASSANDRA-3372)
+ * use CF/KS names as snapshot prefix for drop + truncate operations
+   (CASSANDRA-2997)
+ * Break bloom filters up to avoid heap fragmentation (CASSANDRA-2466)
  * fix cassandra hanging on jsvc stop (CASSANDRA-3302)
  * Avoid leveled compaction getting blocked on errors (CASSANDRA-3408)
  * Make reloading the compaction strategy safe (CASSANDRA-3409)
+ * ignore 0.8 hints even if compaction begins before we try to purge
+   them (CASSANDRA-3385)
+ * remove procrun (bin\daemon) from Cassandra source tree and 
+   artifacts (CASSANDRA-3331)
 Merged from 0.8:
  * (CQL) update grammar to require key clause in DELETE statement
    (CASSANDRA-3349)
@@ -56,7 +64,11 @@ Merged from 0.8:
  * fix assertionError during repair with ordered partitioners (CASSANDRA-3369)
  * correctly serialize key_validation_class for avro (CASSANDRA-3391)
  * don't expire counter tombstone after streaming (CASSANDRA-3394)
+ * prevent nodes that failed to join from hanging around forever 
+   (CASSANDRA-3351)
+ * remove incorrect optimization from slice read path (CASSANDRA-3390)
  * Fix race in AntiEntropyService (CASSANDRA-3400)
+ * allow encryption only between datacenters (CASSANDRA-2802)
 
 
 1.0.0-final

Modified: cassandra/trunk/README.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/README.txt?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/README.txt (original)
+++ cassandra/trunk/README.txt Thu Oct 27 21:44:27 2011
@@ -38,10 +38,15 @@ Now that we're ready, let's start it up!
 
   * bin/cassandra -f
 
-(Running the startup script with the -f argument will cause Cassandra to
-remain in the foreground and log to standard out.  On windows, running
-it with the 'install' argument instead will install Cassandra as a
-Windows Service, and 'uninstall' will remove it.)
+Unix: Running the startup script with the -f argument will cause
+Cassandra to remain in the foreground and log to standard out.
+
+Windows: bin\cassandra.bat runs in the foreground by default.  To
+install Cassandra as a Windows service, download Procrun from
+http://commons.apache.org/daemon/procrun.html, set the PRUNSRV
+environment variable to the full path of prunsrv (e.g.,
+C:\procrun\prunsrv.exe), and run "bin\cassandra.bat install".
+Similarly, "uninstall" will remove the service.
 
 Now let's try to read and write some data using the command line client.
 

Modified: cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/build.xml?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/build.xml (original)
+++ cassandra/trunk/build.xml Thu Oct 27 21:44:27 2011
@@ -41,7 +41,6 @@
     <property name="build.lib" value="${basedir}/lib"/>
     <property name="build.dir" value="${basedir}/build"/>
     <property name="build.dir.lib" value="${basedir}/build/lib"/>
-    <property name="build.dir.daemon" value="${basedir}/bin/daemon"/>
     <property name="build.test.dir" value="${build.dir}/test"/>
     <property name="build.classes" value="${build.dir}/classes"/>
     <property name="build.classes.main" value="${build.classes}/main" />
@@ -858,8 +857,6 @@ url=${svn.entry.url}?pathrev=${svn.entry
         <!-- Shell includes in bin/ (default mode) -->
         <tarfileset dir="${dist.dir}" prefix="${final.name}">
           <include name="bin/*.in.sh" />
-          <include name="${build.dir.daemon}/**" />
-
         </tarfileset>
         <!-- Executable scripts in bin/ -->
         <tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755">
@@ -891,7 +888,6 @@ url=${svn.entry.url}?pathrev=${svn.entry
         <tarfileset dir="${basedir}" prefix="${final.name}-src">
           <include name="bin/*.in.sh" />
           <include name="bin/*.bat" />
-	  <include name="${build.dir.daemon}/**" />
         </tarfileset>
         <!-- Everything else (assumed to be scripts), is executable -->
         <tarfileset dir="${basedir}" prefix="${final.name}-src" mode="755">
@@ -1196,7 +1192,7 @@ url=${svn.entry.url}?pathrev=${svn.entry
   	<property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>
   	<script language="javascript"> <![CDATA[
   		importClass(java.io.File);
-  		jars = project.getProperty("eclipse-project-libs").split(":");  
+  		jars = project.getProperty("eclipse-project-libs").split(project.getProperty("path.separator"));
   		
   		cp = "";
   	    for (i=0; i< jars.length; i++) {

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Thu Oct 27 21:44:27 2011
@@ -164,6 +164,10 @@ sliced_buffer_size_in_kb: 64
 # TCP port, for commands and data
 storage_port: 7000
 
+# SSL port, for encrypted communication.  Unused unless enabled in
+# encryption_options
+ssl_storage_port: 7001
+
 # Address to bind to and tell other Cassandra nodes to connect to. You
 # _must_ change this if you want multiple nodes to be able to
 # communicate!
@@ -403,7 +407,10 @@ index_interval: 128
 # users generate their own keys) TLS_RSA_WITH_AES_128_CBC_SHA as the cipher
 # suite for authentication, key exchange and encryption of the actual data transfers.
 # NOTE: No custom encryption options are enabled at the moment
-# The available internode options are : all, none
+# The available internode options are : all, none, dc, rack
+#
+# If set to dc cassandra will encrypt the traffic between the DCs
+# If set to rack cassandra will encrypt the traffic between the racks
 #
 # The passwords used in these options must match the passwords used when generating
 # the keystore and truststore.  For instructions on generating these files, see:

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
 /cassandra/branches/cassandra-0.7/contrib:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
-/cassandra/branches/cassandra-1.0/contrib:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/contrib:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/contrib:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020

Modified: cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.thrift (original)
+++ cassandra/trunk/interface/cassandra.thrift Thu Oct 27 21:44:27 2011
@@ -344,8 +344,7 @@ struct Mutation {
 
 struct EndpointDetails {
 	1: string host,
-	2: i32 port,
-	3: string datacenter
+	2: string datacenter
 }
 
 /**

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1102511-1125020

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1102511-1125020

Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java Thu Oct 27 21:44:27 2011
@@ -46,18 +46,15 @@ public class EndpointDetails implements 
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EndpointDetails");
 
   private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2);
-  private static final org.apache.thrift.protocol.TField DATACENTER_FIELD_DESC = new org.apache.thrift.protocol.TField("datacenter", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField DATACENTER_FIELD_DESC = new org.apache.thrift.protocol.TField("datacenter", org.apache.thrift.protocol.TType.STRING, (short)2);
 
   public String host;
-  public int port;
   public String datacenter;
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     HOST((short)1, "host"),
-    PORT((short)2, "port"),
-    DATACENTER((short)3, "datacenter");
+    DATACENTER((short)2, "datacenter");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -74,9 +71,7 @@ public class EndpointDetails implements 
       switch(fieldId) {
         case 1: // HOST
           return HOST;
-        case 2: // PORT
-          return PORT;
-        case 3: // DATACENTER
+        case 2: // DATACENTER
           return DATACENTER;
         default:
           return null;
@@ -118,16 +113,12 @@ public class EndpointDetails implements 
   }
 
   // isset id assignments
-  private static final int __PORT_ISSET_ID = 0;
-  private BitSet __isset_bit_vector = new BitSet(1);
 
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.DATACENTER, new org.apache.thrift.meta_data.FieldMetaData("datacenter", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -139,13 +130,10 @@ public class EndpointDetails implements 
 
   public EndpointDetails(
     String host,
-    int port,
     String datacenter)
   {
     this();
     this.host = host;
-    this.port = port;
-    setPortIsSet(true);
     this.datacenter = datacenter;
   }
 
@@ -153,12 +141,9 @@ public class EndpointDetails implements 
    * Performs a deep copy on <i>other</i>.
    */
   public EndpointDetails(EndpointDetails other) {
-    __isset_bit_vector.clear();
-    __isset_bit_vector.or(other.__isset_bit_vector);
     if (other.isSetHost()) {
       this.host = other.host;
     }
-    this.port = other.port;
     if (other.isSetDatacenter()) {
       this.datacenter = other.datacenter;
     }
@@ -171,8 +156,6 @@ public class EndpointDetails implements 
   @Override
   public void clear() {
     this.host = null;
-    setPortIsSet(false);
-    this.port = 0;
     this.datacenter = null;
   }
 
@@ -200,29 +183,6 @@ public class EndpointDetails implements 
     }
   }
 
-  public int getPort() {
-    return this.port;
-  }
-
-  public EndpointDetails setPort(int port) {
-    this.port = port;
-    setPortIsSet(true);
-    return this;
-  }
-
-  public void unsetPort() {
-    __isset_bit_vector.clear(__PORT_ISSET_ID);
-  }
-
-  /** Returns true if field port is set (has been assigned a value) and false otherwise */
-  public boolean isSetPort() {
-    return __isset_bit_vector.get(__PORT_ISSET_ID);
-  }
-
-  public void setPortIsSet(boolean value) {
-    __isset_bit_vector.set(__PORT_ISSET_ID, value);
-  }
-
   public String getDatacenter() {
     return this.datacenter;
   }
@@ -257,14 +217,6 @@ public class EndpointDetails implements 
       }
       break;
 
-    case PORT:
-      if (value == null) {
-        unsetPort();
-      } else {
-        setPort((Integer)value);
-      }
-      break;
-
     case DATACENTER:
       if (value == null) {
         unsetDatacenter();
@@ -281,9 +233,6 @@ public class EndpointDetails implements 
     case HOST:
       return getHost();
 
-    case PORT:
-      return new Integer(getPort());
-
     case DATACENTER:
       return getDatacenter();
 
@@ -300,8 +249,6 @@ public class EndpointDetails implements 
     switch (field) {
     case HOST:
       return isSetHost();
-    case PORT:
-      return isSetPort();
     case DATACENTER:
       return isSetDatacenter();
     }
@@ -330,15 +277,6 @@ public class EndpointDetails implements 
         return false;
     }
 
-    boolean this_present_port = true;
-    boolean that_present_port = true;
-    if (this_present_port || that_present_port) {
-      if (!(this_present_port && that_present_port))
-        return false;
-      if (this.port != that.port)
-        return false;
-    }
-
     boolean this_present_datacenter = true && this.isSetDatacenter();
     boolean that_present_datacenter = true && that.isSetDatacenter();
     if (this_present_datacenter || that_present_datacenter) {
@@ -360,11 +298,6 @@ public class EndpointDetails implements 
     if (present_host)
       builder.append(host);
 
-    boolean present_port = true;
-    builder.append(present_port);
-    if (present_port)
-      builder.append(port);
-
     boolean present_datacenter = true && (isSetDatacenter());
     builder.append(present_datacenter);
     if (present_datacenter)
@@ -391,16 +324,6 @@ public class EndpointDetails implements 
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetPort()).compareTo(typedOther.isSetPort());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPort()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     lastComparison = Boolean.valueOf(isSetDatacenter()).compareTo(typedOther.isSetDatacenter());
     if (lastComparison != 0) {
       return lastComparison;
@@ -435,15 +358,7 @@ public class EndpointDetails implements 
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           }
           break;
-        case 2: // PORT
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.port = iprot.readI32();
-            setPortIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 3: // DATACENTER
+        case 2: // DATACENTER
           if (field.type == org.apache.thrift.protocol.TType.STRING) {
             this.datacenter = iprot.readString();
           } else { 
@@ -470,9 +385,6 @@ public class EndpointDetails implements 
       oprot.writeString(this.host);
       oprot.writeFieldEnd();
     }
-    oprot.writeFieldBegin(PORT_FIELD_DESC);
-    oprot.writeI32(this.port);
-    oprot.writeFieldEnd();
     if (this.datacenter != null) {
       oprot.writeFieldBegin(DATACENTER_FIELD_DESC);
       oprot.writeString(this.datacenter);
@@ -495,10 +407,6 @@ public class EndpointDetails implements 
     }
     first = false;
     if (!first) sb.append(", ");
-    sb.append("port:");
-    sb.append(this.port);
-    first = false;
-    if (!first) sb.append(", ");
     sb.append("datacenter:");
     if (this.datacenter == null) {
       sb.append("null");
@@ -524,8 +432,6 @@ public class EndpointDetails implements 
 
   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
     try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bit_vector = new BitSet(1);
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
       throw new java.io.IOException(te);

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1102511-1125020

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1102511-1125020

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 27 21:44:27 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1183000
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188740
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1186803,1187333,1187339,1187477,1188353,1188740
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1187545,1188741,1188757,1189073,1189738,1189822,1189831
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1190046
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1167229,1167232-1181093,1181741,1181816,1181820,1182951,1183243
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1102511-1125020

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Config.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Config.java Thu Oct 27 21:44:27 2011
@@ -62,6 +62,7 @@ public class Config
     public Integer sliced_buffer_size_in_kb = 64;
     
     public Integer storage_port = 7000;
+    public Integer ssl_storage_port = 7001;
     public String listen_address;
     public String broadcast_address;
     

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Thu Oct 27 21:44:27 2011
@@ -632,6 +632,11 @@ public class DatabaseDescriptor
         return Integer.parseInt(System.getProperty("cassandra.storage_port", conf.storage_port.toString()));
     }
 
+    public static int getSSLStoragePort()
+    {
+        return Integer.parseInt(System.getProperty("cassandra.ssl_storage_port", conf.ssl_storage_port.toString()));
+    }
+
     public static int getRpcPort()
     {
         return Integer.parseInt(System.getProperty("cassandra.rpc_port", conf.rpc_port.toString()));

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/EncryptionOptions.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/EncryptionOptions.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/EncryptionOptions.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/EncryptionOptions.java Thu Oct 27 21:44:27 2011
@@ -33,6 +33,8 @@ public class EncryptionOptions
     public static enum InternodeEncryption
     {
         all,
-        none
+        none,
+        dc,
+        rack
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Thu Oct 27 21:44:27 2011
@@ -1190,44 +1190,8 @@ public class ColumnFamilyStore implement
      */
     ColumnFamily filterColumnFamily(ColumnFamily cached, QueryFilter filter, int gcBefore)
     {
-        // special case slicing the entire row:
-        // we can skip the filter step entirely, and we can help out removeDeleted by re-caching the result
-        // if any tombstones have aged out since last time.  (This means that the row cache will treat gcBefore as
-        // max(gcBefore, all previous gcBefore), which is fine for correctness.)
-        //
-        // But, if the filter is asking for less columns than we have cached, we fall back to the slow path
-        // since we have to copy out a subset.
-        if (filter.filter instanceof SliceQueryFilter)
-        {
-            SliceQueryFilter sliceFilter = (SliceQueryFilter) filter.filter;
-            if (sliceFilter.start.remaining() == 0 && sliceFilter.finish.remaining() == 0)
-            {
-                if (cached.isSuper() && filter.path.superColumnName != null)
-                {
-                    // subcolumns from named supercolumn
-                    IColumn sc = cached.getColumn(filter.path.superColumnName);
-                    if (sc == null || sliceFilter.count >= sc.getSubColumns().size())
-                    {
-                        ColumnFamily cf = cached.cloneMeShallow(ArrayBackedSortedColumns.factory(), filter.filter.isReversed());
-                        if (sc != null)
-                            cf.addColumn(sc, HeapAllocator.instance);
-                        return removeDeleted(cf, gcBefore);
-                    }
-                }
-                else
-                {
-                    // top-level columns
-                    if (sliceFilter.count >= cached.getColumnCount())
-                    {
-                        removeDeletedColumnsOnly(cached, gcBefore);
-                        return removeDeletedCF(cached, gcBefore);
-                    }
-                }
-            }
-        }
-
+        ColumnFamily cf = cached.cloneMeShallow(ArrayBackedSortedColumns.factory(), filter.filter.isReversed());
         IColumnIterator ci = filter.getMemtableColumnIterator(cached, null, getComparator());
-        ColumnFamily cf = ci.getColumnFamily().cloneMeShallow(ArrayBackedSortedColumns.factory(), filter.filter.isReversed());
         filter.collateColumns(cf, Collections.singletonList(ci), getComparator(), gcBefore);
         // TODO this is necessary because when we collate supercolumns together, we don't check
         // their subcolumns for relevance, so we need to do a second prune post facto here.
@@ -1665,7 +1629,7 @@ public class ColumnFamilyStore implement
             throw new AssertionError(e);
         }
         long truncatedAt = System.currentTimeMillis();
-        snapshot(Table.getTimestampedSnapshotName("before-truncate"));
+        snapshot(Table.getTimestampedSnapshotName(columnFamily));
 
         return CompactionManager.instance.submitTruncate(this, truncatedAt);
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Thu Oct 27 21:44:27 2011
@@ -85,9 +85,13 @@ public class HintedHandOffManager implem
 
     private static final Logger logger_ = LoggerFactory.getLogger(HintedHandOffManager.class);
     private static final int PAGE_SIZE = 1024;
-    private static final String SEPARATOR = "-";
     private static final int LARGE_NUMBER = 65536; // 64k nodes ought to be enough for anybody.
 
+    // in 0.8, subcolumns were KS-CF bytestrings, and the data was stored in the "normal" storage there.
+    // (so replay always consisted of sending an entire row,
+    // no matter how little was part of the mutation that created the hint.)
+    private static final String SEPARATOR_08 = "-";
+
     private final NonBlockingHashSet<InetAddress> queuedDeliveries = new NonBlockingHashSet<InetAddress>();
 
     private final ExecutorService executor_ = new JMXEnabledThreadPoolExecutor("HintedHandoff", Thread.MIN_PRIORITY);
@@ -139,7 +143,7 @@ public class HintedHandOffManager implem
     {
         RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tokenBytes);
         rm.delete(new QueryPath(HINTS_CF, hintId), timestamp);
-        rm.apply();
+        rm.applyUnsafe(); // don't bother with commitlog since we're going to flush as soon as we're done with delivery
     }
 
     public void deleteHintsForEndpoint(final String ipOrHostname)
@@ -275,9 +279,20 @@ public class HintedHandOffManager implem
             if (pagingFinished(hintColumnFamily, startColumn))
                 break;
 
+            page:
             for (IColumn hint : hintColumnFamily.getSortedColumns())
             {
                 startColumn = hint.name();
+                for (IColumn subColumn : hint.getSubColumns())
+                {
+                    // both 0.8 and 1.0 column names are UTF8 strings, so this check is safe
+                    if (ByteBufferUtil.string(subColumn.name()).contains(SEPARATOR_08))
+                    {
+                        logger_.debug("0.8-style hint found.  This should have been taken care of by purgeIncompatibleHints");
+                        deleteHint(tokenBytes, hint.name(), subColumn.timestamp());
+                        continue page;
+                    }
+                }
 
                 IColumn versionColumn = hint.getSubColumn(ByteBufferUtil.bytes("version"));
                 IColumn tableColumn = hint.getSubColumn(ByteBufferUtil.bytes("table"));

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java Thu Oct 27 21:44:27 2011
@@ -109,16 +109,26 @@ public class SystemTable
         QueryFilter filter = QueryFilter.getNamesFilter(decorate(COOKIE_KEY), new QueryPath(STATUS_CF), upgradeMarker);
         ColumnFamily cf = table.getColumnFamilyStore(STATUS_CF).getColumnFamily(filter);
         if (cf != null)
+        {
+            logger.debug("Pre-1.0 hints already purged");
             return;
+        }
 
         // marker not found.  Snapshot + remove hints and add the marker
         ColumnFamilyStore hintsCfs = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HintedHandOffManager.HINTS_CF);
         if (hintsCfs.getSSTables().size() > 0)
         {
-            logger.info("Possible old-format hints found. Snapshotting as 'old-hints' and purging");
-            hintsCfs.snapshot("old-hints");
-            hintsCfs.removeAllSSTables();
+            logger.info("Possible old-format hints found. Truncating");
+            try
+            {
+                hintsCfs.truncate();
+            }
+            catch (Exception e)
+            {
+                throw new RuntimeException(e);
+            }
         }
+        logger.debug("Marking pre-1.0 hints purged");
         RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, COOKIE_KEY);
         rm.add(new QueryPath(STATUS_CF, null, upgradeMarker), ByteBufferUtil.bytes("oh yes, they were purged"), System.currentTimeMillis());
         rm.apply();

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java Thu Oct 27 21:44:27 2011
@@ -78,7 +78,7 @@ public class DropColumnFamily extends Mi
 
         if (!StorageService.instance.isClientMode())
         {
-            cfs.snapshot(Table.getTimestampedSnapshotName(null));
+            cfs.snapshot(Table.getTimestampedSnapshotName(cfs.columnFamily));
 
             CompactionManager.instance.getCompactionLock().lock();
             cfs.flushLock.lock();

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropKeyspace.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropKeyspace.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/DropKeyspace.java Thu Oct 27 21:44:27 2011
@@ -47,7 +47,7 @@ public class DropKeyspace extends Migrat
 
     public void applyModels() throws IOException
     {
-        String snapshotName = Table.getTimestampedSnapshotName(null);
+        String snapshotName = Table.getTimestampedSnapshotName(name);
         CompactionManager.instance.getCompactionLock().lock();
         try
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Thu Oct 27 21:44:27 2011
@@ -562,15 +562,18 @@ public class Gossiper implements IFailur
             {
                 long duration = now - epState.getUpdateTimestamp();
 
-                if (StorageService.instance.getTokenMetadata().isMember(endpoint))
-                    epState.setHasToken(true);
                 // check if this is a fat client. fat clients are removed automatically from
                 // gosip after FatClientTimeout
                 if (!epState.hasToken() && !epState.isAlive() && !justRemovedEndpoints.containsKey(endpoint) && (duration > FatClientTimeout))
                 {
-                    logger.info("FatClient " + endpoint + " has been silent for " + FatClientTimeout + "ms, removing from gossip");
-                    removeEndpoint(endpoint); // will put it in justRemovedEndpoints to respect quarantine delay
-                    evictFromMembership(endpoint); // can get rid of the state immediately
+                    if (StorageService.instance.getTokenMetadata().isMember(endpoint))
+                        epState.setHasToken(true);
+                    else
+                    {
+                        logger.info("FatClient " + endpoint + " has been silent for " + FatClientTimeout + "ms, removing from gossip");
+                        removeEndpoint(endpoint); // will put it in justRemovedEndpoints to respect quarantine delay
+                        evictFromMembership(endpoint); // can get rid of the state immediately
+                    }
                 }
 
                 long expireTime = getExpireTimeForEndpoint(endpoint);
@@ -768,7 +771,7 @@ public class Gossiper implements IFailur
      */
     private void handleMajorStateChange(InetAddress ep, EndpointState epState)
     {
-        if (epState.getApplicationState(ApplicationState.STATUS) != null && !isDeadState(epState))
+        if (!isDeadState(epState))
         {
             if (endpointStateMap.get(ep) != null)
                 logger.info("Node {} has restarted, now UP", ep);
@@ -783,7 +786,7 @@ public class Gossiper implements IFailur
         for (IEndpointStateChangeSubscriber subscriber : subscribers)
             subscriber.onRestart(ep, epState);
 
-        if (epState.getApplicationState(ApplicationState.STATUS) != null && !isDeadState(epState))
+        if (!isDeadState(epState))
             markAlive(ep, epState);
         else
         {
@@ -797,6 +800,8 @@ public class Gossiper implements IFailur
 
     public Boolean isDeadState(EndpointState epState)
     {
+        if (epState.getApplicationState(ApplicationState.STATUS) == null)
+            return false;
         String value = epState.getApplicationState(ApplicationState.STATUS).value;
         String[] pieces = value.split(VersionedValue.DELIMITER_STR, -1);
         assert (pieces.length > 0);

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/Ec2Snitch.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/Ec2Snitch.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/Ec2Snitch.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/Ec2Snitch.java Thu Oct 27 21:44:27 2011
@@ -44,6 +44,8 @@ public class Ec2Snitch extends AbstractN
 {
     protected static Logger logger = LoggerFactory.getLogger(Ec2Snitch.class);
     protected static final String ZONE_NAME_QUERY_URL = "http://169.254.169.254/latest/meta-data/placement/availability-zone";
+    private static final String DEFAULT_DC = "UNKNOWN-DC";
+    private static final String DEFAULT_RACK = "UNKNOWN-RACK";
     protected String ec2zone;
     protected String ec2region;
 
@@ -83,14 +85,20 @@ public class Ec2Snitch extends AbstractN
     {
         if (endpoint.equals(FBUtilities.getBroadcastAddress()))
             return ec2zone;
-        return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RACK).value;
+        EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
+        if (null == state || null == state.getApplicationState(ApplicationState.RACK))
+            return DEFAULT_RACK;
+        return state.getApplicationState(ApplicationState.RACK).value;
     }
 
     public String getDatacenter(InetAddress endpoint)
     {
         if (endpoint.equals(FBUtilities.getBroadcastAddress()))
             return ec2region;
-        return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.DC).value;
+        EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
+        if (null == state || null == state.getApplicationState(ApplicationState.DC))
+            return DEFAULT_DC;
+        return state.getApplicationState(ApplicationState.DC).value;
     }
 
     @Override

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Thu Oct 27 21:44:27 2011
@@ -35,6 +35,8 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -88,7 +90,7 @@ public final class MessagingService impl
     private static final Logger logger_ = LoggerFactory.getLogger(MessagingService.class);
     private static final int LOG_DROPPED_INTERVAL_IN_MS = 5000;
 
-    private SocketThread socketThread;
+    private List<SocketThread> socketThreads = Lists.newArrayList();
     private final SimpleCondition listenGate;
 
     /**
@@ -236,41 +238,45 @@ public final class MessagingService impl
      */
     public void listen(InetAddress localEp) throws IOException, ConfigurationException
     {
-        socketThread = new SocketThread(getServerSocket(localEp), "ACCEPT-" + localEp);
-        socketThread.start();
+        for (ServerSocket ss: getServerSocket(localEp))
+        {
+            SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp);
+            th.start();
+            socketThreads.add(th);
+        }
         listenGate.signalAll();
     }
 
-    private ServerSocket getServerSocket(InetAddress localEp) throws IOException, ConfigurationException
+    private List<ServerSocket> getServerSocket(InetAddress localEp) throws IOException, ConfigurationException
     {
-        final ServerSocket ss;
-        if (DatabaseDescriptor.getEncryptionOptions() != null && DatabaseDescriptor.getEncryptionOptions().internode_encryption == EncryptionOptions.InternodeEncryption.all)
+       final List<ServerSocket> ss = new ArrayList<ServerSocket>();
+        if (DatabaseDescriptor.getEncryptionOptions() != null && DatabaseDescriptor.getEncryptionOptions().internode_encryption != EncryptionOptions.InternodeEncryption.none)
         {
-            ss = SSLFactory.getServerSocket(DatabaseDescriptor.getEncryptionOptions(), localEp, DatabaseDescriptor.getStoragePort());
+            ss.add(SSLFactory.getServerSocket(DatabaseDescriptor.getEncryptionOptions(), localEp, DatabaseDescriptor.getSSLStoragePort()));
             // setReuseAddress happens in the factory.
-            logger_.info("Starting Encrypted Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
+            logger_.info("Starting Encrypted Messaging Service on SSL port {}", DatabaseDescriptor.getSSLStoragePort());
         }
-        else
+        
+        ServerSocketChannel serverChannel = ServerSocketChannel.open();
+        ServerSocket socket = serverChannel.socket();
+        socket.setReuseAddress(true);
+        InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
+        try
         {
-            ServerSocketChannel serverChannel = ServerSocketChannel.open();
-            ss = serverChannel.socket();
-            ss.setReuseAddress(true);
-            InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
-            try
-            {
-                ss.bind(address);
-            }
-            catch (BindException e)
-            {
-                if (e.getMessage().contains("in use"))
-                    throw new ConfigurationException(address + " is in use by another process.  Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services");
-                else if (e.getMessage().contains("Cannot assign requested address"))
-                    throw new ConfigurationException("Unable to bind to address " + address + ". Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2");
-                else
-                    throw e;
-            }
-            logger_.info("Starting Messaging Service on {}", address);
+            socket.bind(address);
+        }
+        catch (BindException e)
+        {
+            if (e.getMessage().contains("in use"))
+                throw new ConfigurationException(address + " is in use by another process.  Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services");
+            else if (e.getMessage().contains("Cannot assign requested address"))
+                throw new ConfigurationException("Unable to bind to address " + address
+                        + ". Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2");
+            else
+                throw e;
         }
+        logger_.info("Starting Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
+        ss.add(socket);
         return ss;
     }
 
@@ -453,7 +459,7 @@ public final class MessagingService impl
     public void stream(StreamHeader header, InetAddress to)
     {
         /* Streaming asynchronously on streamExector_ threads. */
-        streamExecutor_.execute(new FileStreamTask(header, to, DatabaseDescriptor.getEncryptionOptions()));
+        streamExecutor_.execute(new FileStreamTask(header, to));
     }
 
     /** The count of active outbound stream tasks. */
@@ -485,7 +491,8 @@ public final class MessagingService impl
 
         try
         {
-            socketThread.close();
+            for (SocketThread th : socketThreads)
+                th.close();
         }
         catch (IOException e)
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java Thu Oct 27 21:44:27 2011
@@ -24,7 +24,6 @@ package org.apache.cassandra.net;
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.net.Socket;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -34,9 +33,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.EncryptionOptions;
-import org.apache.cassandra.gms.Gossiper;
-import org.apache.cassandra.security.SSLFactory;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
@@ -51,23 +47,17 @@ public class OutboundTcpConnection exten
                                                               MessagingService.version_);
 
     private static final int OPEN_RETRY_DELAY = 100; // ms between retries
-
-    private InetAddress endpoint;
     private final BlockingQueue<Pair<Message, String>> queue = new LinkedBlockingQueue<Pair<Message, String>>();
-    private DataOutputStream out;
+    private final OutboundTcpConnectionPool poolReference;    
 
+    private DataOutputStream out;
     private Socket socket;
     private long completedCount;
 
-    public OutboundTcpConnection(InetAddress remoteEp)
-    {
-        super("WRITE-" + remoteEp);
-        setEndPoint(remoteEp);        
-    }
-    
-    public void setEndPoint(InetAddress remoteEndPoint)
+    public OutboundTcpConnection(OutboundTcpConnectionPool pool)
     {
-        this.endpoint = remoteEndPoint;
+        super("WRITE-" + pool.endPoint());
+        this.poolReference = pool;
     }
 
     public void enqueue(Message message, String id)
@@ -131,7 +121,7 @@ public class OutboundTcpConnection exten
         catch (IOException e)
         {
             if (logger.isDebugEnabled())
-                logger.debug("error writing to " + endpoint, e);
+                logger.debug("error writing to " + poolReference.endPoint(), e);
             disconnect();
         }
     }
@@ -185,7 +175,7 @@ public class OutboundTcpConnection exten
             catch (IOException e)
             {
                 if (logger.isDebugEnabled())
-                    logger.debug("exception closing connection to " + endpoint, e);
+                    logger.debug("exception closing connection to " + poolReference.endPoint(), e);
             }
             out = null;
             socket = null;
@@ -210,22 +200,13 @@ public class OutboundTcpConnection exten
     private boolean connect()
     {
         if (logger.isDebugEnabled())
-            logger.debug("attempting to connect to " + endpoint);
+            logger.debug("attempting to connect to " + poolReference.endPoint());
         long start = System.currentTimeMillis();
         while (System.currentTimeMillis() < start + DatabaseDescriptor.getRpcTimeout())
         {
             try
             {
-                // zero means 'bind on any available port.'
-                EncryptionOptions options = DatabaseDescriptor.getEncryptionOptions();
-                if (options != null && options.internode_encryption == EncryptionOptions.InternodeEncryption.all)
-                {
-                    socket = SSLFactory.getSocket(options, endpoint, DatabaseDescriptor.getStoragePort(), FBUtilities.getLocalAddress(), 0);
-                }
-                else {
-                    socket = new Socket(endpoint, DatabaseDescriptor.getStoragePort(), FBUtilities.getLocalAddress(), 0);
-                }
-
+                socket = poolReference.newSocket();
                 socket.setKeepAlive(true);
                 socket.setTcpNoDelay(true);
                 out = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 4096));
@@ -235,7 +216,7 @@ public class OutboundTcpConnection exten
             {
                 socket = null;
                 if (logger.isTraceEnabled())
-                    logger.trace("unable to connect to " + endpoint, e);
+                    logger.trace("unable to connect to " + poolReference.endPoint(), e);
                 try
                 {
                     Thread.sleep(OPEN_RETRY_DELAY);

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java Thu Oct 27 21:44:27 2011
@@ -18,20 +18,32 @@
 
 package org.apache.cassandra.net;
 
+import java.io.IOException;
 import java.net.InetAddress;
+import java.net.Socket;
 
 import org.apache.cassandra.concurrent.Stage;
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.locator.IEndpointSnitch;
+import org.apache.cassandra.security.SSLFactory;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class OutboundTcpConnectionPool
 {
+    private IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch();
+    // pointer for the real Address.
+    private final InetAddress id;
     public final OutboundTcpConnection cmdCon;
     public final OutboundTcpConnection ackCon;
+    // pointer to the reseted Address.
+    private InetAddress resetedEndpoint;
 
     OutboundTcpConnectionPool(InetAddress remoteEp)
     {
-        cmdCon = new OutboundTcpConnection(remoteEp);
+        id = remoteEp;
+        cmdCon = new OutboundTcpConnection(this);
         cmdCon.start();
-        ackCon = new OutboundTcpConnection(remoteEp);
+        ackCon = new OutboundTcpConnection(this);
         ackCon.start();
     }
 
@@ -55,9 +67,46 @@ public class OutboundTcpConnectionPool
     
     public void reset(InetAddress remoteEP)
     {
-        ackCon.setEndPoint(remoteEP);
-        ackCon.closeSocket();
-        cmdCon.setEndPoint(remoteEP);
-        cmdCon.closeSocket();
+        resetedEndpoint = remoteEP;
+        reset();
+    }
+    
+    public Socket newSocket() throws IOException
+    {
+        // zero means 'bind on any available port.'
+        if (isEncryptedChannel())
+        {
+            return SSLFactory.getSocket(DatabaseDescriptor.getEncryptionOptions(), endPoint(), DatabaseDescriptor.getSSLStoragePort(), FBUtilities.getLocalAddress(), 0);
+        }
+        else {
+            return new Socket(endPoint(), DatabaseDescriptor.getStoragePort(), FBUtilities.getLocalAddress(), 0);
+        }
+    }
+    
+    InetAddress endPoint()
+    {
+        return resetedEndpoint == null ? id : resetedEndpoint;
+    }
+    
+    boolean isEncryptedChannel()
+    {
+        switch (DatabaseDescriptor.getEncryptionOptions().internode_encryption)
+        {
+            case none:
+                return false; // if nothing needs to be encrypted then return immediately.
+            case all:
+                break;
+            case dc:
+                if (snitch.getDatacenter(id).equals(snitch.getDatacenter(FBUtilities.getBroadcastAddress())))
+                    return false;
+                break;
+            case rack:
+                // for rack then check if the DC's are the same.
+                if (snitch.getRack(id).equals(snitch.getRack(FBUtilities.getBroadcastAddress()))
+                        && snitch.getDatacenter(id).equals(snitch.getDatacenter(FBUtilities.getBroadcastAddress())))
+                    return false;
+                break;
+        }
+        return true;
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Thu Oct 27 21:44:27 2011
@@ -916,7 +916,7 @@ public class StorageProxy implements Sto
             public void response(Message message)
             {
                 // record the response from the remote node.
-                logger.debug("Received schema check response from " + message.getFrom().getHostAddress());
+                logger.debug("Received schema check response from {}", message.getFrom().getHostAddress());
                 UUID theirVersion = UUID.fromString(new String(message.getMessageBody()));
                 versions.put(message.getFrom(), theirVersion);
                 latch.countDown();
@@ -947,7 +947,7 @@ public class StorageProxy implements Sto
             throw new AssertionError("This latch shouldn't have been interrupted.");
         }
 
-        logger.debug("My version is " + myVersion);
+        logger.debug("My version is {}", myVersion);
 
         // maps versions to hosts that are on that version.
         Map<String, List<String>> results = new HashMap<String, List<String>>();
@@ -967,14 +967,14 @@ public class StorageProxy implements Sto
 
         // we're done: the results map is ready to return to the client.  the rest is just debug logging:
         if (results.get(UNREACHABLE) != null)
-            logger.debug("Hosts not in agreement. Didn't get a response from everybody: " + StringUtils.join(results.get(UNREACHABLE), ","));
+            logger.debug("Hosts not in agreement. Didn't get a response from everybody: {}", StringUtils.join(results.get(UNREACHABLE), ","));
         for (Map.Entry<String, List<String>> entry : results.entrySet())
         {
             // check for version disagreement. log the hosts that don't agree.
             if (entry.getKey().equals(UNREACHABLE) || entry.getKey().equals(myVersion))
                 continue;
             for (String host : entry.getValue())
-                logger.debug("%s disagrees (%s)", host, entry.getKey());
+                logger.debug("{} disagrees ({})", host, entry.getKey());
         }
         if (results.size() == 1)
             logger.debug("Schemas are in agreement.");
@@ -992,7 +992,7 @@ public class StorageProxy implements Sto
         if (queryRange instanceof Bounds && queryRange.left.equals(queryRange.right) && !queryRange.left.equals(StorageService.getPartitioner().getMinimumToken()))
         {
             if (logger.isDebugEnabled())
-                logger.debug("restricted single token match for query " + queryRange);
+                logger.debug("restricted single token match for query {}", queryRange);
             return Collections.singletonList(queryRange);
         }
 
@@ -1016,7 +1016,7 @@ public class StorageProxy implements Sto
         if (remainder != null)
             ranges.add(remainder);
         if (logger.isDebugEnabled())
-            logger.debug("restricted ranges for query " + queryRange + " are " + ranges);
+            logger.debug("restricted ranges for query {} are {}", queryRange, ranges);
 
         return ranges;
     }
@@ -1103,7 +1103,7 @@ public class StorageProxy implements Sto
 
         Token leftToken = index_clause.start_key == null ? p.getMinimumToken() : p.getToken(index_clause.start_key);
         List<AbstractBounds> ranges = getRestrictedRanges(new Bounds(leftToken, p.getMinimumToken()));
-        logger.debug("scan ranges are " + StringUtils.join(ranges, ","));
+        logger.debug("scan ranges are {}", StringUtils.join(ranges, ","));
 
         // now scan until we have enough results
         List<Row> rows = new ArrayList<Row>(index_clause.count);
@@ -1130,7 +1130,7 @@ public class StorageProxy implements Sto
             {
                 MessagingService.instance().sendRR(producer, endpoint, handler);
                 if (logger.isDebugEnabled())
-                    logger.debug("reading " + command + " from " + endpoint);
+                    logger.debug("reading {} from {}", command, endpoint);
             }
 
             try

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/FileStreamTask.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/FileStreamTask.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/FileStreamTask.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/FileStreamTask.java Thu Oct 27 21:44:27 2011
@@ -22,20 +22,16 @@ import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.InetAddress;
-import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.nio.ByteBuffer;
 
-import org.apache.cassandra.config.EncryptionOptions;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.gms.Gossiper;
 import org.apache.cassandra.io.compress.CompressedRandomAccessReader;
 import org.apache.cassandra.io.util.RandomAccessReader;
-import org.apache.cassandra.security.SSLFactory;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
 import org.apache.cassandra.utils.Throttle;
 import org.apache.cassandra.utils.WrappedRunnable;
@@ -60,18 +56,15 @@ public class FileStreamTask extends Wrap
     private Socket socket;
     // socket's output stream
     private OutputStream output;
-    // system encryption options if any
-    private final EncryptionOptions encryptionOptions;
     // allocate buffer to use for transfers only once
     private final byte[] transferBuffer = new byte[CHUNK_SIZE];
     // outbound global throughput limiter
     private final Throttle throttle;
 
-    public FileStreamTask(StreamHeader header, InetAddress to, EncryptionOptions encryptionOptions)
+    public FileStreamTask(StreamHeader header, InetAddress to)
     {
         this.header = header;
         this.to = to;
-        this.encryptionOptions = encryptionOptions;
         this.throttle = new Throttle(toString(), new Throttle.ThroughputFunction()
         {
             /** @return Instantaneous throughput target in bytes per millisecond. */
@@ -198,13 +191,13 @@ public class FileStreamTask extends Wrap
      */
     private void connectAttempt() throws IOException
     {
-        bind();
         int attempts = 0;
         while (true)
         {
             try
             {
-                connect();
+                socket = MessagingService.instance().getConnectionPool(to).newSocket();
+                output = socket.getOutputStream();
                 break;
             }
             catch (IOException e)
@@ -226,22 +219,6 @@ public class FileStreamTask extends Wrap
         }
     }
 
-    protected void bind() throws IOException
-    {
-        socket = (encryptionOptions != null && encryptionOptions.internode_encryption == EncryptionOptions.InternodeEncryption.all)
-                    ? SSLFactory.getSocket(encryptionOptions)
-                    : new Socket();
-
-        // force local binding on correctly specified interface.
-        socket.bind(new InetSocketAddress(FBUtilities.getLocalAddress(), 0));
-    }
-
-    protected void connect() throws IOException
-    {
-        socket.connect(new InetSocketAddress(to, DatabaseDescriptor.getStoragePort()));
-        output = socket.getOutputStream();
-    }
-
     protected void close() throws IOException
     {
         output.close();

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Thu Oct 27 21:44:27 2011
@@ -805,29 +805,20 @@ public class CassandraServer implements 
             {
                 EndpointState eps = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
                 EndpointDetails details = new EndpointDetails();
-                // default to an unknown port since we
-                // don't seem to maintain that knowledge about remote endpoints.
-                details.port = -1;
 
                 if (endpoint.equals(FBUtilities.getBroadcastAddress()))
-                {
                     details.host = DatabaseDescriptor.getRpcAddress().getHostAddress();
-                    details.port = DatabaseDescriptor.getRpcPort();
-                }
                 else if (eps.getApplicationState(ApplicationState.RPC_ADDRESS) == null)
                     details.host = endpoint.getHostAddress();
                 else
                     details.host = eps.getApplicationState(ApplicationState.RPC_ADDRESS).value;
 
-                VersionedValue appStateDc = eps.getApplicationState(ApplicationState.DC);
-                if (appStateDc != null)
-                    details.datacenter = appStateDc.value;
+                details.datacenter = DatabaseDescriptor.getEndpointSnitch().getDatacenter(endpoint);
 
                 endpoints.add(details.host);
                 rpc_endpoints.add(StorageService.instance.getRpcaddress(endpoint));
 
-                if (details.port != -1 || details.datacenter != null)
-                    epDetails.add(details);
+                epDetails.add(details);
             }
 
             TokenRange tr = new TokenRange(tf.toString(range.left), tf.toString(range.right), endpoints)

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java Thu Oct 27 21:44:27 2011
@@ -27,7 +27,6 @@ import org.apache.cassandra.utils.obs.Op
 
 public class BloomFilter extends Filter
 {
-
     private static final Logger logger = LoggerFactory.getLogger(BloomFilter.class);
     private static final int EXCESS = 20;
     static BloomFilterSerializer serializer_ = new BloomFilterSerializer();
@@ -88,14 +87,9 @@ public class BloomFilter extends Filter
         return new BloomFilter(spec.K, bucketsFor(numElements, spec.bucketsPerElement));
     }
 
-    private long buckets()
-    {
-      return bitset.size();
-    }
-
     private long[] getHashBuckets(ByteBuffer key)
     {
-        return BloomFilter.getHashBuckets(key, hashCount, buckets());
+        return BloomFilter.getHashBuckets(key, hashCount, bitset.size());
     }
 
     // Murmur is faster than an SHA-based approach and provides as-good collision
@@ -119,7 +113,7 @@ public class BloomFilter extends Filter
     {
         for (long bucketIndex : getHashBuckets(key))
         {
-            bitset.set(bucketIndex);
+            bitset.fastSet(bucketIndex);
         }
     }
 
@@ -127,7 +121,7 @@ public class BloomFilter extends Filter
     {
       for (long bucketIndex : getHashBuckets(key))
       {
-          if (!bitset.get(bucketIndex))
+          if (!bitset.fastGet(bucketIndex))
           {
               return false;
           }

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java Thu Oct 27 21:44:27 2011
@@ -33,24 +33,36 @@ public class BloomFilterSerializer imple
 {
     public void serialize(BloomFilter bf, DataOutput dos) throws IOException
     {
-        long[] bits = bf.bitset.getBits();
-        int bitLength = bits.length;
+        int bitLength = bf.bitset.getNumWords();
+        int pageSize = bf.bitset.getPageSize();
+        int pageCount = bf.bitset.getPageCount();
 
         dos.writeInt(bf.getHashCount());
         dos.writeInt(bitLength);
 
-        for (int i = 0; i < bitLength; i++)
-            dos.writeLong(bits[i]);
+        for (int p = 0; p < pageCount; p++)
+        {
+            long[] bits = bf.bitset.getPage(p);
+            for (int i = 0; i < pageSize && bitLength-- > 0; i++)
+                dos.writeLong(bits[i]);
+        }
     }
 
     public BloomFilter deserialize(DataInput dis) throws IOException
     {
         int hashes = dis.readInt();
-        int bitLength = dis.readInt();
-        long[] bits = new long[bitLength];
-        for (int i = 0; i < bitLength; i++)
-            bits[i] = dis.readLong();
-        OpenBitSet bs = new OpenBitSet(bits, bitLength);
+        long bitLength = dis.readInt();
+        OpenBitSet bs = new OpenBitSet(bitLength << 6);
+        int pageSize = bs.getPageSize();
+        int pageCount = bs.getPageCount();
+
+        for (int p = 0; p < pageCount; p++)
+        {
+            long[] bits = bs.getPage(p);
+            for (int i = 0; i < pageSize && bitLength-- > 0; i++)
+                bits[i] = dis.readLong();
+        }
+
         return new BloomFilter(hashes, bs);
     }
 
@@ -66,6 +78,6 @@ public class BloomFilterSerializer imple
     {
         return DBConstants.intSize // hash count
                + DBConstants.intSize // length
-               + bf.bitset.getBits().length * DBConstants.longSize; // buckets
+               + bf.bitset.getNumWords() * DBConstants.longSize; // buckets
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java Thu Oct 27 21:44:27 2011
@@ -25,11 +25,10 @@ import com.google.common.collect.Orderin
 
 public class Interval<T>
 {
-    public Comparable min;
-    public Comparable max;
+    public final Comparable min;
+    public final Comparable max;
     public final T Data;
 
-
     public Interval(Comparable min, Comparable max)
     {
         this.min = min;
@@ -62,22 +61,24 @@ public class Interval<T>
     }
 
 
-    public static Ordering<Interval> minOrdering = new Ordering<Interval>()
+    public static final Ordering<Interval> minOrdering = new Ordering<Interval>()
     {
-        @Override
         public int compare(Interval interval, Interval interval1)
         {
             return interval.min.compareTo(interval1.min);
         }
     };
 
-    public static Ordering<Interval> maxOrdering = new Ordering<Interval>()
+    public static final Ordering<Interval> maxOrdering = new Ordering<Interval>()
     {
-        @Override
         public int compare(Interval interval, Interval interval1)
         {
             return interval.max.compareTo(interval1.max);
         }
     };
 
+    public String toString()
+    {
+        return String.format("Interval(%s, %s)", min, max);
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java?rev=1190047&r1=1190046&r2=1190047&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java Thu Oct 27 21:44:27 2011
@@ -24,10 +24,14 @@ package org.apache.cassandra.utils.Inter
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import com.google.common.collect.ImmutableList;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class IntervalNode
 {
+    private static final Logger logger = LoggerFactory.getLogger(IntervalNode.class);
+
     Comparable v_pt;
     Comparable v_min;
     Comparable v_max;
@@ -38,6 +42,8 @@ public class IntervalNode
 
     public IntervalNode(List<Interval> toBisect)
     {
+        logger.debug("Creating IntervalNode from {}", toBisect);
+
         if (toBisect.size() > 0)
         {
             findMinMedianMax(toBisect);



Mime
View raw message