cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1182652 [1/2] - in /cassandra/branches/cassandra-1.0: ./ contrib/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cache/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/commitlog/ src...
Date Thu, 13 Oct 2011 05:08:17 GMT
Author: jbellis
Date: Thu Oct 13 05:08:15 2011
New Revision: 1182652

URL: http://svn.apache.org/viewvc?rev=1182652&view=rev
Log:
ICompactSerializer* -> I[Versioned]Serializer
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-3333

Added:
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java
Removed:
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ICompactSerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ICompactSerializer2.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ICompactSerializer3.java
Modified:
    cassandra/branches/cassandra-1.0/   (props changed)
    cassandra/branches/cassandra-1.0/contrib/   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java   (props changed)
    cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java   (props changed)
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/SerializingCache.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnSerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/CounterMutation.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/IndexScanCommand.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RangeSliceCommand.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadCommand.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadResponse.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Row.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RowMutation.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SuperColumn.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/TruncateResponse.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/WriteResponse.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/filter/QueryPath.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/AbstractBounds.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/Token.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/EndpointState.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigest.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/HeartBeatState.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/VersionedValue.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IColumnSerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/SerDeUtils.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/net/CompactEndpointSerializationHelper.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/net/Header.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/net/Message.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/streaming/PendingFile.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/streaming/StreamHeader.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/streaming/StreamReply.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/streaming/StreamRequestMessage.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/streaming/StreamingRepairTask.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/BloomFilter.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/EstimatedHistogram.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/MerkleTree.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/UUIDGen.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/gms/GossipDigestTest.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/io/CompactSerializerTest.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/net/MessageSerializer.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
    cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/utils/SerializationsTest.java

Propchange: cassandra/branches/cassandra-1.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 13 05:08:15 2011
@@ -1,7 +1,7 @@
 /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-1182419
+/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:1167106,1167185

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/SerializingCache.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/SerializingCache.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/SerializingCache.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cache/SerializingCache.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/AbstractColumnContainer.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/AbstractColumnContainer.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/AbstractColumnContainer.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilySerializer.java Thu Oct 13 05:08:15 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);
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnSerializer.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnSerializer.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnSerializer.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/CounterMutation.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/CounterMutation.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/CounterMutation.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/CounterMutation.java Thu Oct 13 05:08:15 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.IVersionedSerializer;
 import org.apache.cassandra.io.util.FastByteArrayOutputStream;
 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;
@@ -240,18 +232,23 @@ 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 object, int version)
+    {
+        return 0;
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/IndexScanCommand.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/IndexScanCommand.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/IndexScanCommand.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/IndexScanCommand.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RangeSliceCommand.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RangeSliceCommand.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RangeSliceCommand.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RangeSliceCommand.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadCommand.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadCommand.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadCommand.java Thu Oct 13 05:08:15 2011
@@ -18,16 +18,14 @@
 
 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.HashMap;
 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.IVersionedSerializer;
 import org.apache.cassandra.io.util.FastByteArrayOutputStream;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessageProducer;
@@ -100,7 +98,7 @@ 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>(); 
     static 
@@ -110,17 +108,21 @@ class ReadCommandSerializer implements I
     }
 
 
-    public void serialize(ReadCommand rm, DataOutputStream dos, int version) throws IOException
+    public void serialize(ReadCommand rm, DataOutput dos, int version) throws IOException
     {
         dos.writeByte(rm.commandType);
         ReadCommandSerializer ser = CMD_SERIALIZER_MAP.get(rm.commandType);
         ser.serialize(rm, 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)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadResponse.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadResponse.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadResponse.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ReadResponse.java Thu Oct 13 05:08:15 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,9 +77,9 @@ 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 rm, DataOutput dos, int version) throws IOException
 	{
         dos.writeInt(rm.isDigestQuery() ? rm.digest().remaining() : 0);
         ByteBuffer buffer = rm.isDigestQuery() ? rm.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER;
@@ -94,7 +92,7 @@ class ReadResponseSerializer implements 
         }
     }
 	
-    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 +112,10 @@ class ReadResponseSerializer implements 
         }
 
         return isDigest ? new ReadResponse(ByteBuffer.wrap(digest)) : new ReadResponse(row);
-    } 
+    }
+
+    public long serializedSize(ReadResponse readResponse)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Row.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Row.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Row.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Row.java Thu Oct 13 05:08:15 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)
+        {
+            return 0;
+        }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RowMutation.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/RowMutation.java Thu Oct 13 05:08:15 2011
@@ -28,7 +28,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.KSMetaData;
 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;
@@ -372,9 +372,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);
@@ -392,7 +392,7 @@ public class RowMutation implements IMut
             }
         }
 
-        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 +407,14 @@ 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 rowMutation, int version)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java Thu Oct 13 05:08:15 2011
@@ -17,9 +17,7 @@
  */
 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.*;
 
@@ -74,7 +72,7 @@ public class SliceByNamesReadCommand ext
 class SliceByNamesReadCommandSerializer extends ReadCommandSerializer
 {
     @Override
-    public void serialize(ReadCommand rm, DataOutputStream dos, int version) throws IOException
+    public void serialize(ReadCommand rm, DataOutput dos, int version) throws IOException
     {
         SliceByNamesReadCommand realRM = (SliceByNamesReadCommand)rm;
         dos.writeBoolean(realRM.isDigestQuery());
@@ -92,7 +90,7 @@ class SliceByNamesReadCommandSerializer 
     }
 
     @Override
-    public ReadCommand deserialize(DataInputStream dis, int version) throws IOException
+    public ReadCommand deserialize(DataInput dis, int version) throws IOException
     {
         boolean isDigest = dis.readBoolean();
         String table = dis.readUTF();

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceFromReadCommand.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceFromReadCommand.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SliceFromReadCommand.java Thu Oct 13 05:08:15 2011
@@ -17,9 +17,7 @@
  */
 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;
@@ -79,7 +77,7 @@ public class SliceFromReadCommand extend
 class SliceFromReadCommandSerializer extends ReadCommandSerializer
 {
     @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());
@@ -93,7 +91,7 @@ class SliceFromReadCommandSerializer ext
     }
 
     @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(),

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SuperColumn.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SuperColumn.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SuperColumn.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/SuperColumn.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/TruncateResponse.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/TruncateResponse.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/TruncateResponse.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/TruncateResponse.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/Truncation.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/WriteResponse.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/WriteResponse.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/WriteResponse.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/WriteResponse.java Thu Oct 13 05:08:15 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.io.util.FastByteArrayOutputStream;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -77,21 +75,26 @@ 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)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/db/filter/QueryPath.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/filter/QueryPath.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/filter/QueryPath.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/filter/QueryPath.java Thu Oct 13 05:08:15 2011
@@ -21,9 +21,7 @@ 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.thrift.ColumnParent;
@@ -78,7 +76,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 +86,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);

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/AbstractBounds.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/AbstractBounds.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/AbstractBounds.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/AbstractBounds.java Thu Oct 13 05:08:15 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/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/Token.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/Token.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/Token.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/dht/Token.java Thu Oct 13 05:08:15 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();
+        }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/EndpointState.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/EndpointState.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/EndpointState.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/EndpointState.java Thu Oct 13 05:08:15 2011
@@ -18,15 +18,13 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.util.Map;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.cliffc.high_scale_lib.NonBlockingHashMap;
 
 /**
@@ -39,7 +37,7 @@ public class EndpointState
 {
     protected static Logger logger = LoggerFactory.getLogger(EndpointState.class);
 
-    private final static ICompactSerializer<EndpointState> serializer = new EndpointStateSerializer();
+    private final static IVersionedSerializer<EndpointState> serializer = new EndpointStateSerializer();
 
     private volatile HeartBeatState hbState;
     final Map<ApplicationState, VersionedValue> applicationState = new NonBlockingHashMap<ApplicationState, VersionedValue>();
@@ -54,7 +52,7 @@ public class EndpointState
     // fat client and will be removed automatically from gossip.
     private volatile boolean hasToken;
 
-    public static ICompactSerializer<EndpointState> serializer()
+    public static IVersionedSerializer<EndpointState> serializer()
     {
         return serializer;
     }
@@ -134,11 +132,11 @@ public class EndpointState
     }
 }
 
-class EndpointStateSerializer implements ICompactSerializer<EndpointState>
+class EndpointStateSerializer implements IVersionedSerializer<EndpointState>
 {
     private static Logger logger = LoggerFactory.getLogger(EndpointStateSerializer.class);
     
-    public void serialize(EndpointState epState, DataOutputStream dos, int version) throws IOException
+    public void serialize(EndpointState epState, DataOutput dos, int version) throws IOException
     {
         /* serialize the HeartBeatState */
         HeartBeatState hbState = epState.getHeartBeatState();
@@ -150,15 +148,12 @@ class EndpointStateSerializer implements
         for (Map.Entry<ApplicationState, VersionedValue> entry : epState.applicationState.entrySet())
         {
             VersionedValue value = entry.getValue();
-            if (value != null)
-            {
-                dos.writeInt(entry.getKey().ordinal());
-                VersionedValue.serializer.serialize(value, dos, version);
-            }
+            dos.writeInt(entry.getKey().ordinal());
+            VersionedValue.serializer.serialize(value, dos, version);
         }
     }
 
-    public EndpointState deserialize(DataInputStream dis, int version) throws IOException
+    public EndpointState deserialize(DataInput dis, int version) throws IOException
     {
         HeartBeatState hbState = HeartBeatState.serializer().deserialize(dis, version);
         EndpointState epState = new EndpointState(hbState);
@@ -166,15 +161,15 @@ class EndpointStateSerializer implements
         int appStateSize = dis.readInt();
         for ( int i = 0; i < appStateSize; ++i )
         {
-            if ( dis.available() == 0 )
-            {
-                break;
-            }
-
             int key = dis.readInt();
             VersionedValue value = VersionedValue.serializer.deserialize(dis, version);
             epState.addApplicationState(Gossiper.STATES[key], value);
         }
         return epState;
     }
+
+    public long serializedSize(EndpointState endpointState, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigest.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigest.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigest.java Thu Oct 13 05:08:15 2011
@@ -18,12 +18,10 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.InetAddress;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.net.CompactEndpointSerializationHelper;
 
 /**
@@ -33,7 +31,7 @@ import org.apache.cassandra.net.CompactE
 
 public class GossipDigest implements Comparable<GossipDigest>
 {
-    private static ICompactSerializer<GossipDigest> serializer;
+    private static IVersionedSerializer<GossipDigest> serializer;
     static
     {
         serializer = new GossipDigestSerializer();
@@ -43,7 +41,7 @@ public class GossipDigest implements Com
     int generation;
     int maxVersion;
 
-    public static ICompactSerializer<GossipDigest> serializer()
+    public static IVersionedSerializer<GossipDigest> serializer()
     {
         return serializer;
     }
@@ -89,20 +87,25 @@ public class GossipDigest implements Com
     }
 }
 
-class GossipDigestSerializer implements ICompactSerializer<GossipDigest>
+class GossipDigestSerializer implements IVersionedSerializer<GossipDigest>
 {       
-    public void serialize(GossipDigest gDigest, DataOutputStream dos, int version) throws IOException
+    public void serialize(GossipDigest gDigest, DataOutput dos, int version) throws IOException
     {        
         CompactEndpointSerializationHelper.serialize(gDigest.endpoint, dos);
         dos.writeInt(gDigest.generation);
         dos.writeInt(gDigest.maxVersion);
     }
 
-    public GossipDigest deserialize(DataInputStream dis, int version) throws IOException
+    public GossipDigest deserialize(DataInput dis, int version) throws IOException
     {
         InetAddress endpoint = CompactEndpointSerializationHelper.deserialize(dis);
         int generation = dis.readInt();
         int maxVersion = dis.readInt();
         return new GossipDigest(endpoint, generation, maxVersion);
     }
+
+    public long serializedSize(GossipDigest gossipDigest, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAck2Message.java Thu Oct 13 05:08:15 2011
@@ -18,14 +18,12 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.InetAddress;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 
 
 /**
@@ -35,7 +33,7 @@ import org.apache.cassandra.io.ICompactS
 
 class GossipDigestAck2Message
 {
-    private static  ICompactSerializer<GossipDigestAck2Message> serializer_;
+    private static  IVersionedSerializer<GossipDigestAck2Message> serializer_;
     static
     {
         serializer_ = new GossipDigestAck2MessageSerializer();
@@ -43,7 +41,7 @@ class GossipDigestAck2Message
     
     Map<InetAddress, EndpointState> epStateMap_ = new HashMap<InetAddress, EndpointState>();
 
-    public static ICompactSerializer<GossipDigestAck2Message> serializer()
+    public static IVersionedSerializer<GossipDigestAck2Message> serializer()
     {
         return serializer_;
     }
@@ -59,18 +57,23 @@ class GossipDigestAck2Message
     }
 }
 
-class GossipDigestAck2MessageSerializer implements ICompactSerializer<GossipDigestAck2Message>
+class GossipDigestAck2MessageSerializer implements IVersionedSerializer<GossipDigestAck2Message>
 {
-    public void serialize(GossipDigestAck2Message gDigestAck2Message, DataOutputStream dos, int version) throws IOException
+    public void serialize(GossipDigestAck2Message gDigestAck2Message, DataOutput dos, int version) throws IOException
     {
         /* Use the EndpointState */
         EndpointStatesSerializationHelper.serialize(gDigestAck2Message.epStateMap_, dos, version);
     }
 
-    public GossipDigestAck2Message deserialize(DataInputStream dis, int version) throws IOException
+    public GossipDigestAck2Message deserialize(DataInput dis, int version) throws IOException
     {
         Map<InetAddress, EndpointState> epStateMap = EndpointStatesSerializationHelper.deserialize(dis, version);
         return new GossipDigestAck2Message(epStateMap);        
     }
+
+    public long serializedSize(GossipDigestAck2Message gossipDigestAck2Message, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java Thu Oct 13 05:08:15 2011
@@ -18,16 +18,14 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 
 
 
@@ -38,7 +36,7 @@ import org.apache.cassandra.io.ICompactS
 
 class GossipDigestAckMessage
 {
-    private static ICompactSerializer<GossipDigestAckMessage> serializer_;
+    private static IVersionedSerializer<GossipDigestAckMessage> serializer_;
     static
     {
         serializer_ = new GossipDigestAckMessageSerializer();
@@ -47,7 +45,7 @@ class GossipDigestAckMessage
     List<GossipDigest> gDigestList_ = new ArrayList<GossipDigest>();
     Map<InetAddress, EndpointState> epStateMap_ = new HashMap<InetAddress, EndpointState>();
     
-    static ICompactSerializer<GossipDigestAckMessage> serializer()
+    static IVersionedSerializer<GossipDigestAckMessage> serializer()
     {
         return serializer_;
     }
@@ -69,20 +67,25 @@ class GossipDigestAckMessage
     }
 }
 
-class GossipDigestAckMessageSerializer implements ICompactSerializer<GossipDigestAckMessage>
+class GossipDigestAckMessageSerializer implements IVersionedSerializer<GossipDigestAckMessage>
 {
-    public void serialize(GossipDigestAckMessage gDigestAckMessage, DataOutputStream dos, int version) throws IOException
+    public void serialize(GossipDigestAckMessage gDigestAckMessage, DataOutput dos, int version) throws IOException
     {
         GossipDigestSerializationHelper.serialize(gDigestAckMessage.gDigestList_, dos, version);
         dos.writeBoolean(true); // 0.6 compatibility
         EndpointStatesSerializationHelper.serialize(gDigestAckMessage.epStateMap_, dos, version);
     }
 
-    public GossipDigestAckMessage deserialize(DataInputStream dis, int version) throws IOException
+    public GossipDigestAckMessage deserialize(DataInput dis, int version) throws IOException
     {
         List<GossipDigest> gDigestList = GossipDigestSerializationHelper.deserialize(dis, version);
         dis.readBoolean(); // 0.6 compatibility
         Map<InetAddress, EndpointState> epStateMap = EndpointStatesSerializationHelper.deserialize(dis, version);
         return new GossipDigestAckMessage(gDigestList, epStateMap);
     }
+
+    public long serializedSize(GossipDigestAckMessage gossipDigestAckMessage, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/GossipDigestSynMessage.java Thu Oct 13 05:08:15 2011
@@ -18,9 +18,7 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -31,7 +29,7 @@ import java.util.Map.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.net.CompactEndpointSerializationHelper;
 
 
@@ -42,7 +40,7 @@ import org.apache.cassandra.net.CompactE
 
 class GossipDigestSynMessage
 {
-    private static ICompactSerializer<GossipDigestSynMessage> serializer_;
+    private static IVersionedSerializer<GossipDigestSynMessage> serializer_;
     static
     {
         serializer_ = new GossipDigestSynMessageSerializer();
@@ -51,7 +49,7 @@ class GossipDigestSynMessage
     String clusterId_;
     List<GossipDigest> gDigests_ = new ArrayList<GossipDigest>();
 
-    public static ICompactSerializer<GossipDigestSynMessage> serializer()
+    public static IVersionedSerializer<GossipDigestSynMessage> serializer()
     {
         return serializer_;
     }
@@ -72,7 +70,7 @@ class GossipDigestSerializationHelper
 {
     private static Logger logger_ = LoggerFactory.getLogger(GossipDigestSerializationHelper.class);
     
-    static void serialize(List<GossipDigest> gDigestList, DataOutputStream dos, int version) throws IOException
+    static void serialize(List<GossipDigest> gDigestList, DataOutput dos, int version) throws IOException
     {
         dos.writeInt(gDigestList.size());
         for ( GossipDigest gDigest : gDigestList )
@@ -81,15 +79,14 @@ class GossipDigestSerializationHelper
         }
     }
 
-    static List<GossipDigest> deserialize(DataInputStream dis, int version) throws IOException
+    static List<GossipDigest> deserialize(DataInput dis, int version) throws IOException
     {
         int size = dis.readInt();            
         List<GossipDigest> gDigests = new ArrayList<GossipDigest>(size);
         
         for ( int i = 0; i < size; ++i )
         {
-            assert dis.available() > 0;
-            gDigests.add(GossipDigest.serializer().deserialize(dis, version));                
+            gDigests.add(GossipDigest.serializer().deserialize(dis, version));
         }        
         return gDigests;
     }
@@ -99,7 +96,7 @@ class EndpointStatesSerializationHelper
 {
     private static final Logger logger_ = LoggerFactory.getLogger(EndpointStatesSerializationHelper.class);
 
-    static void serialize(Map<InetAddress, EndpointState> epStateMap, DataOutputStream dos, int version) throws IOException
+    static void serialize(Map<InetAddress, EndpointState> epStateMap, DataOutput dos, int version) throws IOException
     {
         dos.writeInt(epStateMap.size());
         for (Entry<InetAddress, EndpointState> entry : epStateMap.entrySet())
@@ -110,14 +107,13 @@ class EndpointStatesSerializationHelper
         }
     }
 
-    static Map<InetAddress, EndpointState> deserialize(DataInputStream dis, int version) throws IOException
+    static Map<InetAddress, EndpointState> deserialize(DataInput dis, int version) throws IOException
     {
         int size = dis.readInt();            
         Map<InetAddress, EndpointState> epStateMap = new HashMap<InetAddress, EndpointState>(size);
 
         for ( int i = 0; i < size; ++i )
         {
-            assert dis.available() > 0;
             InetAddress ep = CompactEndpointSerializationHelper.deserialize(dis);
             EndpointState epState = EndpointState.serializer().deserialize(dis, version);
             epStateMap.put(ep, epState);
@@ -126,20 +122,24 @@ class EndpointStatesSerializationHelper
     }
 }
 
-class GossipDigestSynMessageSerializer implements ICompactSerializer<GossipDigestSynMessage>
+class GossipDigestSynMessageSerializer implements IVersionedSerializer<GossipDigestSynMessage>
 {   
-    public void serialize(GossipDigestSynMessage gDigestSynMessage, DataOutputStream dos, int version) throws IOException
+    public void serialize(GossipDigestSynMessage gDigestSynMessage, DataOutput dos, int version) throws IOException
     {    
         dos.writeUTF(gDigestSynMessage.clusterId_);
         GossipDigestSerializationHelper.serialize(gDigestSynMessage.gDigests_, dos, version);
     }
 
-    public GossipDigestSynMessage deserialize(DataInputStream dis, int version) throws IOException
+    public GossipDigestSynMessage deserialize(DataInput dis, int version) throws IOException
     {
         String clusterId = dis.readUTF();
         List<GossipDigest> gDigests = GossipDigestSerializationHelper.deserialize(dis, version);
         return new GossipDigestSynMessage(clusterId, gDigests);
     }
 
+    public long serializedSize(GossipDigestSynMessage gossipDigestSynMessage, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/HeartBeatState.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/HeartBeatState.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/HeartBeatState.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/HeartBeatState.java Thu Oct 13 05:08:15 2011
@@ -18,11 +18,9 @@
 
 package org.apache.cassandra.gms;
 
-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;
 
 
 /**
@@ -31,7 +29,7 @@ import org.apache.cassandra.io.ICompactS
 
 class HeartBeatState
 {
-    private static ICompactSerializer<HeartBeatState> serializer;
+    private static IVersionedSerializer<HeartBeatState> serializer;
     
     static
     {
@@ -52,7 +50,7 @@ class HeartBeatState
         version = ver;
     }
 
-    public static ICompactSerializer<HeartBeatState> serializer()
+    public static IVersionedSerializer<HeartBeatState> serializer()
     {
         return serializer;
     }
@@ -78,16 +76,21 @@ class HeartBeatState
     }
 }
 
-class HeartBeatStateSerializer implements ICompactSerializer<HeartBeatState>
+class HeartBeatStateSerializer implements IVersionedSerializer<HeartBeatState>
 {
-    public void serialize(HeartBeatState hbState, DataOutputStream dos, int version) throws IOException
+    public void serialize(HeartBeatState hbState, DataOutput dos, int version) throws IOException
     {
         dos.writeInt(hbState.getGeneration());
         dos.writeInt(hbState.getHeartBeatVersion());
     }
     
-    public HeartBeatState deserialize(DataInputStream dis, int version) throws IOException
+    public HeartBeatState deserialize(DataInput dis, int version) throws IOException
     {
         return new HeartBeatState(dis.readInt(), dis.readInt());
     }
+
+    public long serializedSize(HeartBeatState heartBeatState, int version)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/VersionedValue.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/VersionedValue.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/VersionedValue.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/gms/VersionedValue.java Thu Oct 13 05:08:15 2011
@@ -18,15 +18,13 @@
 
 package org.apache.cassandra.gms;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.InetAddress;
 import java.util.UUID;
 
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Token;
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.utils.FBUtilities;
 
 
@@ -44,7 +42,7 @@ import org.apache.cassandra.utils.FBUtil
 
 public class VersionedValue implements Comparable<VersionedValue>
 {
-    public static final ICompactSerializer<VersionedValue> serializer = new VersionedValueSerializer();
+    public static final IVersionedSerializer<VersionedValue> serializer = new VersionedValueSerializer();
 
     // this must be a char that cannot be present in any token
     public final static char DELIMITER = ',';
@@ -70,14 +68,14 @@ public class VersionedValue implements C
 
     private VersionedValue(String value, int version)
     {
+        assert value != null;
         this.value = value;
         this.version = version;
     }
 
     private VersionedValue(String value)
     {
-        this.value = value;
-        version = VersionGenerator.getNextVersion();
+        this(value, VersionGenerator.getNextVersion());
     }
 
     public int compareTo(VersionedValue value)
@@ -183,20 +181,25 @@ public class VersionedValue implements C
         }
     }
 
-    private static class VersionedValueSerializer implements ICompactSerializer<VersionedValue>
+    private static class VersionedValueSerializer implements IVersionedSerializer<VersionedValue>
     {
-        public void serialize(VersionedValue value, DataOutputStream dos, int version) throws IOException
+        public void serialize(VersionedValue value, DataOutput dos, int version) throws IOException
         {
             dos.writeUTF(value.value);
             dos.writeInt(value.version);
         }
 
-        public VersionedValue deserialize(DataInputStream dis, int version) throws IOException
+        public VersionedValue deserialize(DataInput dis, int version) throws IOException
         {
             String value = dis.readUTF();
             int valVersion = dis.readInt();
             return new VersionedValue(value, valVersion);
         }
+
+        public long serializedSize(VersionedValue value, int version)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IColumnSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IColumnSerializer.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IColumnSerializer.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IColumnSerializer.java Thu Oct 13 05:08:15 2011
@@ -25,7 +25,7 @@ import java.io.IOException;
 
 import org.apache.cassandra.db.IColumn;
 
-public interface IColumnSerializer extends ICompactSerializer2<IColumn>
+public interface IColumnSerializer extends ISerializer<IColumn>
 {
     public IColumn deserialize(DataInput in, boolean fromRemote, int expireBefore) throws IOException;
 }

Added: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java?rev=1182652&view=auto
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java (added)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/ISerializer.java Thu Oct 13 05:08:15 2011
@@ -0,0 +1,47 @@
+package org.apache.cassandra.io;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public interface ISerializer<T>
+{
+    /**
+     * Serialize the specified type into the specified DataOutput instance.
+     * @param t type that needs to be serialized
+     * @param dos DataOutput into which serialization needs to happen.
+     * @throws java.io.IOException
+     */
+    public void serialize(T t, DataOutput dos) throws IOException;
+
+    /**
+     * Deserialize from the specified DataInput instance.
+     * @param dis DataInput from which deserialization needs to happen.
+     * @throws IOException
+     * @return the type that was deserialized
+     */
+    public T deserialize(DataInput dis) throws IOException;
+
+    public long serializedSize(T t);
+}

Added: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java?rev=1182652&view=auto
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java (added)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/IVersionedSerializer.java Thu Oct 13 05:08:15 2011
@@ -0,0 +1,47 @@
+package org.apache.cassandra.io;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+public interface IVersionedSerializer<T>
+{
+    /**
+     * Serialize the specified type into the specified DataOutputStream instance.
+     * @param t type that needs to be serialized
+     * @param dos DataOutput into which serialization needs to happen.
+     * @throws java.io.IOException
+     */
+    public void serialize(T t, DataOutput dos, int version) throws IOException;
+
+    /**
+     * Deserialize into the specified DataInputStream instance.
+     * @param dis DataInput from which deserialization needs to happen.
+     * @throws IOException
+     * @return the type that was deserialized
+     */
+    public T deserialize(DataInput dis, int version) throws IOException;
+
+    public long serializedSize(T t, int version);
+}

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/SerDeUtils.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/SerDeUtils.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/SerDeUtils.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/SerDeUtils.java Thu Oct 13 05:08:15 2011
@@ -38,7 +38,7 @@ import org.apache.cassandra.io.util.Outp
 import org.apache.cassandra.utils.ByteBufferUtil;
 
 /**
- * Static serialization/deserialization utility functions, intended to eventually replace ICompactSerializers.
+ * Static serialization/deserialization utility functions, intended to eventually replace IVersionedSerializers.
  */
 public final class SerDeUtils
 {

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/IndexHelper.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/IndexHelper.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/IndexHelper.java Thu Oct 13 05:08:15 2011
@@ -131,8 +131,8 @@ public class IndexHelper
 
         DataInputStream stream = new DataInputStream(ByteBufferUtil.inputStream(bytes));
         return useOldBuffer
-                ? LegacyBloomFilter.serializer().deserialize(stream, 0) // version means nothing there.
-                : BloomFilter.serializer().deserialize(stream);
+               ? LegacyBloomFilter.serializer().deserialize(stream)
+               : BloomFilter.serializer().deserialize(stream);
     }
 
     /**

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableMetadata.java Thu Oct 13 05:08:15 2011
@@ -31,7 +31,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.db.commitlog.ReplayPosition;
-import org.apache.cassandra.io.ICompactSerializer2;
+import org.apache.cassandra.io.ISerializer;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.utils.EstimatedHistogram;
 
@@ -168,7 +168,7 @@ public class SSTableMetadata
         }
     }
 
-    public static class SSTableMetadataSerializer implements ICompactSerializer2<SSTableMetadata>
+    public static class SSTableMetadataSerializer implements ISerializer<SSTableMetadata>
     {
         private static final Logger logger = LoggerFactory.getLogger(SSTableMetadataSerializer.class);
 
@@ -220,5 +220,10 @@ public class SSTableMetadata
             long maxTimestamp = dis.readLong();
             return new SSTableMetadata(rowSizes, columnCounts, replayPosition, maxTimestamp);
         }
+
+        public long serializedSize(SSTableMetadata object)
+        {
+            throw new UnsupportedOperationException();
+        }
     }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1182652&r1=1182651&r2=1182652&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java Thu Oct 13 05:08:15 2011
@@ -292,7 +292,7 @@ public class SSTableReader extends SSTab
             stream = new DataInputStream(new BufferedInputStream(new FileInputStream(descriptor.filenameFor(Component.FILTER))));
             if (descriptor.usesOldBloomFilter)
             {
-                bf = LegacyBloomFilter.serializer().deserialize(stream, 0); // version means nothing.
+                bf = LegacyBloomFilter.serializer().deserialize(stream);
             }
             else
             {



Mime
View raw message