cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1126485 - in /cassandra/trunk: ./ bin/ contrib/ drivers/java/src/org/apache/cassandra/cql/jdbc/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/config/ src/java/org/ap...
Date Mon, 23 May 2011 13:30:49 GMT
Author: jbellis
Date: Mon May 23 13:30:48 2011
New Revision: 1126485

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

Added:
    cassandra/trunk/bin/sstableloader
      - copied unchanged from r1126484, cassandra/branches/cassandra-0.8/bin/sstableloader
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
      - copied unchanged from r1126484, cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/BulkLoader.java
      - copied unchanged from r1126484, cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/NEWS.txt
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java
    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/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/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
    cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TypeParser.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/UUIDType.java
    cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/OperationType.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutSession.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/marshal/UUIDTypeTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7:1026516-1125002
+/cassandra/branches/cassandra-0.7:1026516-1126483
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0:1125021-1125100
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0:1125021-1126293
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
 /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=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Mon May 23 13:30:48 2011
@@ -17,6 +17,7 @@
  * Improve forceDeserialize/getCompactedRow encapsulation (CASSANDRA-2659)
  * Assert ranges are not overlapping in AB.normalize (CASSANDRA-2641)
  * Don't write CounterUpdateColumn to disk in tests (CASSANDRA-2650)
+ * Add sstable bulk loading utility (CASSANDRA-1278)
 
 
 0.8.0-final
@@ -24,6 +25,7 @@
  * add ant generate-cql-html target (CASSANDRA-2526)
  * update CQL consistency levels (CASSANDRA-2566)
  * debian packaging fixes (CASSANDRA-2481, 2647)
+ * fix UUIDType, IntegerType for direct buffers (CASSANDRA-2682, 2684)
 
 
 0.8.0-rc1 
@@ -114,6 +116,7 @@
  * cli no longer divides read_repair_chance by 100 (CASSANDRA-2458)
  * made CompactionInfo.getTaskType return an enum (CASSANDRA-2482)
  * add a server-wide cap on measured memtable memory usage (CASSANDRA-2006)
+ * add unified UUIDType (CASSANDRA-2233)
 
 
 0.7.5

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Mon May 23 13:30:48 2011
@@ -17,6 +17,7 @@ Upgrading
       applications using these classes will need to be updated accordingly.
     - The loadbalance command has been removed from nodetool.  For similar
       behavior, decommission then rebootstrap with empty initial_token.
+    - Thrift unframed mode has been removed.
 
 Features
 --------

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
-/cassandra/branches/cassandra-0.7/contrib:1026516-1125002
+/cassandra/branches/cassandra-0.7/contrib:1026516-1126483
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/contrib:1125021-1125100
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/contrib:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java (original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/TypedColumn.java Mon May 23 13:30:48 2011
@@ -26,7 +26,7 @@ import org.apache.cassandra.thrift.Colum
 
 import java.nio.ByteBuffer;
 
-class TypedColumn
+public class TypedColumn
 {
     private final Column rawColumn;
 

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1125002
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1126483
 /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-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1125100
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
 /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 Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1125002
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1126483
 /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-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1125100
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
 /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

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1125002
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1126483
 /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-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1125100
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
 /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 Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1125002
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1126483
 /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-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1125100
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
 /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 Mon May 23 13:30:48 2011
@@ -1,8 +1,8 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1125002
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1126483
 /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-1125101,1126356,1126389,1126416
-/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1125100
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1126484
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1126293
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
 /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/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Mon May 23 13:30:48 2011
@@ -504,7 +504,7 @@ public class CliClient
         {
             try
             {
-                return FBUtilities.getComparator(compareWith);
+                return TypeParser.parse(compareWith);
             }
             catch (ConfigurationException ce)
             {

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java Mon May 23 13:30:48 2011
@@ -29,18 +29,13 @@ import org.apache.commons.lang.builder.H
 import org.apache.commons.lang.builder.ToStringBuilder;
 
 import org.apache.avro.util.Utf8;
-import org.apache.cassandra.cache.ConcurrentLinkedHashCache;
-import org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider;
 import org.apache.cassandra.cache.IRowCacheProvider;
+import org.apache.cassandra.db.marshal.*;
 import org.apache.cassandra.db.migration.avro.ColumnDef;
 import org.apache.cassandra.db.ColumnFamilyType;
 import org.apache.cassandra.db.HintedHandOffManager;
 import org.apache.cassandra.db.SystemTable;
 import org.apache.cassandra.db.Table;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.db.marshal.BytesType;
-import org.apache.cassandra.db.marshal.TimeUUIDType;
-import org.apache.cassandra.db.marshal.UTF8Type;
 import org.apache.cassandra.db.migration.Migration;
 import org.apache.cassandra.io.SerDeUtils;
 import org.apache.cassandra.thrift.InvalidRequestException;
@@ -360,11 +355,11 @@ public final class CFMetaData
 
         try
         {
-            comparator = DatabaseDescriptor.getComparator(cf.comparator_type.toString());
+            comparator = TypeParser.parse(cf.comparator_type.toString());
             if (cf.subcomparator_type != null)
-                subcolumnComparator = DatabaseDescriptor.getComparator(cf.subcomparator_type);
-            validator = DatabaseDescriptor.getComparator(cf.default_validation_class);
-            keyValidator = DatabaseDescriptor.getComparator(cf.key_validation_class);
+                subcolumnComparator = TypeParser.parse(cf.subcomparator_type);
+            validator = TypeParser.parse(cf.default_validation_class);
+            keyValidator = TypeParser.parse(cf.key_validation_class);
         }
         catch (Exception ex)
         {
@@ -645,8 +640,8 @@ public final class CFMetaData
         CFMetaData newCFMD = new CFMetaData(cf_def.keyspace,
                                             cf_def.name,
                                             cfType,
-                                            DatabaseDescriptor.getComparator(cf_def.comparator_type),
-                                            cf_def.subcomparator_type == null ? null : DatabaseDescriptor.getComparator(cf_def.subcomparator_type));
+                                            TypeParser.parse(cf_def.comparator_type),
+                                            cf_def.subcomparator_type == null ? null : TypeParser.parse(cf_def.subcomparator_type));
 
         if (cf_def.isSetGc_grace_seconds()) { newCFMD.gcGraceSeconds(cf_def.gc_grace_seconds); }
         if (cf_def.isSetMin_compaction_threshold()) { newCFMD.minCompactionThreshold(cf_def.min_compaction_threshold); }
@@ -659,15 +654,15 @@ public final class CFMetaData
         if (cf_def.isSetMerge_shards_chance()) { newCFMD.mergeShardsChance(cf_def.merge_shards_chance); }
         if (cf_def.isSetRow_cache_provider()) { newCFMD.rowCacheProvider(FBUtilities.newCacheProvider(cf_def.row_cache_provider)); }
         if (cf_def.isSetKey_alias()) { newCFMD.keyAlias(cf_def.key_alias); }
-        if (cf_def.isSetKey_validation_class()) { newCFMD.keyValidator(DatabaseDescriptor.getComparator(cf_def.key_validation_class)); }
+        if (cf_def.isSetKey_validation_class()) { newCFMD.keyValidator(TypeParser.parse(cf_def.key_validation_class)); }
 
         return newCFMD.comment(cf_def.comment)
                       .rowCacheSize(cf_def.row_cache_size)
                       .keyCacheSize(cf_def.key_cache_size)
                       .readRepairChance(cf_def.read_repair_chance)
                       .replicateOnWrite(cf_def.replicate_on_write)
-                      .defaultValidator(DatabaseDescriptor.getComparator(cf_def.default_validation_class))
-                      .keyValidator(DatabaseDescriptor.getComparator(cf_def.key_validation_class))
+                      .defaultValidator(TypeParser.parse(cf_def.default_validation_class))
+                      .keyValidator(TypeParser.parse(cf_def.key_validation_class))
                       .columnMetadata(ColumnDefinition.fromColumnDef(cf_def.column_metadata));
     }
 
@@ -683,7 +678,7 @@ public final class CFMetaData
             throw new ConfigurationException("names do not match.");
         if (!cf_def.column_type.toString().equals(cfType.name()))
             throw new ConfigurationException("types do not match.");
-        if (comparator != DatabaseDescriptor.getComparator(cf_def.comparator_type))
+        if (comparator != TypeParser.parse(cf_def.comparator_type))
             throw new ConfigurationException("comparators do not match.");
         if (cf_def.subcomparator_type == null || cf_def.subcomparator_type.equals(""))
         {
@@ -691,7 +686,7 @@ public final class CFMetaData
                 throw new ConfigurationException("subcolumncomparators do not match.");
             // else, it's null and we're good.
         }
-        else if (subcolumnComparator != DatabaseDescriptor.getComparator(cf_def.subcomparator_type))
+        else if (subcolumnComparator != TypeParser.parse(cf_def.subcomparator_type))
             throw new ConfigurationException("subcolumncomparators do not match.");
 
         validateMinMaxCompactionThresholds(cf_def);
@@ -704,8 +699,8 @@ public final class CFMetaData
         readRepairChance = cf_def.read_repair_chance;
         replicateOnWrite = cf_def.replicate_on_write;
         gcGraceSeconds = cf_def.gc_grace_seconds;
-        defaultValidator = DatabaseDescriptor.getComparator(cf_def.default_validation_class);
-        keyValidator = DatabaseDescriptor.getComparator(cf_def.key_validation_class);
+        defaultValidator = TypeParser.parse(cf_def.default_validation_class);
+        keyValidator = TypeParser.parse(cf_def.key_validation_class);
         minCompactionThreshold = cf_def.min_compaction_threshold;
         maxCompactionThreshold = cf_def.max_compaction_threshold;
         rowCacheSavePeriodInSeconds = cf_def.row_cache_save_period_in_seconds;
@@ -741,14 +736,14 @@ public final class CFMetaData
             ColumnDefinition oldDef = column_metadata.get(def.name);
             if (oldDef == null)
                 continue;
-            oldDef.setValidator(DatabaseDescriptor.getComparator(def.validation_class));
+            oldDef.setValidator(TypeParser.parse(def.validation_class));
             oldDef.setIndexType(def.index_type == null ? null : org.apache.cassandra.thrift.IndexType.valueOf(def.index_type.name()));
             oldDef.setIndexName(def.index_name == null ? null : def.index_name.toString());
         }
         // add the new ones coming in.
         for (org.apache.cassandra.db.migration.avro.ColumnDef def : toAdd)
         {
-            AbstractType dValidClass = DatabaseDescriptor.getComparator(def.validation_class);
+            AbstractType dValidClass = TypeParser.parse(def.validation_class);
             ColumnDefinition cd = new ColumnDefinition(def.name, 
                                                        dValidClass,
                                                        def.index_type == null ? null : org.apache.cassandra.thrift.IndexType.valueOf(def.index_type.toString()), 
@@ -972,7 +967,7 @@ public final class CFMetaData
 
     public static void validateAliasCompares(org.apache.cassandra.db.migration.avro.CfDef cf_def) throws ConfigurationException
     {
-        AbstractType comparator = DatabaseDescriptor.getComparator(cf_def.comparator_type);
+        AbstractType comparator = TypeParser.parse(cf_def.comparator_type);
         if (cf_def.key_alias != null)
             comparator.validate(cf_def.key_alias);
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java Mon May 23 13:30:48 2011
@@ -26,6 +26,7 @@ import java.util.*;
 
 import org.apache.avro.util.Utf8;
 import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.thrift.ColumnDef;
 import org.apache.cassandra.thrift.IndexType;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -93,7 +94,7 @@ public class ColumnDefinition
         String index_name = cd.index_name == null ? null : cd.index_name.toString();
         try
         {
-            AbstractType validatorType = DatabaseDescriptor.getComparator(cd.validation_class);
+            AbstractType validatorType = TypeParser.parse(cd.validation_class);
             return new ColumnDefinition(cd.name, validatorType, index_type, index_name);
         }
         catch (ConfigurationException e)
@@ -104,14 +105,14 @@ public class ColumnDefinition
 
     public static ColumnDefinition fromColumnDef(ColumnDef thriftColumnDef) throws ConfigurationException
     {
-        AbstractType validatorType = DatabaseDescriptor.getComparator(thriftColumnDef.validation_class);
+        AbstractType validatorType = TypeParser.parse(thriftColumnDef.validation_class);
         return new ColumnDefinition(ByteBufferUtil.clone(thriftColumnDef.name), validatorType, thriftColumnDef.index_type, thriftColumnDef.index_name);
     }
     
     public static ColumnDefinition fromColumnDef(org.apache.cassandra.db.migration.avro.ColumnDef avroColumnDef) throws ConfigurationException
     {
         validateIndexType(avroColumnDef);
-        AbstractType validatorType = DatabaseDescriptor.getComparator(avroColumnDef.validation_class);
+        AbstractType validatorType = TypeParser.parse(avroColumnDef.validation_class);
         return new ColumnDefinition(avroColumnDef.name,
                 validatorType,
                 IndexType.valueOf(avroColumnDef.index_type == null ? D_COLDEF_INDEXTYPE : avroColumnDef.index_type.name()),

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=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Mon May 23 13:30:48 2011
@@ -25,7 +25,6 @@ import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import com.google.common.base.Charsets;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,6 +38,7 @@ import org.apache.cassandra.db.ColumnFam
 import org.apache.cassandra.db.DefsTable;
 import org.apache.cassandra.db.Table;
 import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.db.migration.Migration;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.io.sstable.Descriptor;
@@ -46,7 +46,6 @@ import org.apache.cassandra.io.util.File
 import org.apache.cassandra.locator.*;
 import org.apache.cassandra.scheduler.IRequestScheduler;
 import org.apache.cassandra.scheduler.NoScheduler;
-import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
 import org.yaml.snakeyaml.Loader;
@@ -529,14 +528,6 @@ public class DatabaseDescriptor
         return conf.thrift_framed_transport_size_in_mb * 1024 * 1024;
     }
 
-    public static AbstractType getComparator(CharSequence compareWith) throws ConfigurationException
-    {
-        if (compareWith == null)
-            compareWith = "BytesType";
-
-        return FBUtilities.getComparator(compareWith.toString());
-    }
-
     /**
      * Creates all storage-related directories.
      * @throws IOException when a disk problem is encountered.

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java Mon May 23 13:30:48 2011
@@ -31,9 +31,9 @@ import java.util.Set;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.config.ConfigurationException;
-import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ColumnFamilyType;
 import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.thrift.InvalidRequestException;
 import org.apache.cassandra.utils.FBUtilities;
 
@@ -203,7 +203,7 @@ public class CreateColumnFamilyStatement
             {
                 ByteBuffer columnName = col.getKey().getByteBuffer(comparator);
                 String validatorClassName = comparators.containsKey(col.getValue()) ? comparators.get(col.getValue()) : col.getValue();
-                AbstractType<?> validator = DatabaseDescriptor.getComparator(validatorClassName);
+                AbstractType<?> validator = TypeParser.parse(validatorClassName);
                 columnDefs.put(columnName, new ColumnDefinition(columnName, validator, null, null));
             }
             catch (ConfigurationException e)
@@ -242,7 +242,7 @@ public class CreateColumnFamilyStatement
             String validatorString = (comparators.get(getPropertyString(KW_DEFAULTVALIDATION, "text")) != null)
                                      ? comparators.get(getPropertyString(KW_DEFAULTVALIDATION, "text"))
                                      : getPropertyString(KW_DEFAULTVALIDATION, "text");
-            AbstractType<?> comparator = DatabaseDescriptor.getComparator(comparatorString);
+            AbstractType<?> comparator = TypeParser.parse(comparatorString);
 
             newCFMD = new CFMetaData(keyspace,
                                      name,
@@ -256,7 +256,7 @@ public class CreateColumnFamilyStatement
                    .readRepairChance(getPropertyDouble(KW_READREPAIRCHANCE, CFMetaData.DEFAULT_READ_REPAIR_CHANCE))
                    .replicateOnWrite(getPropertyBoolean(KW_REPLICATEONWRITE, CFMetaData.DEFAULT_REPLICATE_ON_WRITE))
                    .gcGraceSeconds(getPropertyInt(KW_GCGRACESECONDS, CFMetaData.DEFAULT_GC_GRACE_SECONDS))
-                   .defaultValidator(DatabaseDescriptor.getComparator(validatorString))
+                   .defaultValidator(TypeParser.parse(validatorString))
                    .minCompactionThreshold(getPropertyInt(KW_MINCOMPACTIONTHRESHOLD, CFMetaData.DEFAULT_MIN_COMPACTION_THRESHOLD))
                    .maxCompactionThreshold(getPropertyInt(KW_MAXCOMPACTIONTHRESHOLD, CFMetaData.DEFAULT_MAX_COMPACTION_THRESHOLD))
                    .rowCacheSavePeriod(getPropertyInt(KW_ROWCACHESAVEPERIODSECS, CFMetaData.DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS))
@@ -266,7 +266,7 @@ public class CreateColumnFamilyStatement
                    .memOps(getPropertyDouble(KW_MEMTABLEOPSINMILLIONS, CFMetaData.DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS))
                    .mergeShardsChance(0.0)
                    .columnMetadata(getColumns(comparator))
-                   .keyValidator(DatabaseDescriptor.getComparator(comparators.get(getKeyType())))
+                   .keyValidator(TypeParser.parse(comparators.get(getKeyType())))
                    .rowCacheProvider(FBUtilities.newCacheProvider(getPropertyString(KW_ROW_CACHE_PROVIDER, CFMetaData.DEFAULT_ROW_CACHE_PROVIDER)));
         }
         catch (ConfigurationException e)

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java Mon May 23 13:30:48 2011
@@ -194,14 +194,14 @@ public class QueryProcessor
         }
 
         // if start key was set and relation was "greater than"
-        if (select.getKeyStart() != null && !select.includeStartKey())
+        if (select.getKeyStart() != null && !select.includeStartKey() && !rows.isEmpty())
         {
             if (rows.get(0).key.key.equals(startKey))
                 rows.remove(0);
         }
 
         // if finish key was set and relation was "less than"
-        if (select.getKeyFinish() != null && !select.includeFinishKey())
+        if (select.getKeyFinish() != null && !select.includeFinishKey() && !rows.isEmpty())
         {
             int lastIndex = rows.size() - 1;
             if (rows.get(lastIndex).key.key.equals(finishKey))

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java Mon May 23 13:30:48 2011
@@ -133,7 +133,7 @@ public final class IntegerType extends A
         if (bytes.remaining() == 0)
             return "empty";
 
-        return new java.math.BigInteger(TBaseHelper.byteBufferToByteArray(bytes)).toString(10);
+        return new java.math.BigInteger(ByteBufferUtil.getArray(bytes)).toString(10);
     }
     
     public String toString(BigInteger bi)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TypeParser.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TypeParser.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TypeParser.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TypeParser.java Mon May 23 13:30:48 2011
@@ -87,6 +87,11 @@ public class TypeParser
         return type;
     }
 
+    public static AbstractType parse(CharSequence compareWith) throws ConfigurationException
+    {
+        return parse(compareWith == null ? null : compareWith.toString());
+    }
+
     /**
      * Parse an AbstractType from current position of this parser.
      */

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/UUIDType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/UUIDType.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/UUIDType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/UUIDType.java Mon May 23 13:30:48 2011
@@ -25,11 +25,10 @@ import java.nio.ByteBuffer;
 import java.text.ParseException;
 import java.util.UUID;
 
-import org.apache.commons.lang.time.DateUtils;
-
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.UUIDGen;
+import org.apache.commons.lang.time.DateUtils;
 
 /**
  * Compares UUIDs using the following criteria:<br>
@@ -39,9 +38,7 @@ import org.apache.cassandra.utils.UUIDGe
  * - compare timestamps if both are time-based<br>
  * - compare lexically, unsigned msb-to-lsb comparison<br>
  * 
- * @author edanuff
  * @see "com.fasterxml.uuid.UUIDComparator"
- * 
  */
 public class UUIDType extends AbstractUUIDType
 {
@@ -65,25 +62,13 @@ public class UUIDType extends AbstractUU
             return 1;
         }
 
-        int s1 = b1.arrayOffset() + b1.position();
-        byte[] o1 = b1.array();
-
-        int s2 = b2.arrayOffset() + b2.position();
-        byte[] o2 = b2.array();
-
-        if (o1.length == s1)
-        {
-            return o2.length == s2 ? 0 : -1;
-        }
-        if (o2.length == s2)
-        {
-            return 1;
-        }
+        int s1 = b1.position();
+        int s2 = b2.position();
 
         // Compare versions
 
-        int v1 = (o1[s1 + 6] >> 4) & 0x0f;
-        int v2 = (o2[s2 + 6] >> 4) & 0x0f;
+        int v1 = (b1.get(s1 + 6) >> 4) & 0x0f;
+        int v2 = (b2.get(s2 + 6) >> 4) & 0x0f;
 
         if (v1 != v2)
         {
@@ -95,7 +80,7 @@ public class UUIDType extends AbstractUU
         if (v1 == 1)
         {
             // if both time-based, compare as timestamps
-            int c = compareTimestampBytes(s1, o1, s2, o2);
+            int c = compareTimestampBytes(b1, b2);
             if (c != 0)
             {
                 return c;
@@ -109,10 +94,9 @@ public class UUIDType extends AbstractUU
         // Appendix A - Sample Implementation.
         // Note: java.util.UUID.compareTo is not a lexical
         // comparison
-
         for (int i = 0; i < 16; i++)
         {
-            int c = ((o1[s1 + i]) & 0xFF) - ((o2[s2 + i]) & 0xFF);
+            int c = ((b1.get(s1 + i)) & 0xFF) - ((b2.get(s2 + i)) & 0xFF);
             if (c != 0)
             {
                 return c;
@@ -122,45 +106,54 @@ public class UUIDType extends AbstractUU
         return 0;
     }
 
-    private static int compareTimestampBytes(int s1, byte[] o1, int s2,
-            byte[] o2)
+    private static int compareTimestampBytes(ByteBuffer o1, ByteBuffer o2)
     {
-        int d = (o1[s1 + 6] & 0xF) - (o2[s2 + 6] & 0xF);
+        int o1Pos = o1.position();
+        int o2Pos = o2.position();
+
+        int d = (o1.get(o1Pos + 6) & 0xF) - (o2.get(o2Pos + 6) & 0xF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 7] & 0xFF) - (o2[s2 + 7] & 0xFF);
+
+        d = (o1.get(o1Pos + 7) & 0xFF) - (o2.get(o2Pos + 7) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 4] & 0xFF) - (o2[s2 + 4] & 0xFF);
+
+        d = (o1.get(o1Pos + 4) & 0xFF) - (o2.get(o2Pos + 4) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 5] & 0xFF) - (o2[s2 + 5] & 0xFF);
+
+        d = (o1.get(o1Pos + 5) & 0xFF) - (o2.get(o2Pos + 5) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 0] & 0xFF) - (o2[s2 + 0] & 0xFF);
+
+        d = (o1.get(o1Pos) & 0xFF) - (o2.get(o2Pos) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 1] & 0xFF) - (o2[s2 + 1] & 0xFF);
+
+        d = (o1.get(o1Pos + 1) & 0xFF) - (o2.get(o2Pos + 1) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        d = (o1[s1 + 2] & 0xFF) - (o2[s2 + 2] & 0xFF);
+
+        d = (o1.get(o1Pos + 2) & 0xFF) - (o2.get(o2Pos + 2) & 0xFF);
         if (d != 0)
         {
             return d;
         }
-        return (o1[s1 + 3] & 0xFF) - (o2[s2 + 3] & 0xFF);
+
+        return (o1.get(o1Pos + 3) & 0xFF) - (o2.get(o2Pos + 3) & 0xFF);
     }
 
     public UUID compose(ByteBuffer bytes)

Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java Mon May 23 13:30:48 2011
@@ -33,6 +33,7 @@ import org.apache.cassandra.auth.SimpleA
 import org.apache.cassandra.config.ConfigurationException;
 import org.apache.cassandra.db.IColumn;
 import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.thrift.*;
 import org.apache.cassandra.utils.FBUtilities;
@@ -198,8 +199,8 @@ public class ColumnFamilyRecordReader ex
                 int idx = cfnames.indexOf(cfName);
                 CfDef cf_def = ks_def.cf_defs.get(idx);
 
-                comparator = FBUtilities.getComparator(cf_def.comparator_type);
-                subComparator = cf_def.subcomparator_type == null ? null : FBUtilities.getComparator(cf_def.subcomparator_type);
+                comparator = TypeParser.parse(cf_def.comparator_type);
+                subComparator = cf_def.subcomparator_type == null ? null : TypeParser.parse(cf_def.subcomparator_type);
             }
             catch (ConfigurationException e)
             {

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java Mon May 23 13:30:48 2011
@@ -85,9 +85,10 @@ public abstract class SSTable
 
     protected SSTable(Descriptor descriptor, Set<Component> components, CFMetaData metadata, ReplayPosition replayPosition, IPartitioner partitioner, EstimatedHistogram rowSizes, EstimatedHistogram columnCounts)
     {
+        // In almost all cases, metadata shouldn't be null, but allowing null allows to create a mostly functional SSTable without
+        // full schema definition. SSTableLoader use that ability
         assert descriptor != null;
         assert components != null;
-        assert metadata != null;
         assert replayPosition != null;
         assert partitioner != null;
         assert rowSizes != null;

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java Mon May 23 13:30:48 2011
@@ -150,6 +150,9 @@ public class SSTableReader extends SSTab
     public static SSTableReader open(Descriptor descriptor, Set<Component> components, Set<DecoratedKey> savedKeys, DataTracker tracker, CFMetaData metadata, IPartitioner partitioner) throws IOException
     {
         assert partitioner != null;
+        // Minimum components without which we can't do anything
+        assert components.contains(Component.DATA);
+        assert components.contains(Component.PRIMARY_INDEX);
 
         long start = System.currentTimeMillis();
         logger.info("Opening " + descriptor);
@@ -158,7 +161,7 @@ public class SSTableReader extends SSTab
         EstimatedHistogram columnCounts;
         File statsFile = new File(descriptor.filenameFor(SSTable.COMPONENT_STATS));
         ReplayPosition rp = ReplayPosition.NONE;
-        if (statsFile.exists())
+        if (components.contains(Component.STATS) && statsFile.exists())
         {
             DataInputStream dis = null;
             try
@@ -249,6 +252,12 @@ public class SSTableReader extends SSTab
 
     void loadBloomFilter() throws IOException
     {
+        if (!components.contains(Component.FILTER))
+        {
+            bf = BloomFilter.emptyFilter();
+            return;
+        }
+
         DataInputStream stream = null;
         try
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java Mon May 23 13:30:48 2011
@@ -62,7 +62,7 @@ public class RangeSliceResponseResolver 
         return reply.rows;
     }
 
-    // Note: this deserializes the response a 2nd time if getData was called first
+    // Note: this would deserialize the response a 2nd time if getData was called first.
     // (this is not currently an issue since we don't do read repair for range queries.)
     public Iterable<Row> resolve() throws IOException
     {
@@ -73,7 +73,7 @@ public class RangeSliceResponseResolver 
                 return o1.left.key.compareTo(o2.left.key);
             }
         });
-        
+
         int n = 0;
         for (Message response : responses)
         {
@@ -83,7 +83,6 @@ public class RangeSliceResponseResolver 
         }
 
         // for each row, compute the combination of all different versions seen, and repair incomplete versions
-
         return new ReducingIterator<Pair<Row,InetAddress>, Row>(collator)
         {
             List<ColumnFamily> versions = new ArrayList<ColumnFamily>(sources.size());

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon May 23 13:30:48 2011
@@ -18,6 +18,7 @@
 
 package org.apache.cassandra.service;
 
+import java.io.File;
 import java.io.IOError;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
@@ -50,6 +51,7 @@ import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.gms.*;
 import org.apache.cassandra.io.DeletionService;
+import org.apache.cassandra.io.sstable.SSTableLoader;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.locator.DynamicEndpointSnitch;
@@ -327,6 +329,8 @@ public class StorageService implements I
         Gossiper.instance.unregister(this);
         Gossiper.instance.stop();
         MessagingService.instance().shutdown();
+        // give it a second so that task accepted before the MessagingService shutdown gets submitted to the stage (to avoid RejectedExecutionException)
+        try { Thread.sleep(1000L); } catch (InterruptedException e) {}
         StageManager.shutdownNow();
     }
     
@@ -354,7 +358,7 @@ public class StorageService implements I
         // sleep a while to allow gossip to warm up (the other nodes need to know about this one before they can reply).
         try
         {
-            Thread.sleep(5000L);
+            Thread.sleep(RING_DELAY);
         }
         catch (Exception ex)
         {
@@ -2428,4 +2432,37 @@ public class StorageService implements I
         return new Pair<Set<Range>, Set<Range>>(toStream, toFetch);
     }
 
+    public void bulkLoad(String directory)
+    {
+        File dir = new File(directory);
+
+        if (!dir.exists() || !dir.isDirectory())
+            throw new IllegalArgumentException("Invalid directory " + directory);
+
+        SSTableLoader.Client client = new SSTableLoader.Client()
+        {
+            public void init() {}
+
+            public boolean validateColumnFamily(String keyspace, String cfName)
+            {
+                return DatabaseDescriptor.getCFMetaData(keyspace, cfName) != null;
+            }
+        };
+
+        SSTableLoader.OutputHandler oh = new SSTableLoader.OutputHandler()
+        {
+            public void output(String msg) { logger_.info(msg); }
+            public void debug(String msg) { logger_.debug(msg); }
+        };
+
+        SSTableLoader loader = new SSTableLoader(dir, client, oh);
+        try
+        {
+            loader.stream().get();
+        }
+        catch (Exception e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java Mon May 23 13:30:48 2011
@@ -290,4 +290,6 @@ public interface StorageServiceMBean
     public boolean isJoined();
 
     public void setCompactionThroughputMbPerSec(int value);
+
+    public void bulkLoad(String directory);
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/OperationType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/OperationType.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/OperationType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/OperationType.java Mon May 23 13:30:48 2011
@@ -26,6 +26,7 @@ public enum OperationType
     AES,
     BOOTSTRAP,
     UNBOOTSTRAP,
-    RESTORE_REPLICA_COUNT;
+    RESTORE_REPLICA_COUNT,
+    BULK_LOAD;
 }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutSession.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutSession.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutSession.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutSession.java Mon May 23 13:30:48 2011
@@ -134,7 +134,7 @@ public class StreamOutSession
             Thread.sleep(10);
     }
 
-    Collection<PendingFile> getFiles()
+    public Collection<PendingFile> getFiles()
     {
         return files.values();
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java Mon May 23 13:30:48 2011
@@ -28,6 +28,7 @@ import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.AsciiType;
 import org.apache.cassandra.db.marshal.MarshalException;
+import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.RandomPartitioner;
 import org.apache.cassandra.dht.Token;
@@ -536,9 +537,9 @@ public class ThriftValidation
             if (cfType == null)
                 throw new InvalidRequestException("invalid column type " + cf_def.column_type);
 
-            DatabaseDescriptor.getComparator(cf_def.comparator_type);
-            DatabaseDescriptor.getComparator(cf_def.subcomparator_type);
-            DatabaseDescriptor.getComparator(cf_def.default_validation_class);
+            TypeParser.parse(cf_def.comparator_type);
+            TypeParser.parse(cf_def.subcomparator_type);
+            TypeParser.parse(cf_def.default_validation_class);
             if (cfType != ColumnFamilyType.Super && cf_def.subcomparator_type != null)
                 throw new InvalidRequestException("subcomparator_type is invalid for standard columns");
 
@@ -546,8 +547,8 @@ public class ThriftValidation
                 return;
 
             AbstractType comparator = cfType == ColumnFamilyType.Standard
-                                    ? DatabaseDescriptor.getComparator(cf_def.comparator_type)
-                                    : DatabaseDescriptor.getComparator(cf_def.subcomparator_type);
+                                    ? TypeParser.parse(cf_def.comparator_type)
+                                    : TypeParser.parse(cf_def.subcomparator_type);
 
             Set<String> indexNames = new HashSet<String>();
             for (ColumnDef c : cf_def.column_metadata)
@@ -558,7 +559,7 @@ public class ThriftValidation
                     throw new InvalidRequestException("Duplicate index names " + idxName);
                 indexNames.add(idxName);
 
-                DatabaseDescriptor.getComparator(c.validation_class);
+                TypeParser.parse(c.validation_class);
 
                 try
                 {

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=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java Mon May 23 13:30:48 2011
@@ -41,6 +41,11 @@ public class BloomFilter extends Filter
         bitset = bs;
     }
 
+    public static BloomFilter emptyFilter()
+    {
+        return new BloomFilter(0, bucketsFor(0, 0));
+    }
+
     public static ICompactSerializer2<BloomFilter> serializer()
     {
         return serializer_;

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Mon May 23 13:30:48 2011
@@ -522,11 +522,6 @@ public class FBUtilities
         return FBUtilities.construct(partitionerClassName, "partitioner");
     }
 
-    public static AbstractType getComparator(String compareWith) throws ConfigurationException
-    {
-        return TypeParser.parse(compareWith);
-    }
-
     /**
      * @return The Class for the given name.
      * @param classname Fully qualified classname.

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/marshal/UUIDTypeTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/marshal/UUIDTypeTest.java?rev=1126485&r1=1126484&r2=1126485&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/marshal/UUIDTypeTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/marshal/UUIDTypeTest.java Mon May 23 13:30:48 2011
@@ -1,4 +1,5 @@
 package org.apache.cassandra.db.marshal;
+
 /*
  * 
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -20,7 +21,6 @@ package org.apache.cassandra.db.marshal;
  * 
  */
 
-
 import static org.junit.Assert.assertEquals;
 
 import java.net.InetAddress;
@@ -30,6 +30,7 @@ import java.util.Arrays;
 import java.util.Random;
 import java.util.UUID;
 
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.UUIDGen;
 import org.apache.log4j.Logger;
 import org.junit.Test;
@@ -48,6 +49,9 @@ public class UUIDTypeTest
         UUID t1 = newTimeBasedUUID();
         UUID t2 = newTimeBasedUUID();
 
+        testCompare(null, t2, -1);
+        testCompare(t1, null, 1);
+
         testCompare(t1, t2, -1);
         testCompare(t1, t1, 0);
         testCompare(t2, t2, 0);
@@ -110,8 +114,8 @@ public class UUIDTypeTest
 
     public String describeCompare(UUID u1, UUID u2, int c)
     {
-        String tb1 = (u1.version() == 1) ? "time-based " : "random ";
-        String tb2 = (u2.version() == 1) ? "time-based " : "random ";
+        String tb1 = (u1 == null) ? "null" : (u1.version() == 1) ? "time-based " : "random ";
+        String tb2 = (u2 == null) ? "null" : (u2.version() == 1) ? "time-based " : "random ";
         String comp = (c < 0) ? " < " : ((c == 0) ? " = " : " > ");
         return tb1 + u1 + comp + tb2 + u2;
     }
@@ -131,6 +135,9 @@ public class UUIDTypeTest
 
     public static ByteBuffer bytebuffer(UUID uuid)
     {
+        if (uuid == null)
+            return ByteBufferUtil.EMPTY_BYTE_BUFFER;
+
         long msb = uuid.getMostSignificantBits();
         long lsb = uuid.getLeastSignificantBits();
         byte[] bytes = new byte[16];
@@ -149,29 +156,23 @@ public class UUIDTypeTest
 
     public void logJdkUUIDCompareToVariance(UUID u1, UUID u2, int expC)
     {
+        if ((u1 == null) || (u2 == null))
+            return;
         if (u1.version() != u2.version())
-        {
             return;
-        }
         if (u1.version() == 1)
-        {
             return;
-        }
         if (u1.compareTo(u2) != expC)
-        {
             logger.info("*** Note: java.util.UUID.compareTo() would have compared this differently");
-        }
-
     }
 
     public void testCompare(UUID u1, UUID u2, int expC)
     {
         int c = sign(uuidType.compare(bytebuffer(u1), bytebuffer(u2)));
         expC = sign(expC);
-        assertEquals("Expected " + describeCompare(u1, u2, expC) + ", got "
-                + describeCompare(u1, u2, c), expC, c);
+        assertEquals("Expected " + describeCompare(u1, u2, expC) + ", got " + describeCompare(u1, u2, c), expC, c);
 
-        if (u1.version() == 1 && u2.version() == 1)
+        if (((u1 != null) && (u1.version() == 1)) && ((u2 != null) && (u2.version() == 1)))
             assertEquals(c, sign(TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2))));
 
         logJdkUUIDCompareToVariance(u1, u2, c);



Mime
View raw message