cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1060870 [1/2] - in /cassandra/trunk: ./ contrib/stress/src/org/apache/cassandra/contrib/stress/tests/ contrib/stress/src/org/apache/cassandra/contrib/stress/util/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/c...
Date Wed, 19 Jan 2011 17:14:08 GMT
Author: jbellis
Date: Wed Jan 19 17:14:06 2011
New Revision: 1060870

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

Removed:
    cassandra/trunk/src/java/org/apache/cassandra/utils/SafeMessageDigest.java
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/IndexedRangeSlicer.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Inserter.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/MultiGetter.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/RangeSlicer.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Reader.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/util/OperationThread.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/config/CFMetaData.java
    cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/Term.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CounterColumn.java
    cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
    cassandra/trunk/src/java/org/apache/cassandra/db/DeletedColumn.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/RowMutationVerbHandler.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/SystemTable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
    cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java
    cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
    cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/BytesType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
    cassandra/trunk/src/java/org/apache/cassandra/io/CompactionIterator.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
    cassandra/trunk/src/java/org/apache/cassandra/service/DigestMismatchException.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableImport.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/GuidGenerator.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/CounterColumnTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/hadoop/ColumnFamilyInputFormatTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/io/sstable/SSTableTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/tools/SSTableExportTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/tools/SSTableImportTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/utils/FBUtilitiesTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7:1026516-1060447
+/cassandra/branches/cassandra-0.7:1026516-1060862
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Jan 19 17:14:06 2011
@@ -31,6 +31,7 @@
  * fix copy bounds for word Text in wordcount demo (CASSANDRA-1993)
  * fixes for contrib/javautils (CASSANDRA-1979)
  * check more frequently for memtable expiration (CASSANDRA-2000)
+ * fix writing SSTable column count statistics (CASSANDRA-1976)
 
 
 0.7.0-final

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/IndexedRangeSlicer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/IndexedRangeSlicer.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/IndexedRangeSlicer.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/IndexedRangeSlicer.java Wed Jan 19 17:14:06 2011
@@ -68,19 +68,15 @@ public class IndexedRangeSlicer extends 
 
                     if (results.size() == 0)
                     {
-                        throw new RuntimeException("No indexed values from offset received: " + startOffset);
-                    }
-                }
-                catch (InvalidRequestException e)
-                {
-                    System.err.println(e.getWhy());
+                        System.err.printf("No indexed values from offset received: %s%n", startOffset);
 
-                    if (!session.ignoreErrors())
-                        return;
+                        if (!session.ignoreErrors())
+                            break;
+                    }
                 }
                 catch (Exception e)
                 {
-                    System.err.println(e.getMessage());
+                    System.err.printf("Error on get_indexed_slices call for offset  %s - %s%n", startOffset, getExceptionMessage(e));
 
                     if (!session.ignoreErrors())
                         return;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Inserter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Inserter.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Inserter.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Inserter.java Wed Jan 19 17:14:06 2011
@@ -19,10 +19,8 @@ package org.apache.cassandra.contrib.str
 
 import org.apache.cassandra.contrib.stress.util.OperationThread;
 import org.apache.cassandra.db.ColumnFamilyType;
-import org.apache.cassandra.thrift.Column;
-import org.apache.cassandra.thrift.ColumnOrSuperColumn;
-import org.apache.cassandra.thrift.Mutation;
-import org.apache.cassandra.thrift.SuperColumn;
+import org.apache.cassandra.thrift.*;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
@@ -85,7 +83,7 @@ public class Inserter extends OperationT
             }
             catch (Exception e)
             {
-                System.err.println(e.getMessage());
+                System.err.printf("Error while inserting key %s - %s%n", ByteBufferUtil.string(key), getExceptionMessage(e));
 
                 if (!session.ignoreErrors())
                     return;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/MultiGetter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/MultiGetter.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/MultiGetter.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/MultiGetter.java Wed Jan 19 17:14:06 2011
@@ -61,19 +61,15 @@ public class MultiGetter extends Operati
 
                         if (results.size() == 0)
                         {
-                            throw new RuntimeException(String.format("Keys %s not found", keys));
-                        }
-                    }
-                    catch (InvalidRequestException e)
-                    {
-                        System.err.println(e.getWhy());
+                            System.err.printf("Keys %s were not found.%n", keys);
 
-                        if (!session.ignoreErrors())
-                            return;
+                            if (!session.ignoreErrors())
+                                break;
+                        }
                     }
                     catch (Exception e)
                     {
-                        System.err.println(e.getMessage());
+                        System.err.printf("Error on multiget_slice call - %s%n", getExceptionMessage(e));
 
                         if (!session.ignoreErrors())
                             return;
@@ -103,19 +99,15 @@ public class MultiGetter extends Operati
 
                     if (results.size() == 0)
                     {
-                        throw new RuntimeException(String.format("Keys %s not found", keys));
-                    }
-                }
-                catch (InvalidRequestException e)
-                {
-                    System.err.println(e.getWhy());
+                        System.err.printf("Keys %s were not found.%n", keys);
 
-                    if (!session.ignoreErrors())
-                        return;
+                        if (!session.ignoreErrors())
+                            break;
+                    }
                 }
                 catch (Exception e)
                 {
-                    System.err.println(e.getMessage());
+                    System.err.printf("Error on multiget_slice call - %s%n", getExceptionMessage(e));
 
                     if (!session.ignoreErrors())
                         return;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/RangeSlicer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/RangeSlicer.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/RangeSlicer.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/RangeSlicer.java Wed Jan 19 17:14:06 2011
@@ -70,19 +70,15 @@ public class RangeSlicer extends Operati
 
                         if (slices.size() == 0)
                         {
-                            throw new RuntimeException(String.format("Key %s not found.", superColumnName));
-                        }
-                    }
-                    catch (InvalidRequestException e)
-                    {
-                        System.err.println(e.getWhy());
+                            System.err.printf("Range %s->%s not found in Super Column %s.%n", new String(start), new String(end), superColumnName);
 
-                        if (!session.ignoreErrors())
-                            return;
+                            if (!session.ignoreErrors())
+                                break;
+                        }
                     }
                     catch (Exception e)
                     {
-                        System.err.println(e.getMessage());
+                        System.err.printf("Error while reading Super Column %s - %s%n", superColumnName, getExceptionMessage(e));
 
                         if (!session.ignoreErrors())
                             return;
@@ -117,20 +113,15 @@ public class RangeSlicer extends Operati
 
                     if (slices.size() == 0)
                     {
-                        throw new RuntimeException(String.format("Range %s %s not found.", String.format(format, current),
-                                                                                           String.format(format, last)));
-                    }
-                }
-                catch (InvalidRequestException e)
-                {
-                    System.err.println(e.getWhy());
+                        System.err.printf("Range %s->%s not found.%n", String.format(format, current), String.format(format, last));
 
-                    if (!session.ignoreErrors())
-                        return;
+                        if (!session.ignoreErrors())
+                            break;
+                    }
                 }
                 catch (Exception e)
                 {
-                    System.err.println(e.getMessage());
+                    System.err.printf("Error while reading range %s->%s - %s%n", String.format(format, current), String.format(format, last), getExceptionMessage(e));
 
                     if (!session.ignoreErrors())
                         return;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Reader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Reader.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Reader.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/Reader.java Wed Jan 19 17:14:06 2011
@@ -19,10 +19,8 @@ package org.apache.cassandra.contrib.str
 
 import org.apache.cassandra.contrib.stress.util.OperationThread;
 import org.apache.cassandra.db.ColumnFamilyType;
-import org.apache.cassandra.thrift.ColumnOrSuperColumn;
-import org.apache.cassandra.thrift.ColumnParent;
-import org.apache.cassandra.thrift.SlicePredicate;
-import org.apache.cassandra.thrift.SliceRange;
+import org.apache.cassandra.thrift.*;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 import java.nio.ByteBuffer;
 import java.util.List;
@@ -77,7 +75,7 @@ public class Reader extends OperationThr
 
                     if (columns.size() == 0)
                     {
-                        System.err.println(String.format("Key %s not found.", superColumn));
+                        System.err.printf("Key %s not found in Super Column %s.%n", ByteBufferUtil.string(key), superColumn);
 
                         if (!session.ignoreErrors())
                             break;
@@ -85,7 +83,7 @@ public class Reader extends OperationThr
                 }
                 catch (Exception e)
                 {
-                    System.err.println(e.getMessage());
+                    System.err.printf("Error while reading Super Column %s key %s - %s%n", superColumn, ByteBufferUtil.string(key), getExceptionMessage(e));
 
                     if (!session.ignoreErrors())
                         break;
@@ -124,7 +122,7 @@ public class Reader extends OperationThr
             }
             catch (Exception e)
             {
-                System.err.println(e.getMessage());
+                System.err.printf("Error while reading key %s - %s%n", new String(key), getExceptionMessage(e));
 
                 if (!session.ignoreErrors())
                     break;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/util/OperationThread.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/util/OperationThread.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/util/OperationThread.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/util/OperationThread.java Wed Jan 19 17:14:06 2011
@@ -20,6 +20,7 @@ package org.apache.cassandra.contrib.str
 import org.apache.cassandra.contrib.stress.Session;
 import org.apache.cassandra.contrib.stress.Stress;
 import org.apache.cassandra.thrift.Cassandra;
+import org.apache.cassandra.thrift.InvalidRequestException;
 
 import java.math.BigInteger;
 import java.security.MessageDigest;
@@ -178,4 +179,11 @@ public abstract class OperationThread ex
         return result.toString();
     }
 
+    protected String getExceptionMessage(Exception e)
+    {
+        String className = e.getClass().getSimpleName();
+        String message = (e instanceof InvalidRequestException) ? ((InvalidRequestException) e).getWhy() : e.getMessage();
+        return (message == null) ? "(" + className + ")" : String.format("(%s): %s", className, message);
+    }
+
 }

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1060447
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1060862
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1060447
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1060862
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1060447
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1060862
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1060447
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1060862
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 19 17:14:06 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1060447
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1060862
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java Wed Jan 19 17:14:06 2011
@@ -41,7 +41,6 @@ import org.apache.cassandra.db.marshal.U
 import org.apache.cassandra.db.migration.Migration;
 import org.apache.cassandra.io.SerDeUtils;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
 
 
@@ -360,7 +359,7 @@ public final class CFMetaData
     /** convention for nameing secondary indexes. */
     public static String indexName(String parentCf, ColumnDefinition info)
     {
-        return parentCf + "." + (info.getIndexName() == null ? FBUtilities.bytesToHex(info.name) : info.getIndexName());
+        return parentCf + "." + (info.getIndexName() == null ? ByteBufferUtil.bytesToHex(info.name) : info.getIndexName());
     }
 
     public org.apache.cassandra.db.migration.avro.CfDef deflate()

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java Wed Jan 19 17:14:06 2011
@@ -32,7 +32,6 @@ import org.apache.cassandra.db.marshal.A
 import org.apache.cassandra.thrift.ColumnDef;
 import org.apache.cassandra.thrift.IndexType;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class ColumnDefinition
 {
@@ -156,7 +155,7 @@ public class ColumnDefinition
     public String toString()
     {
         return "ColumnDefinition{" +
-               "name=" + FBUtilities.bytesToHex(name) +
+               "name=" + ByteBufferUtil.bytesToHex(name) +
                ", validator=" + validator +
                ", index_type=" + index_type +
                ", index_name='" + index_name + '\'' +

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/Term.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/Term.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/Term.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/Term.java Wed Jan 19 17:14:06 2011
@@ -22,6 +22,7 @@ package org.apache.cassandra.cql;
 
 import java.nio.ByteBuffer;
 
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
 /**
@@ -74,7 +75,7 @@ public class Term
             case STRING:
                 return ByteBuffer.wrap(text.getBytes());
             case LONG:
-                return FBUtilities.toByteBuffer(Long.parseLong(text));
+                return ByteBufferUtil.bytes(Long.parseLong(text));
         }
         
         // FIXME: handle scenario that should never happen

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Jan 19 17:14:06 2011
@@ -180,7 +180,7 @@ public class ColumnFamilyStore implement
                 ColumnFamilyStore indexCfs = indexedColumns.remove(indexName);
                 if (indexCfs == null)
                 {
-                    logger.debug("index {} already removed; ignoring", FBUtilities.bytesToHex(indexName));
+                    logger.debug("index {} already removed; ignoring", ByteBufferUtil.bytesToHex(indexName));
                     continue;
                 }
                 indexCfs.unregisterMBean();

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java Wed Jan 19 17:14:06 2011
@@ -32,7 +32,6 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.io.ICompactSerializer2;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class ColumnSerializer implements ICompactSerializer2<IColumn>
 {
@@ -75,7 +74,7 @@ public class ColumnSerializer implements
 
     public Column deserialize(DataInput dis) throws IOException
     {
-        ByteBuffer name = FBUtilities.readShortByteArray(dis);
+        ByteBuffer name = ByteBufferUtil.readWithShortLength(dis);
         if (name.remaining() <= 0)
             throw new CorruptColumnException("invalid column name length " + name.remaining());
 
@@ -83,10 +82,10 @@ public class ColumnSerializer implements
         if ((b & COUNTER_MASK) != 0)
         {
             long timestampOfLastDelete = dis.readLong();
-            ByteBuffer pc = FBUtilities.readShortByteArray(dis);
+            ByteBuffer pc = ByteBufferUtil.readWithShortLength(dis);
             byte[] partitionedCounter = ByteBufferUtil.getArray(pc);
             long timestamp = dis.readLong();
-            ByteBuffer value = FBUtilities.readByteArray(dis);
+            ByteBuffer value = ByteBufferUtil.readWithLength(dis);
             return new CounterColumn(name, value, timestamp, partitionedCounter, timestampOfLastDelete);
         }
         else if ((b & EXPIRATION_MASK) != 0)
@@ -94,7 +93,7 @@ public class ColumnSerializer implements
             int ttl = dis.readInt();
             int expiration = dis.readInt();
             long ts = dis.readLong();
-            ByteBuffer value = FBUtilities.readByteArray(dis);
+            ByteBuffer value = ByteBufferUtil.readWithLength(dis);
             if ((int) (System.currentTimeMillis() / 1000 ) > expiration)
             {
                 // the column is now expired, we can safely return a simple
@@ -112,7 +111,7 @@ public class ColumnSerializer implements
         else
         {
             long ts = dis.readLong();
-            ByteBuffer value = FBUtilities.readByteArray(dis);
+            ByteBuffer value = ByteBufferUtil.readWithLength(dis);
             return (b & DELETION_MASK) == 0
                    ? new Column(name, value, ts)
                    : new DeletedColumn(name, value, ts);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java Wed Jan 19 17:14:06 2011
@@ -363,10 +363,17 @@ public class CompactionManager implement
     {
         // The collection of sstables passed may be empty (but not null); even if
         // it is not empty, it may compact down to nothing if all rows are deleted.
+        assert sstables != null;
+
         Table table = cfs.table;
         if (DatabaseDescriptor.isSnapshotBeforeCompaction())
             table.snapshot("compact-" + cfs.columnFamily);
+
+        // sanity check: all sstables must belong to the same cfs
         logger.info("Compacting [" + StringUtils.join(sstables, ",") + "]");
+        for (SSTableReader sstable : sstables)
+            assert sstable.descriptor.cfname.equals(cfs.columnFamily);
+
         String compactionFileLocation = table.getDataFileLocation(cfs.getExpectedCompactedFileSize(sstables));
         // If the compaction file path is null that means we have no space left for this compaction.
         // try again w/o the largest one.

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/CounterColumn.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/CounterColumn.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CounterColumn.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CounterColumn.java Wed Jan 19 17:14:06 2011
@@ -112,9 +112,9 @@ public class CounterColumn extends Colum
     {
         digest.update(name.duplicate());
         digest.update(value.duplicate());
-        digest.update(FBUtilities.toByteArray(timestamp));
+        digest.update(ByteBufferUtil.bytes(timestamp));
         digest.update(partitionedCounter);
-        digest.update(FBUtilities.toByteArray(timestampOfLastDelete));
+        digest.update(ByteBufferUtil.bytes(timestampOfLastDelete));
     }
 
     @Override
@@ -176,7 +176,7 @@ public class CounterColumn extends Colum
 		{
 			long mergedValue = value().getLong(value().arrayOffset()) +
                                column.value().getLong(column.value().arrayOffset());
-			byteBufferValue = FBUtilities.toByteBuffer(mergedValue);
+			byteBufferValue = ByteBufferUtil.bytes(mergedValue);
 		} else
 			byteBufferValue = ByteBuffer.wrap(contextManager.total(mergedPartitionedCounter));
         return new CounterColumn(

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java Wed Jan 19 17:14:06 2011
@@ -24,7 +24,7 @@ import java.util.Comparator;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 /**
  * Represents a decorated key, handy for certain operations
@@ -91,7 +91,7 @@ public class DecoratedKey<T extends Toke
     @Override
     public String toString()
     {
-        String keystring = key == null ? "null" : FBUtilities.bytesToHex(key);
+        String keystring = key == null ? "null" : ByteBufferUtil.bytesToHex(key);
         return "DecoratedKey(" + token + ", " + keystring + ")";
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/DeletedColumn.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/DeletedColumn.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/DeletedColumn.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/DeletedColumn.java Wed Jan 19 17:14:06 2011
@@ -24,7 +24,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class DeletedColumn extends Column
 {
@@ -32,7 +31,7 @@ public class DeletedColumn extends Colum
     
     public DeletedColumn(ByteBuffer name, int localDeletionTime, long timestamp)
     {
-        this(name, FBUtilities.toByteBuffer(localDeletionTime), timestamp);
+        this(name, ByteBufferUtil.bytes(localDeletionTime), timestamp);
     }
 
     public DeletedColumn(ByteBuffer name, ByteBuffer value, long timestamp)

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java Wed Jan 19 17:14:06 2011
@@ -30,6 +30,7 @@ import org.apache.cassandra.net.IVerbHan
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.service.StorageService;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
 public class ReadVerbHandler implements IVerbHandler
@@ -70,7 +71,7 @@ public class ReadVerbHandler implements 
             if (command.isDigestQuery())
             {
                 if (logger_.isDebugEnabled())
-                    logger_.debug("digest is " + FBUtilities.bytesToHex(ColumnFamily.digest(row.cf)));
+                    logger_.debug("digest is " + ByteBufferUtil.bytesToHex(ColumnFamily.digest(row.cf)));
                 readResponse = new ReadResponse(ColumnFamily.digest(row.cf));
             }
             else
@@ -88,7 +89,7 @@ public class ReadVerbHandler implements 
             Message response = message.getReply(FBUtilities.getLocalAddress(), bytes);
             if (logger_.isDebugEnabled())
               logger_.debug(String.format("Read key %s; sending response to %s@%s",
-                                          FBUtilities.bytesToHex(command.key), message.getMessageId(), message.getFrom()));
+                                          ByteBufferUtil.bytesToHex(command.key), message.getMessageId(), message.getFrom()));
             MessagingService.instance().sendOneWay(response, 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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Row.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Row.java Wed Jan 19 17:14:06 2011
@@ -28,7 +28,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.io.ICompactSerializer;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class Row
 {
@@ -71,7 +70,7 @@ class RowSerializer implements ICompactS
 
     public Row deserialize(DataInputStream dis) throws IOException
     {
-        return new Row(StorageService.getPartitioner().decorateKey(FBUtilities.readShortByteArray(dis)),
+        return new Row(StorageService.getPartitioner().decorateKey(ByteBufferUtil.readWithShortLength(dis)),
                        ColumnFamily.serializer().deserialize(dis));
     }
 }

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Wed Jan 19 17:14:06 2011
@@ -263,7 +263,7 @@ public class RowMutation implements IMut
     {
         StringBuilder buff = new StringBuilder("RowMutation(");
         buff.append("keyspace='").append(table_).append('\'');
-        buff.append(", key='").append(FBUtilities.bytesToHex(key_)).append('\'');
+        buff.append(", key='").append(ByteBufferUtil.bytesToHex(key_)).append('\'');
         buff.append(", modifications=[");
         if (shallow)
         {
@@ -391,7 +391,7 @@ class RowMutationSerializer implements I
     public RowMutation deserialize(DataInputStream dis) throws IOException
     {
         String table = dis.readUTF();
-        ByteBuffer key = FBUtilities.readShortByteArray(dis);
+        ByteBuffer key = ByteBufferUtil.readWithShortLength(dis);
         Map<Integer, ColumnFamily> modifications = defreezeTheMaps(dis);
         return new RowMutation(table, key, modifications);
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java Wed Jan 19 17:14:06 2011
@@ -58,7 +58,7 @@ public class RowMutationVerbHandler impl
                 DataInputStream dis = new DataInputStream(new ByteArrayInputStream(hintedBytes));
                 while (dis.available() > 0)
                 {
-                    ByteBuffer addressBytes = FBUtilities.readShortByteArray(dis);
+                    ByteBuffer addressBytes = ByteBufferUtil.readWithShortLength(dis);
                     if (logger_.isDebugEnabled())
                         logger_.debug("Adding hint for " + InetAddress.getByName(ByteBufferUtil.string(addressBytes, Charsets.UTF_8)));
                     RowMutation hintedMutation = new RowMutation(Table.SYSTEM_TABLE, addressBytes);

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java Wed Jan 19 17:14:06 2011
@@ -28,7 +28,6 @@ import org.apache.cassandra.db.filter.Qu
 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
 {
@@ -66,7 +65,7 @@ public class SliceByNamesReadCommand ext
     {
         return "SliceByNamesReadCommand(" +
                "table='" + table + '\'' +
-               ", key=" + FBUtilities.bytesToHex(key) +
+               ", key=" + ByteBufferUtil.bytesToHex(key) +
                ", columnParent='" + queryPath + '\'' +
                ", columns=[" + getComparator().getString(columnNames) + "]" +
                ')';
@@ -99,14 +98,14 @@ class SliceByNamesReadCommandSerializer 
     {
         boolean isDigest = dis.readBoolean();
         String table = dis.readUTF();
-        ByteBuffer key = FBUtilities.readShortByteArray(dis);
+        ByteBuffer key = ByteBufferUtil.readWithShortLength(dis);
         QueryPath columnParent = QueryPath.deserialize(dis);
 
         int size = dis.readInt();
         List<ByteBuffer> columns = new ArrayList<ByteBuffer>();
         for (int i = 0; i < size; ++i)
         {
-            columns.add(FBUtilities.readShortByteArray(dis));
+            columns.add(ByteBufferUtil.readWithShortLength(dis));
         }
         SliceByNamesReadCommand rm = new SliceByNamesReadCommand(table, key, columnParent, columns);
         rm.setDigestQuery(isDigest);

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java Wed Jan 19 17:14:06 2011
@@ -27,7 +27,6 @@ import org.apache.cassandra.db.filter.Qu
 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
 {
@@ -69,7 +68,7 @@ public class SliceFromReadCommand extend
     {
         return "SliceFromReadCommand(" +
                "table='" + table + '\'' +
-               ", key='" + FBUtilities.bytesToHex(key) + '\'' +
+               ", key='" + ByteBufferUtil.bytesToHex(key) + '\'' +
                ", column_parent='" + queryPath + '\'' +
                ", start='" + getComparator().getString(start) + '\'' +
                ", finish='" + getComparator().getString(finish) + '\'' +
@@ -100,10 +99,10 @@ class SliceFromReadCommandSerializer ext
     {
         boolean isDigest = dis.readBoolean();
         SliceFromReadCommand rm = new SliceFromReadCommand(dis.readUTF(),
-                                                           FBUtilities.readShortByteArray(dis),
+                                                           ByteBufferUtil.readWithShortLength(dis),
                                                            QueryPath.deserialize(dis),
-                                                           FBUtilities.readShortByteArray(dis),
-                                                           FBUtilities.readShortByteArray(dis),
+                                                           ByteBufferUtil.readWithShortLength(dis),
+                                                           ByteBufferUtil.readWithShortLength(dis),
                                                            dis.readBoolean(),
                                                            dis.readInt());
         rm.setDigestQuery(isDigest);

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SuperColumn.java Wed Jan 19 17:14:06 2011
@@ -356,7 +356,7 @@ class SuperColumnSerializer implements I
 
     public IColumn deserialize(DataInput dis) throws IOException
     {
-        ByteBuffer name = FBUtilities.readShortByteArray(dis);
+        ByteBuffer name = ByteBufferUtil.readWithShortLength(dis);
         int localDeleteTime = dis.readInt();
         if (localDeleteTime != Integer.MIN_VALUE && localDeleteTime <= 0)
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java Wed Jan 19 17:14:06 2011
@@ -283,13 +283,13 @@ public class SystemTable
         }
         else
         {
-            generation = Math.max(FBUtilities.byteBufferToInt(cf.getColumn(GENERATION).value()) + 1,
+            generation = Math.max(ByteBufferUtil.toInt(cf.getColumn(GENERATION).value()) + 1,
                                   (int) (System.currentTimeMillis() / 1000));
         }
 
         RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, LOCATION_KEY);
         cf = ColumnFamily.create(Table.SYSTEM_TABLE, SystemTable.STATUS_CF);
-        cf.addColumn(new Column(GENERATION, FBUtilities.toByteBuffer(generation), FBUtilities.timestampMicros()));
+        cf.addColumn(new Column(GENERATION, ByteBufferUtil.bytes(generation), FBUtilities.timestampMicros()));
         rm.add(cf);
         rm.apply();
         forceBlockingFlush(STATUS_CF);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Wed Jan 19 17:14:06 2011
@@ -51,7 +51,6 @@ import org.apache.cassandra.io.util.File
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 import org.cliffc.high_scale_lib.NonBlockingHashMap;
 
 public class Table
@@ -397,7 +396,7 @@ public class Table
     {
         List<Memtable> memtablesToFlush = Collections.emptyList();
         if (logger.isDebugEnabled())
-            logger.debug("applying mutation of row {}", FBUtilities.bytesToHex(mutation.key()));
+            logger.debug("applying mutation of row {}", ByteBufferUtil.bytesToHex(mutation.key()));
 
         // write the mutation to the commitlog and memtables
         flusherLock.readLock().lock();
@@ -431,7 +430,7 @@ public class Table
                             ByteBuffer value = cf.getColumn(column) == null ? null : cf.getColumn(column).value(); // may be null on row-level deletion
                             logger.debug(String.format("mutating indexed column %s value %s",
                                                        cf.getComparator().getString(column),
-                                                       value == null ? "null" : FBUtilities.bytesToHex(value)));
+                                                       value == null ? "null" : ByteBufferUtil.bytesToHex(value)));
                         }
                     }
                 }
@@ -691,7 +690,7 @@ public class Table
             Collection<IColumn> columns = columnFamily.getSortedColumns();
             for (IColumn column : columns)
             {
-                ColumnFamilyStore cfStore = columnFamilyStores.get(FBUtilities.byteBufferToInt(column.name()));
+                ColumnFamilyStore cfStore = columnFamilyStores.get(ByteBufferUtil.toInt(column.name()));
                 cfStore.applyBinary(key, column.value());
             }
         }

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=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java Wed Jan 19 17:14:06 2011
@@ -89,7 +89,7 @@ public class WriteResponse 
         public WriteResponse deserialize(DataInputStream dis) throws IOException
         {
             String table = dis.readUTF();
-            ByteBuffer key = FBUtilities.readShortByteArray(dis);
+            ByteBuffer key = ByteBufferUtil.readWithShortLength(dis);
             boolean status = dis.readBoolean();
             return new WriteResponse(table, key, status);
         }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java Wed Jan 19 17:14:06 2011
@@ -39,8 +39,8 @@ import org.apache.cassandra.io.sstable.S
 import org.apache.cassandra.io.util.FileDataInput;
 import org.apache.cassandra.io.util.FileMark;
 import org.apache.cassandra.io.util.FileUtils;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.Filter;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class SSTableNamesIterator extends SimpleAbstractColumnIterator implements IColumnIterator
 {
@@ -65,7 +65,7 @@ public class SSTableNamesIterator extend
         {
             DecoratedKey keyInDisk = SSTableReader.decodeKey(sstable.partitioner,
                                                              sstable.descriptor,
-                                                             FBUtilities.readShortByteArray(file));
+                                                             ByteBufferUtil.readWithShortLength(file));
             assert keyInDisk.equals(key) : String.format("%s != %s in %s", keyInDisk, key, file.getPath());
             SSTableReader.readRowSize(file, sstable.descriptor);
             read(sstable, file);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java Wed Jan 19 17:14:06 2011
@@ -32,7 +32,7 @@ import org.apache.cassandra.db.Decorated
 import org.apache.cassandra.db.IColumn;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.util.FileDataInput;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 /**
  *  A Column Iterator over SSTable
@@ -54,7 +54,7 @@ public class SSTableSliceIterator implem
         {
             DecoratedKey keyInDisk = SSTableReader.decodeKey(sstable.partitioner,
                                                              sstable.descriptor,
-                                                             FBUtilities.readShortByteArray(fileToClose));
+                                                             ByteBufferUtil.readWithShortLength(fileToClose));
             assert keyInDisk.equals(key)
                    : String.format("%s != %s in %s", keyInDisk, key, fileToClose.getPath());
             SSTableReader.readRowSize(fileToClose, sstable.descriptor);

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=1060870&r1=1060869&r2=1060870&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 Wed Jan 19 17:14:06 2011
@@ -29,7 +29,6 @@ import java.nio.ByteBuffer;
 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
 {
@@ -92,8 +91,8 @@ public class QueryPath
     public static QueryPath deserialize(DataInputStream din) throws IOException
     {
         String cfName = din.readUTF();
-        ByteBuffer scName = FBUtilities.readShortByteArray(din);
-        ByteBuffer cName = FBUtilities.readShortByteArray(din);
+        ByteBuffer scName = ByteBufferUtil.readWithShortLength(din);
+        ByteBuffer cName = ByteBufferUtil.readWithShortLength(din);
         return new QueryPath(cfName.isEmpty() ? null : cfName, 
                              scName.remaining() == 0 ? null : scName, 
                              cName.remaining() == 0 ? null : cName);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/BytesType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/BytesType.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/BytesType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/BytesType.java Wed Jan 19 17:14:06 2011
@@ -24,7 +24,6 @@ package org.apache.cassandra.db.marshal;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class BytesType extends AbstractType
 {
@@ -44,7 +43,7 @@ public class BytesType extends AbstractT
 
     public String getString(ByteBuffer bytes)
     {
-        return FBUtilities.bytesToHex(bytes);
+        return ByteBufferUtil.bytesToHex(bytes);
     }
 
     public ByteBuffer fromString(String source)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java Wed Jan 19 17:14:06 2011
@@ -25,7 +25,7 @@ import org.apache.commons.lang.NotImplem
 
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Token;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 /** for sorting columns representing row keys in the row ordering as determined by a partitioner.
  * Not intended for user-defined CFs, and will in fact error out if used with such. */
@@ -40,7 +40,7 @@ public class LocalByPartionerType<T exte
 
     public String getString(ByteBuffer bytes)
     {
-        return FBUtilities.bytesToHex(bytes);
+        return ByteBufferUtil.bytesToHex(bytes);
     }
 
     public ByteBuffer fromString(String source)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java Wed Jan 19 17:14:06 2011
@@ -24,7 +24,6 @@ package org.apache.cassandra.db.marshal;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 public class LongType extends AbstractType
 {
@@ -79,7 +78,7 @@ public class LongType extends AbstractTy
             throw new RuntimeException("'" + source + "' could not be translated into a LongType.");
         }
 
-        return FBUtilities.toByteBuffer(longType);
+        return ByteBufferUtil.bytes(longType);
     }
 
     public void validate(ByteBuffer bytes) throws MarshalException

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/CompactionIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/CompactionIterator.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/CompactionIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/CompactionIterator.java Wed Jan 19 17:14:06 2011
@@ -36,6 +36,7 @@ import org.apache.cassandra.db.ColumnFam
 import org.apache.cassandra.io.sstable.SSTableIdentityIterator;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.sstable.SSTableScanner;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.ReducingIterator;
 
@@ -132,7 +133,7 @@ implements Closeable, ICompactionInfo
         if (rowSize > DatabaseDescriptor.getInMemoryCompactionLimit())
         {
             logger.info(String.format("Compacting large row %s (%d bytes) incrementally",
-                                      FBUtilities.bytesToHex(rows.get(0).getKey().key), rowSize));
+                                      ByteBufferUtil.bytesToHex(rows.get(0).getKey().key), rowSize));
             return new LazilyCompactedRow(cfs, rows, major, gcBefore);
         }
         return new PrecompactedRow(cfs, rows, major, gcBefore);

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/IndexHelper.java Wed Jan 19 17:14:06 2011
@@ -103,7 +103,7 @@ public class IndexHelper
         int size = file.readInt();
         ByteBuffer bytes = file.readBytes(size);
 
-        DataInputStream stream = new DataInputStream(FBUtilities.inputStream(bytes));
+        DataInputStream stream = new DataInputStream(ByteBufferUtil.inputStream(bytes));
 
         return useOldBuffer
                 ? LegacyBloomFilter.serializer().deserialize(stream)
@@ -178,7 +178,7 @@ public class IndexHelper
 
         public static IndexInfo deserialize(FileDataInput dis) throws IOException
         {
-            return new IndexInfo(FBUtilities.readShortByteArray(dis), FBUtilities.readShortByteArray(dis), dis.readLong(), dis.readLong());
+            return new IndexInfo(ByteBufferUtil.readWithShortLength(dis), ByteBufferUtil.readWithShortLength(dis), dis.readLong(), dis.readLong());
         }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java Wed Jan 19 17:14:06 2011
@@ -32,7 +32,7 @@ import com.google.common.collect.Abstrac
 import org.apache.cassandra.db.DecoratedKey;
 import org.apache.cassandra.io.util.BufferedRandomAccessFile;
 import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 public class KeyIterator extends AbstractIterator<DecoratedKey> implements Iterator<DecoratedKey>, Closeable
 {
@@ -61,7 +61,7 @@ public class KeyIterator extends Abstrac
         {
             if (in.isEOF())
                 return endOfData();
-            DecoratedKey key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, FBUtilities.readShortByteArray(in));
+            DecoratedKey key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, ByteBufferUtil.readWithShortLength(in));
             in.readLong(); // skip data position
             return key;
         }

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java Wed Jan 19 17:14:06 2011
@@ -34,8 +34,8 @@ import org.apache.cassandra.config.CFMet
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.io.util.BufferedRandomAccessFile;
 import org.apache.cassandra.io.util.FileUtils;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.EstimatedHistogram;
-import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
 
 /**
@@ -209,7 +209,7 @@ public abstract class SSTable
         while (dataPosition < BYTES_CAP && keys < SAMPLES_CAP)
         {
             dfile.seek(dataPosition);
-            FBUtilities.skipShortByteArray(dfile);
+            ByteBufferUtil.skipShortLength(dfile);
             long dataSize = SSTableReader.readRowSize(dfile, desc);
             dataPosition = dfile.getFilePointer() + dataSize;
             keys++;
@@ -226,7 +226,7 @@ public abstract class SSTable
         int keys = 0;
         while (ifile.getFilePointer() < BYTES_CAP && keys < SAMPLES_CAP)
         {
-            FBUtilities.skipShortByteArray(ifile);
+            ByteBufferUtil.skipShortLength(ifile);
             ifile.skipBytes(8);
             keys++;
         }

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java Wed Jan 19 17:14:06 2011
@@ -295,9 +295,9 @@ public class SSTableReader extends SSTab
                     break;
 
                 boolean shouldAddEntry = indexSummary.shouldAddEntry();
-                ByteBuffer key = (ByteBuffer) ((shouldAddEntry || cacheLoading || recreatebloom)
-                             ? FBUtilities.readShortByteArray(input)
-                             : FBUtilities.skipShortByteArray(input));
+                ByteBuffer key = (shouldAddEntry || cacheLoading || recreatebloom)
+                             ? ByteBufferUtil.readWithShortLength(input)
+                             : ByteBufferUtil.skipShortLength(input);
                 long dataPosition = input.readLong();
                 if (key != null)
                 {
@@ -469,7 +469,7 @@ public class SSTableReader extends SSTab
                 while (!input.isEOF())
                 {
                     // read key & data position from index entry
-                    DecoratedKey indexDecoratedKey = decodeKey(partitioner, descriptor, FBUtilities.readShortByteArray(input));
+                    DecoratedKey indexDecoratedKey = decodeKey(partitioner, descriptor, ByteBufferUtil.readWithShortLength(input));
                     long dataPosition = input.readLong();
 
                     int comparison = indexDecoratedKey.compareTo(decoratedKey);

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java Wed Jan 19 17:14:06 2011
@@ -33,7 +33,7 @@ import org.apache.cassandra.db.Decorated
 import org.apache.cassandra.db.columniterator.IColumnIterator;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.io.util.BufferedRandomAccessFile;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 
 public class SSTableScanner implements Iterator<IColumnIterator>, Closeable
@@ -169,7 +169,7 @@ public class SSTableScanner implements I
 
                 DecoratedKey key = SSTableReader.decodeKey(sstable.partitioner,
                                                            sstable.descriptor,
-                                                           FBUtilities.readShortByteArray(file));
+                                                           ByteBufferUtil.readWithShortLength(file));
                 long dataSize = SSTableReader.readRowSize(file, sstable.descriptor);
                 long dataStart = file.getFilePointer();
                 finishedAt = dataStart + dataSize;

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java Wed Jan 19 17:14:06 2011
@@ -197,7 +197,7 @@ public class SSTableWriter extends SSTab
     {
         DataOutputStream out = new DataOutputStream(new FileOutputStream(desc.filenameFor(SSTable.COMPONENT_STATS)));
         EstimatedHistogram.serializer.serialize(rowSizes, out);
-        EstimatedHistogram.serializer.serialize(rowSizes, out);
+        EstimatedHistogram.serializer.serialize(columnnCounts, out);
         out.close();
     }
 
@@ -366,7 +366,7 @@ public class SSTableWriter extends SSTab
             while (rowPosition < dfile.length())
             {
                 // read key
-                key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, FBUtilities.readShortByteArray(dfile));
+                key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, ByteBufferUtil.readWithShortLength(dfile));
                 iwriter.afterAppend(key, rowPosition);
 
                 // seek to next key
@@ -410,7 +410,7 @@ public class SSTableWriter extends SSTab
             {
                 // read key
                 dfile.seek(readRowPosition);
-                diskKey = FBUtilities.readShortByteArray(dfile);
+                diskKey = ByteBufferUtil.readWithShortLength(dfile);
 
                 // skip data size, bloom filter, column index
                 long dataSize = SSTableReader.readRowSize(dfile, desc);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/DigestMismatchException.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/DigestMismatchException.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/DigestMismatchException.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/DigestMismatchException.java Wed Jan 19 17:14:06 2011
@@ -21,7 +21,7 @@ package org.apache.cassandra.service;
 import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.DecoratedKey;
-import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 public class DigestMismatchException extends Exception
 {
@@ -29,7 +29,7 @@ public class DigestMismatchException ext
     {
         super(String.format("Mismatch for key %s (%s vs %s)",
                             key.toString(),
-                            FBUtilities.bytesToHex(digest1),
-                            FBUtilities.bytesToHex(digest2)));
+                            ByteBufferUtil.bytesToHex(digest1),
+                            ByteBufferUtil.bytesToHex(digest2)));
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Wed Jan 19 17:14:06 2011
@@ -176,7 +176,7 @@ public class StorageProxy implements Sto
         catch (IOException e)
         {
             assert mostRecentMutation != null;
-            throw new RuntimeException("error writing key " + FBUtilities.bytesToHex(mostRecentMutation.key()), e);
+            throw new RuntimeException("error writing key " + ByteBufferUtil.bytesToHex(mostRecentMutation.key()), e);
         }
         finally
         {
@@ -223,7 +223,7 @@ public class StorageProxy implements Sto
                         MessagingService.instance().addCallback(responseHandler, unhintedMessage.getMessageId());
                     }
                     if (logger.isDebugEnabled())
-                        logger.debug("insert writing key " + FBUtilities.bytesToHex(rm.key()) + " to " + unhintedMessage.getMessageId() + "@" + destination);
+                        logger.debug("insert writing key " + ByteBufferUtil.bytesToHex(rm.key()) + " to " + unhintedMessage.getMessageId() + "@" + destination);
 
                     Multimap<Message, InetAddress> messages = dcMessages.get(dc);
                     if (messages == null)
@@ -245,7 +245,7 @@ public class StorageProxy implements Sto
                     {
                         addHintHeader(hintedMessage, target);
                         if (logger.isDebugEnabled())
-                            logger.debug("insert writing key " + FBUtilities.bytesToHex(rm.key()) + " to " + hintedMessage.getMessageId() + "@" + destination + " for " + target);
+                            logger.debug("insert writing key " + ByteBufferUtil.bytesToHex(rm.key()) + " to " + hintedMessage.getMessageId() + "@" + destination + " for " + target);
                     }
                 }
                 responseHandler.addHintCallback(hintedMessage, destination);
@@ -398,7 +398,7 @@ public class StorageProxy implements Sto
                     Message msg = cm.makeMutationMessage();
                     MessagingService.instance().addCallback(responseHandler, msg.getMessageId());
                     if (logger.isDebugEnabled())
-                        logger.debug("forwarding counter update of key " + FBUtilities.bytesToHex(cm.key()) + " to " + msg.getMessageId() + "@" + endpoint);
+                        logger.debug("forwarding counter update of key " + ByteBufferUtil.bytesToHex(cm.key()) + " to " + msg.getMessageId() + "@" + endpoint);
                     MessagingService.instance().sendOneWay(msg, endpoint);
                 }
             }
@@ -413,7 +413,7 @@ public class StorageProxy implements Sto
             if (mostRecentMutation == null)
                 throw new RuntimeException("no mutations were seen but found an error during write anyway", e);
             else
-                throw new RuntimeException("error writing key " + FBUtilities.bytesToHex(mostRecentMutation.key()), e);
+                throw new RuntimeException("error writing key " + ByteBufferUtil.bytesToHex(mostRecentMutation.key()), e);
         }
         finally
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Wed Jan 19 17:14:06 2011
@@ -51,6 +51,7 @@ import org.apache.cassandra.scheduler.IR
 import org.apache.cassandra.service.ClientState;
 import org.apache.cassandra.service.StorageProxy;
 import org.apache.cassandra.service.StorageService;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.thrift.TException;
 
@@ -970,7 +971,7 @@ public class CassandraServer implements 
 
     private Column getCounterColumn(CounterColumn column)
     {
-        return new Column(column.name, FBUtilities.toByteBuffer(column.value), System.currentTimeMillis());
+        return new Column(column.name, ByteBufferUtil.bytes(column.value), System.currentTimeMillis());
     }
 
     public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level)
@@ -994,7 +995,7 @@ public class CassandraServer implements 
             ColumnOrSuperColumn cosc = new ColumnOrSuperColumn();
             if (counter.isSetColumn())
             {
-                Column c = new Column(counter.column.name, FBUtilities.toByteBuffer(counter.column.value), System.currentTimeMillis());
+                Column c = new Column(counter.column.name, ByteBufferUtil.bytes(counter.column.value), System.currentTimeMillis());
                 cosc.setColumn(c);
             }
 
@@ -1003,7 +1004,7 @@ public class CassandraServer implements 
                 List<Column> subcolumns = new ArrayList<Column>(counter.super_column.columns.size());
                 for (CounterColumn subcol : counter.super_column.columns)
                 {
-                    subcolumns.add(new Column(subcol.name, FBUtilities.toByteBuffer(subcol.value), System.currentTimeMillis()));
+                    subcolumns.add(new Column(subcol.name, ByteBufferUtil.bytes(subcol.value), System.currentTimeMillis()));
                 }
                 SuperColumn sc = new SuperColumn(counter.super_column.name, subcolumns);
                 cosc.setSuper_column(sc);
@@ -1141,7 +1142,6 @@ public class CassandraServer implements 
         internal_remove(key, path, System.currentTimeMillis(), consistency_level);
     }
 
-    @Override
     public CqlResult execute_cql_query(ByteBuffer query, Compression compression)
             throws InvalidRequestException, UnavailableException, TimedOutException, TException
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java Wed Jan 19 17:14:06 2011
@@ -38,6 +38,7 @@ import org.apache.cassandra.dht.IPartiti
 import org.apache.cassandra.dht.RandomPartitioner;
 import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.service.StorageService;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
 public class ThriftValidation
@@ -315,8 +316,8 @@ public class ThriftValidation
             throw new InvalidRequestException(String.format("[%s][%s][%s] = [%s] failed validation (%s)",
                                                             keyspace,
                                                             column_parent.getColumn_family(),
-                                                            FBUtilities.bytesToHex(column.name),
-                                                            FBUtilities.bytesToHex(column.value),
+                                                            ByteBufferUtil.bytesToHex(column.name),
+                                                            ByteBufferUtil.bytesToHex(column.value),
                                                             me.getMessage()));
         }
     }
@@ -415,7 +416,7 @@ public class ThriftValidation
                 catch (MarshalException e)
                 {
                     throw new InvalidRequestException(String.format("Column name %s is not valid for comparator %s",
-                                                                    FBUtilities.bytesToHex(c.name), cf_def.comparator_type));
+                                                                    ByteBufferUtil.bytesToHex(c.name), cf_def.comparator_type));
                 }
 
                 if ((c.index_name != null) && (c.index_type == null))

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java Wed Jan 19 17:14:06 2011
@@ -36,8 +36,8 @@ import org.apache.cassandra.db.marshal.A
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.io.sstable.*;
 
-import static org.apache.cassandra.utils.FBUtilities.bytesToHex;
-import static org.apache.cassandra.utils.FBUtilities.hexToBytes;
+import static org.apache.cassandra.utils.ByteBufferUtil.bytesToHex;
+import static org.apache.cassandra.utils.ByteBufferUtil.hexToBytes;
 
 /**
  * Export SSTables to JSON format.
@@ -202,7 +202,7 @@ public class SSTableExport
         {
             if (excludeSet.contains(key))
                 continue;
-            DecoratedKey<?> dk = partitioner.decorateKey(ByteBuffer.wrap(hexToBytes(key)));
+            DecoratedKey<?> dk = partitioner.decorateKey(hexToBytes(key));
 
             // validate order of the keys in the sstable
             if (lastKey != null && lastKey.compareTo(dk) > 0 )

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableImport.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableImport.java?rev=1060870&r1=1060869&r2=1060870&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableImport.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableImport.java Wed Jan 19 17:14:06 2011
@@ -39,7 +39,7 @@ import org.codehaus.jackson.map.MappingJ
 
 import org.codehaus.jackson.JsonParser;
 
-import static org.apache.cassandra.utils.FBUtilities.hexToBytes;
+import static org.apache.cassandra.utils.ByteBufferUtil.hexToBytes;
 
 /**
  * Create SSTables from JSON input
@@ -92,8 +92,8 @@ public class SSTableImport
 
                 assert fields.size() == 4 || fields.size() == 6 : "Column definition should have 4 or 6 fields.";
 
-                name      = ByteBuffer.wrap(hexToBytes((String) fields.get(0)));
-                value     = ByteBuffer.wrap(hexToBytes((String) fields.get(1)));
+                name      = hexToBytes((String) fields.get(0));
+                value     = hexToBytes((String) fields.get(1));
                 timestamp = (Long) fields.get(2);
                 isDeleted = (Boolean) fields.get(3);
 
@@ -167,7 +167,7 @@ public class SSTableImport
         // Super columns
         for (Map.Entry<?, ?> entry : row.entrySet())
         {
-            ByteBuffer superName = ByteBuffer.wrap(hexToBytes((String) entry.getKey()));
+            ByteBuffer superName = hexToBytes((String) entry.getKey());
             Map<?, ?> data = (Map<?, ?>) entry.getValue();
 
             addColumnsToCF((List<?>) data.get("subColumns"), superName, cfamily);
@@ -218,7 +218,7 @@ public class SSTableImport
         for (Object keyObject : data.keySet())
         {
             String key = (String) keyObject;
-            decoratedKeys.put(partitioner.decorateKey(ByteBuffer.wrap(hexToBytes(key))), key);
+            decoratedKeys.put(partitioner.decorateKey(hexToBytes(key)), key);
         }
 
         for (Map.Entry<DecoratedKey, String> rowKey : decoratedKeys.entrySet())
@@ -318,7 +318,7 @@ public class SSTableImport
                     throw new UnsupportedOperationException("Only Array or Hash allowed as row content.");
                 }
 
-                DecoratedKey currentKey = partitioner.decorateKey(ByteBuffer.wrap(hexToBytes(key)));
+                DecoratedKey currentKey = partitioner.decorateKey(hexToBytes(key));
 
                 if (prevStoredKey != null && prevStoredKey.compareTo(currentKey) != -1)
                 {



Mime
View raw message