cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1182654 [1/3] - in /cassandra/trunk: ./ contrib/ contrib/pig/src/java/org/apache/cassandra/hadoop/pig/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cache/ src/java/org/apache/cassandra/cli/ src/java/...
Date Thu, 13 Oct 2011 05:14:08 GMT
Author: jbellis
Date: Thu Oct 13 05:14:05 2011
New Revision: 1182654

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

Added:
    cassandra/trunk/src/java/org/apache/cassandra/io/ISerializer.java
      - copied unchanged from r1182653, cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/io/IVersionedSerializer.java
      - copied unchanged from r1182653, cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java
Removed:
    cassandra/trunk/src/java/org/apache/cassandra/io/ICompactSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/io/ICompactSerializer2.java
    cassandra/trunk/src/java/org/apache/cassandra/io/ICompactSerializer3.java
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.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/cache/SerializingCache.java
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
    cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java
    cassandra/trunk/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java
    cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ReadResponse.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Row.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java
    cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java
    cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java
    cassandra/trunk/src/java/org/apache/cassandra/dht/AbstractBounds.java
    cassandra/trunk/src/java/org/apache/cassandra/dht/Token.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigest.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/HeartBeatState.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/VersionedValue.java
    cassandra/trunk/src/java/org/apache/cassandra/io/IColumnSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/io/SerDeUtils.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/trunk/src/java/org/apache/cassandra/net/CompactEndpointSerializationHelper.java
    cassandra/trunk/src/java/org/apache/cassandra/net/Header.java
    cassandra/trunk/src/java/org/apache/cassandra/net/Message.java
    cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/PendingFile.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamHeader.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamReply.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamRequestMessage.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamingRepairTask.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/EstimatedHistogram.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/UUIDGen.java
    cassandra/trunk/test/unit/org/apache/cassandra/gms/GossipDigestTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/io/CompactSerializerTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/net/MessageSerializer.java
    cassandra/trunk/test/unit/org/apache/cassandra/service/LeaveAndBootstrapTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/utils/SerializationsTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:14:05 2011
@@ -1,10 +1,10 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1182422
 /cassandra/branches/cassandra-0.8.0:1125021-1130369
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
-/cassandra/branches/cassandra-1.0:1167085-1181095,1181748
+/cassandra/branches/cassandra-1.0:1167085-1182653
 /cassandra/branches/cassandra-1.0.0:1167104-1167229,1167232-1181093,1181741
 /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=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Thu Oct 13 05:14:05 2011
@@ -1,9 +1,17 @@
+1.1-dev
+ * off-heap cache to use sun.misc.Unsafe instead of JNA (CASSANDRA-3271)
+
+
 1.0.1
  * describe_ring should include datacenter/topology information (CASSANDRA-2882)
  * Thrift sockets are not properly buffered (CASSANDRA-3261)
  * performance improvement for bytebufferutil compare function (CASSANDRA-3286)
  * add system.versions ColumnFamily (CASSANDRA-3140)
- * off-heap cache to use sun.misc.Unsafe instead of JNA (CASSANDRA-3271)
+ * (CQL) update grammar to require key clause in DELETE statement
+   (CASSANDRA-3349)
+ * (CQL) allow numeric keyspace names in USE statement (CASSANDRA-3350)
+ * reduce network copies (CASSANDRA-3333)
+
 
 1.0.0-final
  * close scrubbed sstable fd before deleting it (CASSANDRA-3318)
@@ -24,7 +32,6 @@
 Fixes merged from 0.8 below:
  * Fix tool .bat files when CASSANDRA_HOME contains spaces (CASSANDRA-3258)
  * Force flush of status table when removing/updating token (CASSANDRA-3243)
- * Evict gossip state immediately when a token is taken over by a new IP (CASSANDRA-3259)
  * Fix bug where the failure detector can take too long to mark a host
    down (CASSANDRA-3273)
  * (Hadoop) allow wrapping ranges in queries (CASSANDRA-3137)
@@ -35,6 +42,12 @@ Fixes merged from 0.8 below:
  * Nodetool no longer leaks threads and closes JMX connections (CASSANDRA-3309)
  * fix truncate allowing data to be replayed post-restart (CASSANDRA-3297)
  * Move SimpleAuthority and SimpleAuthenticator to examples (CASSANDRA-2922)
+ * Fix exception during PIG 'dump' (CASSANDRA-2810)
+ * Fix transposition in cfHistograms (CASSANDRA-3222)
+ * Allow using number as DC name when creating keyspace in CQL (CASSANDRA-3239)
+ * Force flush of system table after updating/removing a token (CASSANDRA-3243)
+ * Make Pig storage handle implements LoadMetadata (CASSANDRA-2777)
+ * Improved CLI exceptions (CASSANDRA-3312)
 
 
 1.0.0-rc2
@@ -47,6 +60,7 @@ Fixes merged from 0.8 below:
    contains non-hex characters (CASSANDRA-3231)
  * Keep SimpleSnitch proximity ordering unchanged from what the Strategy
    generates, as intended (CASSANDRA-3262)
+ * remove Scrub from compactionstats when finished (CASSANDRA-3255)
  * fix counter entry in jdbc TypesMap (CASSANDRA-3268)
  * fix full queue scenario for ParallelCompactionIterator (CASSANDRA-3270)
  * fix bootstrap process (CASSANDRA-3285)
@@ -55,7 +69,8 @@ Fixes merged from 0.8 below:
  * ignore any CF ids sent by client for adding CF/KS (CASSANDRA-3288)
  * remove obsolete hints on first startup (CASSANDRA-3291)
  * use correct ISortedColumns for time-optimized reads (CASSANDRA-3289)
- * Evict gossip state immediately when a token is taken over by a new IP (CASSANDRA-3259)
+ * Evict gossip state immediately when a token is taken over by a new IP 
+   (CASSANDRA-3259)
 
 
 1.0.0-rc1

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:14:05 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-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/contrib:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/contrib:1167104-1167229,1167232-1181093,1181741
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020

Modified: cassandra/trunk/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java (original)
+++ cassandra/trunk/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java Thu Oct 13 05:14:05 2011
@@ -26,7 +26,7 @@ import org.apache.cassandra.db.marshal.B
 import org.apache.cassandra.db.marshal.IntegerType;
 import org.apache.cassandra.db.marshal.TypeParser;
 import org.apache.cassandra.thrift.*;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.Hex;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -601,7 +601,7 @@ public class CassandraStorage extends Lo
         TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
         try
         {
-            return FBUtilities.bytesToHex(serializer.serialize(cfDef));
+            return Hex.bytesToHex(serializer.serialize(cfDef));
         }
         catch (TException e)
         {
@@ -616,7 +616,7 @@ public class CassandraStorage extends Lo
         CfDef cfDef = new CfDef();
         try
         {
-            deserializer.deserialize(cfDef, FBUtilities.hexToBytes(st));
+            deserializer.deserialize(cfDef, Hex.hexToBytes(st));
         }
         catch (TException e)
         {

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:14:05 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-1170333,1172024
 /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-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1167229,1167232-1181093,1181741
 /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 13 05:14:05 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-1170333,1172024
 /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-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1167229,1167232-1181093,1181741
 /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 Thu Oct 13 05:14:05 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-1170333,1172024
 /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-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1167229,1167232-1181093,1181741
 /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 13 05:14:05 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-1170333,1172024
 /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-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1167229,1167232-1181093,1181741
 /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 13 05:14:05 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-1170333,1172024
 /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-1178554,1178785,1178957,1179359,1179364,1180958
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1182422
 /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-1181095,1181748
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1182653
 /cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1167229,1167232-1181093,1181741
 /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/cache/SerializingCache.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cache/SerializingCache.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cache/SerializingCache.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cache/SerializingCache.java Thu Oct 13 05:14:05 2011
@@ -30,7 +30,7 @@ import com.googlecode.concurrentlinkedha
 import com.googlecode.concurrentlinkedhashmap.EvictionListener;
 import com.googlecode.concurrentlinkedhashmap.Weighers;
 
-import org.apache.cassandra.io.ICompactSerializer3;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.io.util.MemoryInputStream;
 import org.apache.cassandra.io.util.MemoryOutputStream;
 import org.slf4j.Logger;
@@ -45,9 +45,9 @@ public class SerializingCache<K, V> impl
     private static final int DEFAULT_CONCURENCY_LEVEL = 64;
     
     private final ConcurrentLinkedHashMap<K, FreeableMemory> map;
-    private final ICompactSerializer3<V> serializer;
+    private final ISerializer<V> serializer;
 
-    public SerializingCache(int capacity, ICompactSerializer3<V> serializer, String tableName, String cfName)
+    public SerializingCache(int capacity, ISerializer<V> serializer, String tableName, String cfName)
     {
         this.serializer = serializer;
 

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=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Thu Oct 13 05:14:05 2011
@@ -297,9 +297,7 @@ public class CliClient
         }
         catch (SchemaDisagreementException e)
         {
-        	RuntimeException rtEx = new RuntimeException("schema does not match across nodes, (try again later).");
-            rtEx.initCause(e);
-            throw new RuntimeException();
+        	throw new RuntimeException("schema does not match across nodes, (try again later).", e);
         }
     }
 
@@ -542,7 +540,7 @@ public class CliClient
             {
                 StringBuilder errorMessage = new StringBuilder("Unknown comparator '" + compareWith + "'. ");
                 errorMessage.append("Available functions: ");
-                throw new RuntimeException(errorMessage.append(Function.getFunctionNames()).toString());
+                throw new RuntimeException(errorMessage.append(Function.getFunctionNames()).toString(), e);
             }
         }
 
@@ -768,7 +766,7 @@ public class CliClient
             }
             catch (Exception e)
             {
-                throw new RuntimeException(e.getMessage());
+                throw new RuntimeException(e);
             }
         }
 
@@ -797,11 +795,11 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+            throw new RuntimeException(e);
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage());
+            throw new RuntimeException(e);
         }
     }
 
@@ -884,7 +882,7 @@ public class CliClient
             }
             catch (Exception e)
             {
-                throw new RuntimeException(e.getMessage());
+                throw new RuntimeException(e);
             }
         }
 
@@ -951,7 +949,7 @@ public class CliClient
             }
             catch (Exception e)
             {
-                throw new RuntimeException(e.getMessage());
+                throw new RuntimeException(e);
             }
         }
 
@@ -994,11 +992,11 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+            throw new RuntimeException(e);
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage(), e);
+            throw new RuntimeException(e);
         }
     }
 
@@ -1024,11 +1022,11 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+            throw new RuntimeException(e);
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage(), e);
+            throw new RuntimeException(e);
         }
     }
 
@@ -1055,11 +1053,11 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+            throw new RuntimeException(e);
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage(), e);
+            throw new RuntimeException(e);
         }
     }
 
@@ -1089,11 +1087,11 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+            throw new RuntimeException(e);
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage(), e);
+            throw new RuntimeException(e);
         }
     }
 
@@ -1153,7 +1151,7 @@ public class CliClient
                 }
                 catch (UnknownHostException e)
                 {
-                    throw new RuntimeException(e.getMessage());
+                    throw new RuntimeException(e);
                 }
 
                 ksDef.setStrategy_options(options);
@@ -2244,7 +2242,7 @@ public class CliClient
             }
             catch (TException e)
             {
-                throw new RuntimeException(e.getMessage(), e);
+                throw new RuntimeException(e);
             }
 
             columnDefinitions.add(columnDefinition);
@@ -2275,7 +2273,7 @@ public class CliClient
             }
             catch (IllegalArgumentException ie)
             {
-                throw new RuntimeException("IndexType '" + indexTypeAsString + "' is unsupported.");
+                throw new RuntimeException("IndexType '" + indexTypeAsString + "' is unsupported.", ie);
             }
         }
 
@@ -2304,7 +2302,7 @@ public class CliClient
         }
         catch (MarshalException e)
         {
-            throw new RuntimeException(e.toString());
+            throw new RuntimeException(e);
         }
     }
     
@@ -2419,7 +2417,7 @@ public class CliClient
                 }
                 catch (Exception e)
                 {
-                    throw new RuntimeException(e.getMessage(), e);
+                    throw new RuntimeException(e);
                 }
             }
         }
@@ -2560,7 +2558,7 @@ public class CliClient
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage());
+            throw new RuntimeException(e);
         }
     }
 
@@ -2581,7 +2579,7 @@ public class CliClient
         {
             StringBuilder errorMessage = new StringBuilder("Function '" + functionName + "' not found. ");
             errorMessage.append("Available functions: ");
-            throw new RuntimeException(errorMessage.append(Function.getFunctionNames()).toString());
+            throw new RuntimeException(errorMessage.append(Function.getFunctionNames()).toString(), e);
         }
 
         return function.getValidator();

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g Thu Oct 13 05:14:05 2011
@@ -121,7 +121,7 @@ query returns [CQLStatement stmnt]
 
 // USE <KEYSPACE>;
 useStatement returns [String keyspace]
-    : K_USE IDENT { $keyspace = $IDENT.text; } endStmnt
+    : K_USE name=( IDENT | INTEGER | STRING_LITERAL ) { $keyspace = $name.text; } endStmnt
     ;
 
 /**
@@ -334,7 +334,7 @@ deleteStatement returns [DeleteStatement
           ( cols=termList { columnsList = $cols.items; })?
           K_FROM columnFamily=( IDENT | STRING_LITERAL | INTEGER )
           ( usingClauseDelete[attrs] )?
-          K_WHERE ( key_alias=term ('=' key=term           { keyList = Collections.singletonList(key); }
+          ( K_WHERE key_alias=term ('=' key=term           { keyList = Collections.singletonList(key); }
                                    | K_IN '(' keys=termList { keyList = $keys.items; } ')')
                   )?
       {

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=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/QueryProcessor.java Thu Oct 13 05:14:05 2011
@@ -34,6 +34,7 @@ import org.apache.cassandra.auth.Permiss
 import org.apache.cassandra.concurrent.Stage;
 import org.apache.cassandra.concurrent.StageManager;
 import org.apache.cassandra.config.*;
+import org.apache.cassandra.cli.CliUtils;
 import org.apache.cassandra.db.CounterColumn;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.context.CounterContext;
@@ -687,7 +688,7 @@ public class QueryProcessor
                 return result;
                 
             case USE:
-                clientState.setKeyspace((String)statement.statement);
+                clientState.setKeyspace(CliUtils.unescapeSQLString((String) statement.statement));
                 result.type = CqlResultType.VOID;
                 
                 return result;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/AbstractColumnContainer.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/AbstractColumnContainer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/AbstractColumnContainer.java Thu Oct 13 05:14:05 2011
@@ -33,7 +33,6 @@ import org.apache.cassandra.config.CFMet
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.io.ICompactSerializer2;
 import org.apache.cassandra.io.util.IIterableColumns;
 import org.apache.cassandra.utils.Allocator;
 import org.apache.cassandra.utils.FBUtilities;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java Thu Oct 13 05:14:05 2011
@@ -32,10 +32,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.CFMetaData;
-import org.apache.cassandra.io.ICompactSerializer3;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.io.sstable.SSTableMetadata;
 
-public class ColumnFamilySerializer implements ICompactSerializer3<ColumnFamily>
+public class ColumnFamilySerializer implements ISerializer<ColumnFamily>
 {
     private static final Logger logger = LoggerFactory.getLogger(ColumnFamilySerializer.class);
 
@@ -153,7 +153,7 @@ public class ColumnFamilySerializer impl
 
     public long serializedSize(ColumnFamily cf)
     {
-        return cf.serializedSize();
+        return cf == null ? DBConstants.boolSize : cf.serializedSize();
     }
 
     /**

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java Thu Oct 13 05:14:05 2011
@@ -116,6 +116,11 @@ public class ColumnSerializer implements
         }
     }
 
+    public long serializedSize(IColumn object)
+    {
+        return object.serializedSize();
+    }
+
     private static class CorruptColumnException extends IOException
     {
         public CorruptColumnException(String s)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java Thu Oct 13 05:14:05 2011
@@ -18,14 +18,9 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.lang.ThreadLocal;
+import java.io.*;
 import java.nio.ByteBuffer;
-import java.net.InetAddress;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
 import java.util.LinkedList;
 
@@ -33,13 +28,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.db.filter.QueryPath;
-import org.apache.cassandra.db.marshal.AbstractCommutativeType;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.io.ICompactSerializer;
-import org.apache.cassandra.io.util.FastByteArrayOutputStream;
+import org.apache.cassandra.io.IVersionedSerializer;
+import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.Allocator;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.HeapAllocator;
 import org.apache.cassandra.utils.FBUtilities;
@@ -192,10 +184,8 @@ public class CounterMutation implements 
 
     public Message makeMutationMessage(int version) throws IOException
     {
-        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
-        DataOutputStream dos = new DataOutputStream(bos);
-        serializer().serialize(this, dos, version);
-        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.COUNTER_MUTATION, bos.toByteArray(), version);
+        byte[] bytes = FBUtilities.serialize(this, serializer, version);
+        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.COUNTER_MUTATION, bytes, version);
     }
 
     public boolean shouldReplicateOnWrite()
@@ -240,18 +230,24 @@ public class CounterMutation implements 
     }
 }
 
-class CounterMutationSerializer implements ICompactSerializer<CounterMutation>
+class CounterMutationSerializer implements IVersionedSerializer<CounterMutation>
 {
-    public void serialize(CounterMutation cm, DataOutputStream dos, int version) throws IOException
+    public void serialize(CounterMutation cm, DataOutput dos, int version) throws IOException
     {
         RowMutation.serializer().serialize(cm.rowMutation(), dos, version);
         dos.writeUTF(cm.consistency().name());
     }
 
-    public CounterMutation deserialize(DataInputStream dis, int version) throws IOException
+    public CounterMutation deserialize(DataInput dis, int version) throws IOException
     {
         RowMutation rm = RowMutation.serializer().deserialize(dis, version);
         ConsistencyLevel consistency = Enum.valueOf(ConsistencyLevel.class, dis.readUTF());
         return new CounterMutation(rm, consistency);
     }
+
+    public long serializedSize(CounterMutation cm, int version)
+    {
+        return RowMutation.serializer().serializedSize(cm.rowMutation(), version)
+               + DBConstants.shortSize + FBUtilities.encodedUTF8Length(cm.consistency().name());
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java Thu Oct 13 05:14:05 2011
@@ -23,7 +23,7 @@ import java.io.*;
 import java.util.Arrays;
 
 import org.apache.cassandra.dht.AbstractBounds;
-import org.apache.cassandra.io.ICompactSerializer2;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.io.util.FastByteArrayInputStream;
 import org.apache.cassandra.net.Message;
@@ -80,7 +80,7 @@ public class IndexScanCommand implements
         return serializer.deserialize(new DataInputStream(bis));
     }
 
-    private static class IndexScanCommandSerializer implements ICompactSerializer2<IndexScanCommand>
+    private static class IndexScanCommandSerializer implements ISerializer<IndexScanCommand>
     {
         public void serialize(IndexScanCommand o, DataOutput out) throws IOException
         {
@@ -106,5 +106,10 @@ public class IndexScanCommand implements
 
             return new IndexScanCommand(keyspace, columnFamily, indexClause, predicate, range);
         }
+
+        public long serializedSize(IndexScanCommand object)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java Thu Oct 13 05:14:05 2011
@@ -36,14 +36,12 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 
 import org.apache.cassandra.dht.AbstractBounds;
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.io.util.FastByteArrayInputStream;
 import org.apache.cassandra.net.Message;
@@ -122,9 +120,9 @@ public class RangeSliceCommand implement
     }
 }
 
-class RangeSliceCommandSerializer implements ICompactSerializer<RangeSliceCommand>
+class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceCommand>
 {
-    public void serialize(RangeSliceCommand sliceCommand, DataOutputStream dos, int version) throws IOException
+    public void serialize(RangeSliceCommand sliceCommand, DataOutput dos, int version) throws IOException
     {
         dos.writeUTF(sliceCommand.keyspace);
         dos.writeUTF(sliceCommand.column_family);
@@ -139,7 +137,7 @@ class RangeSliceCommandSerializer implem
         dos.writeInt(sliceCommand.max_keys);
     }
 
-    public RangeSliceCommand deserialize(DataInputStream dis, int version) throws IOException
+    public RangeSliceCommand deserialize(DataInput dis, int version) throws IOException
     {
         String keyspace = dis.readUTF();
         String column_family = dis.readUTF();
@@ -147,7 +145,11 @@ class RangeSliceCommandSerializer implem
         int scLength = dis.readInt();
         ByteBuffer super_column = null;
         if (scLength > 0)
-            super_column = ByteBuffer.wrap(readBuf(scLength, dis));
+        {
+            byte[] buf = new byte[scLength];
+            dis.readFully(buf);
+            super_column = ByteBuffer.wrap(buf);
+        }
 
         TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
         SlicePredicate pred = new SlicePredicate();
@@ -158,12 +160,8 @@ class RangeSliceCommandSerializer implem
         return new RangeSliceCommand(keyspace, column_family, super_column, pred, range, max_keys);
     }
 
-    static byte[] readBuf(int len, DataInputStream dis) throws IOException
+    public long serializedSize(RangeSliceCommand rangeSliceCommand, int version)
     {
-        byte[] buf = new byte[len];
-        int read = 0;
-        while (read < len)
-            read = dis.read(buf, read, len - read);
-        return buf;
+        throw new UnsupportedOperationException();
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java Thu Oct 13 05:14:05 2011
@@ -21,7 +21,6 @@ package org.apache.cassandra.db;
 import java.io.DataInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
@@ -42,14 +41,16 @@ public class RangeSliceReply
 
     public Message getReply(Message originalMessage) throws IOException
     {
-        DataOutputBuffer dob = new DataOutputBuffer();
-        dob.writeInt(rows.size());
+        int size = DBConstants.intSize;
         for (Row row : rows)
-        {
-            Row.serializer().serialize(row, dob, originalMessage.getVersion());
-        }
-        byte[] data = Arrays.copyOf(dob.getData(), dob.getLength());
-        return originalMessage.getReply(FBUtilities.getBroadcastAddress(), data, originalMessage.getVersion());
+            size += Row.serializer().serializedSize(row, originalMessage.getVersion());
+
+        DataOutputBuffer buffer = new DataOutputBuffer(size);
+        buffer.writeInt(rows.size());
+        for (Row row : rows)
+            Row.serializer().serialize(row, buffer, originalMessage.getVersion());
+        assert buffer.getLength() == buffer.getData().length;
+        return originalMessage.getReply(FBUtilities.getBroadcastAddress(), buffer.getData(), originalMessage.getVersion());
     }
 
     @Override

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java Thu Oct 13 05:14:05 2011
@@ -18,8 +18,8 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.HashMap;
@@ -27,8 +27,7 @@ import java.util.Map;
 
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.io.ICompactSerializer;
-import org.apache.cassandra.io.util.FastByteArrayOutputStream;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessageProducer;
 import org.apache.cassandra.service.IReadCommand;
@@ -50,10 +49,8 @@ public abstract class ReadCommand implem
 
     public Message getMessage(Integer version) throws IOException
     {
-        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
-        DataOutputStream dos = new DataOutputStream(bos);
-        ReadCommand.serializer().serialize(this, dos, version);
-        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.READ, bos.toByteArray(), version);
+        byte[] bytes = FBUtilities.serialize(this, serializer, version);
+        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.READ, bytes, version);
     }
 
     public final QueryPath queryPath;
@@ -100,9 +97,9 @@ public abstract class ReadCommand implem
     }
 }
 
-class ReadCommandSerializer implements ICompactSerializer<ReadCommand>
+class ReadCommandSerializer implements IVersionedSerializer<ReadCommand>
 {
-    private static final Map<Byte, ReadCommandSerializer> CMD_SERIALIZER_MAP = new HashMap<Byte, ReadCommandSerializer>(); 
+    private static final Map<Byte, IVersionedSerializer<ReadCommand>> CMD_SERIALIZER_MAP = new HashMap<Byte, IVersionedSerializer<ReadCommand>>();
     static 
     {
         CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_SLICE_BY_NAMES, new SliceByNamesReadCommandSerializer());
@@ -110,17 +107,20 @@ class ReadCommandSerializer implements I
     }
 
 
-    public void serialize(ReadCommand rm, DataOutputStream dos, int version) throws IOException
+    public void serialize(ReadCommand command, DataOutput dos, int version) throws IOException
     {
-        dos.writeByte(rm.commandType);
-        ReadCommandSerializer ser = CMD_SERIALIZER_MAP.get(rm.commandType);
-        ser.serialize(rm, dos, version);
+        dos.writeByte(command.commandType);
+        CMD_SERIALIZER_MAP.get(command.commandType).serialize(command, dos, version);
     }
 
-    public ReadCommand deserialize(DataInputStream dis, int version) throws IOException
+    public ReadCommand deserialize(DataInput dis, int version) throws IOException
     {
         byte msgType = dis.readByte();
         return CMD_SERIALIZER_MAP.get(msgType).deserialize(dis, version);
     }
-        
+
+    public long serializedSize(ReadCommand command, int version)
+    {
+        return 1 + CMD_SERIALIZER_MAP.get(command.commandType).serializedSize(command, version);
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ReadResponse.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ReadResponse.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ReadResponse.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ReadResponse.java Thu Oct 13 05:14:05 2011
@@ -18,12 +18,10 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
 
@@ -34,14 +32,14 @@ import org.apache.cassandra.utils.ByteBu
  */
 public class ReadResponse
 {
-private static ICompactSerializer<ReadResponse> serializer_;
+private static IVersionedSerializer<ReadResponse> serializer_;
 
     static
     {
         serializer_ = new ReadResponseSerializer();
     }
 
-    public static ICompactSerializer<ReadResponse> serializer()
+    public static IVersionedSerializer<ReadResponse> serializer()
     {
         return serializer_;
     }
@@ -79,22 +77,19 @@ private static ICompactSerializer<ReadRe
     }
 }
 
-class ReadResponseSerializer implements ICompactSerializer<ReadResponse>
+class ReadResponseSerializer implements IVersionedSerializer<ReadResponse>
 {
-	public void serialize(ReadResponse rm, DataOutputStream dos, int version) throws IOException
+	public void serialize(ReadResponse response, DataOutput dos, int version) throws IOException
 	{
-        dos.writeInt(rm.isDigestQuery() ? rm.digest().remaining() : 0);
-        ByteBuffer buffer = rm.isDigestQuery() ? rm.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER;
+        dos.writeInt(response.isDigestQuery() ? response.digest().remaining() : 0);
+        ByteBuffer buffer = response.isDigestQuery() ? response.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER;
         ByteBufferUtil.write(buffer, dos);
-        dos.writeBoolean(rm.isDigestQuery());
-
-        if (!rm.isDigestQuery())
-        {
-            Row.serializer().serialize(rm.row(), dos, version);
-        }
+        dos.writeBoolean(response.isDigestQuery());
+        if (!response.isDigestQuery())
+            Row.serializer().serialize(response.row(), dos, version);
     }
 	
-    public ReadResponse deserialize(DataInputStream dis, int version) throws IOException
+    public ReadResponse deserialize(DataInput dis, int version) throws IOException
     {
         byte[] digest = null;
         int digestSize = dis.readInt();
@@ -114,5 +109,17 @@ class ReadResponseSerializer implements 
         }
 
         return isDigest ? new ReadResponse(ByteBuffer.wrap(digest)) : new ReadResponse(row);
-    } 
+    }
+
+    public long serializedSize(ReadResponse response, int version)
+    {
+        int size = DBConstants.intSize;
+        size += (response.isDigestQuery() ? response.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER).remaining();
+        size += DBConstants.boolSize;
+        if (response.isDigestQuery())
+            size += response.digest().remaining();
+        else
+            size += Row.serializer().serializedSize(response.row(), version);
+        return size;
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java Thu Oct 13 05:14:05 2011
@@ -18,6 +18,7 @@
 
 package org.apache.cassandra.db;
 
+import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.IOException;
 
@@ -37,16 +38,6 @@ public class ReadVerbHandler implements 
 {
     private static Logger logger_ = LoggerFactory.getLogger( ReadVerbHandler.class );
 
-    // re-use output buffers between requests
-    private static ThreadLocal<DataOutputBuffer> threadLocalOut = new ThreadLocal<DataOutputBuffer>()
-    {
-        @Override
-        protected DataOutputBuffer initialValue()
-        {
-            return new DataOutputBuffer();
-        }
-    };
-
     public void doVerb(Message message, String id)
     {
         if (StorageService.instance.isBootstrapMode())
@@ -61,17 +52,14 @@ public class ReadVerbHandler implements 
             Table table = Table.open(command.table);
             Row row = command.getRow(table);
 
-            DataOutputBuffer out = threadLocalOut.get();
-            out.reset();
-            ReadResponse.serializer().serialize(getResponse(command, row), out, message.getVersion());
-            byte[] bytes = new byte[out.getLength()];
-            System.arraycopy(out.getData(), 0, bytes, 0, bytes.length);
-            Message response = message.getReply(FBUtilities.getBroadcastAddress(), bytes, message.getVersion());
+            ReadResponse response = getResponse(command, row);
+            byte[] bytes = FBUtilities.serialize(response, ReadResponse.serializer(), message.getVersion());
+            Message reply = message.getReply(FBUtilities.getBroadcastAddress(), bytes, message.getVersion());
 
             if (logger_.isDebugEnabled())
               logger_.debug(String.format("Read key %s; sending response to %s@%s",
                                           ByteBufferUtil.bytesToHex(command.key), id, message.getFrom()));
-            MessagingService.instance().sendReply(response, id, message.getFrom());
+            MessagingService.instance().sendReply(reply, id, message.getFrom());
         }
         catch (IOException ex)
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Row.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Row.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Row.java Thu Oct 13 05:14:05 2011
@@ -18,11 +18,9 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -55,23 +53,28 @@ public class Row
                ')';
     }
 
-    public static class RowSerializer implements ICompactSerializer<Row>
+    public static class RowSerializer implements IVersionedSerializer<Row>
     {
-        public void serialize(Row row, DataOutputStream dos, int version) throws IOException
+        public void serialize(Row row, DataOutput dos, int version) throws IOException
         {
             ByteBufferUtil.writeWithShortLength(row.key.key, dos);
             ColumnFamily.serializer().serialize(row.cf, dos);
         }
 
-        public Row deserialize(DataInputStream dis, int version, boolean fromRemote, ISortedColumns.Factory factory) throws IOException
+        public Row deserialize(DataInput dis, int version, boolean fromRemote, ISortedColumns.Factory factory) throws IOException
         {
             return new Row(StorageService.getPartitioner().decorateKey(ByteBufferUtil.readWithShortLength(dis)),
                            ColumnFamily.serializer().deserialize(dis, fromRemote, factory));
         }
 
-        public Row deserialize(DataInputStream dis, int version) throws IOException
+        public Row deserialize(DataInput dis, int version) throws IOException
         {
             return deserialize(dis, version, false, ThreadSafeSortedColumns.factory());
         }
+
+        public long serializedSize(Row row, int version)
+        {
+            return DBConstants.shortSize + row.key.key.remaining() + ColumnFamily.serializer().serializedSize(row.cf);
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Thu Oct 13 05:14:05 2011
@@ -18,19 +18,21 @@
 
 package org.apache.cassandra.db;
 
-import java.io.*;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import org.apache.cassandra.config.Schema;
 import org.apache.commons.lang.StringUtils;
 
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.KSMetaData;
+import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.filter.QueryPath;
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.io.util.FastByteArrayInputStream;
-import org.apache.cassandra.io.util.FastByteArrayOutputStream;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessageProducer;
 import org.apache.cassandra.net.MessagingService;
@@ -270,17 +272,13 @@ public class RowMutation implements IMut
 
     public synchronized byte[] getSerializedBuffer(int version) throws IOException
     {
-        byte[] preserializedBuffer = preserializedBuffers.get(version);
-        if (preserializedBuffer == null)
+        byte[] bytes = preserializedBuffers.get(version);
+        if (bytes == null)
         {
-            FastByteArrayOutputStream bout = new FastByteArrayOutputStream();
-            DataOutputStream dout = new DataOutputStream(bout);
-            RowMutation.serializer().serialize(this, dout, version);
-            dout.close();
-            preserializedBuffer = bout.toByteArray();
-            preserializedBuffers.put(version, preserializedBuffer);
+            bytes = FBUtilities.serialize(this, serializer(), version);
+            preserializedBuffers.put(version, bytes);
         }
-        return preserializedBuffer;
+        return bytes;
     }
 
     public String toString()
@@ -372,9 +370,9 @@ public class RowMutation implements IMut
         return rm;
     }
 
-    public static class RowMutationSerializer implements ICompactSerializer<RowMutation>
+    public static class RowMutationSerializer implements IVersionedSerializer<RowMutation>
     {
-        public void serialize(RowMutation rm, DataOutputStream dos, int version) throws IOException
+        public void serialize(RowMutation rm, DataOutput dos, int version) throws IOException
         {
             dos.writeUTF(rm.getTable());
             ByteBufferUtil.writeWithShortLength(rm.key(), dos);
@@ -382,17 +380,15 @@ public class RowMutation implements IMut
             /* serialize the modifications_ in the mutation */
             int size = rm.modifications_.size();
             dos.writeInt(size);
-            if (size > 0)
+            assert size >= 0;
+            for (Map.Entry<Integer,ColumnFamily> entry : rm.modifications_.entrySet())
             {
-                for (Map.Entry<Integer,ColumnFamily> entry : rm.modifications_.entrySet())
-                {
-                    dos.writeInt(entry.getKey());
-                    ColumnFamily.serializer().serialize(entry.getValue(), dos);
-                }
+                dos.writeInt(entry.getKey());
+                ColumnFamily.serializer().serialize(entry.getValue(), dos);
             }
         }
 
-        public RowMutation deserialize(DataInputStream dis, int version, boolean fromRemote) throws IOException
+        public RowMutation deserialize(DataInput dis, int version, boolean fromRemote) throws IOException
         {
             String table = dis.readUTF();
             ByteBuffer key = ByteBufferUtil.readWithShortLength(dis);
@@ -407,9 +403,24 @@ public class RowMutation implements IMut
             return new RowMutation(table, key, modifications);
         }
 
-        public RowMutation deserialize(DataInputStream dis, int version) throws IOException
+        public RowMutation deserialize(DataInput dis, int version) throws IOException
         {
             return deserialize(dis, version, true);
         }
+
+        public long serializedSize(RowMutation rm, int version)
+        {
+            int size = DBConstants.shortSize + FBUtilities.encodedUTF8Length(rm.getTable());
+            size += DBConstants.shortSize + rm.key().remaining();
+
+            size += DBConstants.intSize;
+            for (Map.Entry<Integer,ColumnFamily> entry : rm.modifications_.entrySet())
+            {
+                size += DBConstants.intSize;
+                size += entry.getValue().serializedSize();
+            }
+
+            return size;
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java Thu Oct 13 05:14:05 2011
@@ -17,17 +17,17 @@
  */
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 import java.util.*;
 
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.ColumnParent;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class SliceByNamesReadCommand extends ReadCommand
 {
@@ -71,28 +71,26 @@ public class SliceByNamesReadCommand ext
 
 }
 
-class SliceByNamesReadCommandSerializer extends ReadCommandSerializer
+class SliceByNamesReadCommandSerializer implements IVersionedSerializer<ReadCommand>
 {
-    @Override
-    public void serialize(ReadCommand rm, DataOutputStream dos, int version) throws IOException
+    public void serialize(ReadCommand cmd, DataOutput dos, int version) throws IOException
     {
-        SliceByNamesReadCommand realRM = (SliceByNamesReadCommand)rm;
-        dos.writeBoolean(realRM.isDigestQuery());
-        dos.writeUTF(realRM.table);
-        ByteBufferUtil.writeWithShortLength(realRM.key, dos);
-        realRM.queryPath.serialize(dos);
-        dos.writeInt(realRM.columnNames.size());
-        if (realRM.columnNames.size() > 0)
+        SliceByNamesReadCommand command = (SliceByNamesReadCommand) cmd;
+        dos.writeBoolean(command.isDigestQuery());
+        dos.writeUTF(command.table);
+        ByteBufferUtil.writeWithShortLength(command.key, dos);
+        command.queryPath.serialize(dos);
+        dos.writeInt(command.columnNames.size());
+        if (!command.columnNames.isEmpty())
         {
-            for (ByteBuffer cName : realRM.columnNames)
+            for (ByteBuffer cName : command.columnNames)
             {
                 ByteBufferUtil.writeWithShortLength(cName, dos);
             }
         }
     }
 
-    @Override
-    public ReadCommand deserialize(DataInputStream dis, int version) throws IOException
+    public SliceByNamesReadCommand deserialize(DataInput dis, int version) throws IOException
     {
         boolean isDigest = dis.readBoolean();
         String table = dis.readUTF();
@@ -105,8 +103,24 @@ class SliceByNamesReadCommandSerializer 
         {
             columns.add(ByteBufferUtil.readWithShortLength(dis));
         }
-        SliceByNamesReadCommand rm = new SliceByNamesReadCommand(table, key, columnParent, columns);
-        rm.setDigestQuery(isDigest);
-        return rm;
+        SliceByNamesReadCommand command = new SliceByNamesReadCommand(table, key, columnParent, columns);
+        command.setDigestQuery(isDigest);
+        return command;
+    }
+
+    public long serializedSize(ReadCommand cmd, int version)
+    {
+        SliceByNamesReadCommand command = (SliceByNamesReadCommand) cmd;
+        int size = DBConstants.boolSize;
+        size += DBConstants.shortSize + FBUtilities.encodedUTF8Length(command.table);
+        size += DBConstants.shortSize + command.key.remaining();
+        size += command.queryPath.serializedSize();
+        size += DBConstants.intSize;
+        if (!command.columnNames.isEmpty())
+        {
+            for (ByteBuffer cName : command.columnNames)
+                size += DBConstants.shortSize + cName.remaining();
+        }
+        return size;
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java Thu Oct 13 05:14:05 2011
@@ -17,16 +17,16 @@
  */
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.ColumnParent;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class SliceFromReadCommand extends ReadCommand
 {
@@ -76,10 +76,9 @@ public class SliceFromReadCommand extend
     }
 }
 
-class SliceFromReadCommandSerializer extends ReadCommandSerializer
+class SliceFromReadCommandSerializer implements IVersionedSerializer<ReadCommand>
 {
-    @Override
-    public void serialize(ReadCommand rm, DataOutputStream dos, int version) throws IOException
+    public void serialize(ReadCommand rm, DataOutput dos, int version) throws IOException
     {
         SliceFromReadCommand realRM = (SliceFromReadCommand)rm;
         dos.writeBoolean(realRM.isDigestQuery());
@@ -92,8 +91,7 @@ class SliceFromReadCommandSerializer ext
         dos.writeInt(realRM.count);
     }
 
-    @Override
-    public ReadCommand deserialize(DataInputStream dis, int version) throws IOException
+    public ReadCommand deserialize(DataInput dis, int version) throws IOException
     {
         boolean isDigest = dis.readBoolean();
         SliceFromReadCommand rm = new SliceFromReadCommand(dis.readUTF(),
@@ -106,4 +104,18 @@ class SliceFromReadCommandSerializer ext
         rm.setDigestQuery(isDigest);
         return rm;
     }
+
+    public long serializedSize(ReadCommand cmd, int version)
+    {
+        SliceFromReadCommand command = (SliceFromReadCommand) cmd;
+        int size = DBConstants.boolSize;
+        size += DBConstants.shortSize + FBUtilities.encodedUTF8Length(command.table);
+        size += DBConstants.shortSize + command.key.remaining();
+        size += command.queryPath.serializedSize();
+        size += DBConstants.shortSize + command.start.remaining();
+        size += DBConstants.shortSize + command.finish.remaining();
+        size += DBConstants.boolSize;
+        size += DBConstants.intSize;
+        return size;
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java Thu Oct 13 05:14:05 2011
@@ -374,4 +374,9 @@ class SuperColumnSerializer implements I
         superColumn.delete(localDeleteTime, markedForDeleteAt);
         return superColumn;
     }
+
+    public long serializedSize(IColumn object)
+    {
+        return object.serializedSize();
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java Thu Oct 13 05:14:05 2011
@@ -18,11 +18,9 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.io.util.FastByteArrayOutputStream;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.utils.FBUtilities;
@@ -61,21 +59,26 @@ public class TruncateResponse
 		this.success = success;
 	}
 
-    public static class TruncateResponseSerializer implements ICompactSerializer<TruncateResponse>
+    public static class TruncateResponseSerializer implements IVersionedSerializer<TruncateResponse>
     {
-        public void serialize(TruncateResponse tr, DataOutputStream dos, int version) throws IOException
+        public void serialize(TruncateResponse tr, DataOutput dos, int version) throws IOException
         {
             dos.writeUTF(tr.keyspace);
             dos.writeUTF(tr.columnFamily);
             dos.writeBoolean(tr.success);
         }
 
-        public TruncateResponse deserialize(DataInputStream dis, int version) throws IOException
+        public TruncateResponse deserialize(DataInput dis, int version) throws IOException
         {
             String keyspace = dis.readUTF();
             String columnFamily = dis.readUTF();
             boolean success = dis.readBoolean();
             return new TruncateResponse(keyspace, columnFamily, success);
         }
+
+        public long serializedSize(TruncateResponse truncateResponse, int version)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java Thu Oct 13 05:14:05 2011
@@ -18,11 +18,9 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.io.util.FastByteArrayOutputStream;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessageProducer;
@@ -34,7 +32,7 @@ import org.apache.cassandra.utils.FBUtil
  */
 public class Truncation implements MessageProducer
 {
-    private static ICompactSerializer<Truncation> serializer;
+    private static IVersionedSerializer<Truncation> serializer;
 
     public final String keyspace;
     public final String columnFamily;
@@ -44,7 +42,7 @@ public class Truncation implements Messa
         serializer = new TruncationSerializer();
     }
 
-    public static ICompactSerializer<Truncation> serializer()
+    public static IVersionedSerializer<Truncation> serializer()
     {
         return serializer;
     }
@@ -69,18 +67,23 @@ public class Truncation implements Messa
     }
 }
 
-class TruncationSerializer implements ICompactSerializer<Truncation>
+class TruncationSerializer implements IVersionedSerializer<Truncation>
 {
-    public void serialize(Truncation t, DataOutputStream dos, int version) throws IOException
+    public void serialize(Truncation t, DataOutput dos, int version) throws IOException
     {
         dos.writeUTF(t.keyspace);
         dos.writeUTF(t.columnFamily);
     }
 
-    public Truncation deserialize(DataInputStream dis, int version) throws IOException
+    public Truncation deserialize(DataInput dis, int version) throws IOException
     {
         String keyspace = dis.readUTF();
         String columnFamily = dis.readUTF();
         return new Truncation(keyspace, columnFamily);
     }
+
+    public long serializedSize(Truncation truncation, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java Thu Oct 13 05:14:05 2011
@@ -18,13 +18,12 @@
 
 package org.apache.cassandra.db;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
-import org.apache.cassandra.io.ICompactSerializer;
-import org.apache.cassandra.io.util.FastByteArrayOutputStream;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
@@ -44,12 +43,10 @@ public class WriteResponse 
         return serializer_;
     }
 
-    public static Message makeWriteResponseMessage(Message original, WriteResponse writeResponseMessage) throws IOException
+    public static Message makeWriteResponseMessage(Message original, WriteResponse respose) throws IOException
     {
-    	FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
-        DataOutputStream dos = new DataOutputStream( bos );
-        WriteResponse.serializer().serialize(writeResponseMessage, dos, original.getVersion());
-        return original.getReply(FBUtilities.getBroadcastAddress(), bos.toByteArray(), original.getVersion());
+        byte[] bytes = FBUtilities.serialize(respose, WriteResponse.serializer(), original.getVersion());
+        return original.getReply(FBUtilities.getBroadcastAddress(), bytes, original.getVersion());
     }
 
 	private final String table_;
@@ -77,21 +74,29 @@ public class WriteResponse 
 		return status_;
 	}
 
-    public static class WriteResponseSerializer implements ICompactSerializer<WriteResponse>
+    public static class WriteResponseSerializer implements IVersionedSerializer<WriteResponse>
     {
-        public void serialize(WriteResponse wm, DataOutputStream dos, int version) throws IOException
+        public void serialize(WriteResponse wm, DataOutput dos, int version) throws IOException
         {
             dos.writeUTF(wm.table());
             ByteBufferUtil.writeWithShortLength(wm.key(), dos);
             dos.writeBoolean(wm.isSuccess());
         }
 
-        public WriteResponse deserialize(DataInputStream dis, int version) throws IOException
+        public WriteResponse deserialize(DataInput dis, int version) throws IOException
         {
             String table = dis.readUTF();
             ByteBuffer key = ByteBufferUtil.readWithShortLength(dis);
             boolean status = dis.readBoolean();
             return new WriteResponse(table, key, status);
         }
+
+        public long serializedSize(WriteResponse response, int version)
+        {
+            int size = DBConstants.shortSize + FBUtilities.encodedUTF8Length(response.table());
+            size += DBConstants.shortSize + response.key().remaining();
+            size += DBConstants.boolSize;
+            return size;
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java Thu Oct 13 05:14:05 2011
@@ -30,7 +30,7 @@ import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Ordering;
 
-import org.apache.cassandra.io.ICompactSerializer2;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.io.sstable.SSTableReader;
 
 public class ReplayPosition implements Comparable<ReplayPosition>
@@ -120,7 +120,7 @@ public class ReplayPosition implements C
                ')';
     }
 
-    public static class ReplayPositionSerializer implements ICompactSerializer2<ReplayPosition>
+    public static class ReplayPositionSerializer implements ISerializer<ReplayPosition>
     {
         public void serialize(ReplayPosition rp, DataOutput dos) throws IOException
         {
@@ -132,5 +132,10 @@ public class ReplayPosition implements C
         {
             return new ReplayPosition(dis.readLong(), dis.readInt());
         }
+
+        public long serializedSize(ReplayPosition object)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java Thu Oct 13 05:14:05 2011
@@ -21,14 +21,14 @@ package org.apache.cassandra.db.filter;
  */
 
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 
+import org.apache.cassandra.db.DBConstants;
 import org.apache.cassandra.thrift.ColumnParent;
 import org.apache.cassandra.thrift.ColumnPath;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
 
 public class QueryPath
 {
@@ -78,7 +78,7 @@ public class QueryPath
                ')';
     }
 
-    public void serialize(DataOutputStream dos) throws IOException
+    public void serialize(DataOutput dos) throws IOException
     {
         assert !"".equals(columnFamilyName);
         assert superColumnName == null || superColumnName.remaining() > 0;
@@ -88,7 +88,7 @@ public class QueryPath
         ByteBufferUtil.writeWithShortLength(columnName == null ? ByteBufferUtil.EMPTY_BYTE_BUFFER : columnName, dos);
     }
 
-    public static QueryPath deserialize(DataInputStream din) throws IOException
+    public static QueryPath deserialize(DataInput din) throws IOException
     {
         String cfName = din.readUTF();
         ByteBuffer scName = ByteBufferUtil.readWithShortLength(din);
@@ -97,4 +97,12 @@ public class QueryPath
                              scName.remaining() == 0 ? null : scName, 
                              cName.remaining() == 0 ? null : cName);
     }
+
+    public int serializedSize()
+    {
+        int size = DBConstants.shortSize + (columnFamilyName == null ? 0 : FBUtilities.encodedUTF8Length(columnFamilyName));
+        size += DBConstants.shortSize + (superColumnName == null ? 0 : superColumnName.remaining());
+        size += DBConstants.shortSize + (columnName == null ? 0 : columnName.remaining());
+        return size;
+    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/dht/AbstractBounds.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/dht/AbstractBounds.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/dht/AbstractBounds.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/dht/AbstractBounds.java Thu Oct 13 05:14:05 2011
@@ -27,7 +27,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.*;
 
-import org.apache.cassandra.io.ICompactSerializer2;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.utils.Pair;
 
 public abstract class AbstractBounds implements Serializable
@@ -35,7 +35,7 @@ public abstract class AbstractBounds imp
     private static final long serialVersionUID = 1L;
     private static AbstractBoundsSerializer serializer = new AbstractBoundsSerializer();
 
-    public static ICompactSerializer2<AbstractBounds> serializer()
+    public static AbstractBoundsSerializer serializer()
     {
         return serializer;
     }
@@ -165,7 +165,7 @@ public abstract class AbstractBounds imp
         return output;
     }
 
-    private static class AbstractBoundsSerializer implements ICompactSerializer2<AbstractBounds>
+    public static class AbstractBoundsSerializer implements ISerializer<AbstractBounds>
     {
         public void serialize(AbstractBounds range, DataOutput out) throws IOException
         {
@@ -180,6 +180,11 @@ public abstract class AbstractBounds imp
                 return new Range(Token.serializer().deserialize(in), Token.serializer().deserialize(in));
             return new Bounds(Token.serializer().deserialize(in), Token.serializer().deserialize(in));
         }
+
+        public long serializedSize(AbstractBounds abstractBounds)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/dht/Token.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/dht/Token.java?rev=1182654&r1=1182653&r2=1182654&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/dht/Token.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/dht/Token.java Thu Oct 13 05:14:05 2011
@@ -25,7 +25,7 @@ import java.io.Serializable;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.config.ConfigurationException;
-import org.apache.cassandra.io.ICompactSerializer2;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -79,7 +79,7 @@ public abstract class Token<T> implement
         public abstract void validate(String token) throws ConfigurationException;
     }
 
-    public static class TokenSerializer implements ICompactSerializer2<Token>
+    public static class TokenSerializer implements ISerializer<Token>
     {
         public void serialize(Token token, DataOutput dos) throws IOException
         {
@@ -96,5 +96,10 @@ public abstract class Token<T> implement
             dis.readFully(bytes);
             return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes));
         }
+
+        public long serializedSize(Token object)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }



Mime
View raw message