cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1055642 - in /cassandra/branches/cassandra-0.7.0: ./ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/marshal/ src/java/org/apache/cassandra/utils/ test/unit/org/apache/cassandra/db/ test/unit/org/apache/cassandra/db/mars...
Date Wed, 05 Jan 2011 21:19:00 GMT
Author: jbellis
Date: Wed Jan  5 21:18:59 2011
New Revision: 1055642

URL: http://svn.apache.org/viewvc?rev=1055642&view=rev
Log:
fix offsets to ByteBuffer.get
patch by slebresne; reviewed by jbellis for CASSANDRA-1939

Modified:
    cassandra/branches/cassandra-0.7.0/CHANGES.txt
    cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/DeletedColumn.java
    cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/marshal/LongType.java
    cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/utils/UUIDGen.java
    cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/NameSortTest.java
    cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java

Modified: cassandra/branches/cassandra-0.7.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/CHANGES.txt?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7.0/CHANGES.txt Wed Jan  5 21:18:59 2011
@@ -1,3 +1,7 @@
+0.7.0-final
+ * fix offsets to ByteBuffer.get (CASSANDRA-1939)
+
+
 0.7.0-rc4
  * fix cli crash after backgrounding (CASSANDRA-1875)
  * count timeouts in storageproxy latencies, and include latency 

Modified: cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/DeletedColumn.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/DeletedColumn.java?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/DeletedColumn.java
(original)
+++ cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/DeletedColumn.java
Wed Jan  5 21:18:59 2011
@@ -55,7 +55,7 @@ public class DeletedColumn extends Colum
     @Override
     public int getLocalDeletionTime()
     {
-       return value.getInt(value.position()+value.arrayOffset()	);
+       return value.getInt(value.position());
     }
     
     @Override

Modified: cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/marshal/LongType.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/marshal/LongType.java?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/marshal/LongType.java
(original)
+++ cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/db/marshal/LongType.java
Wed Jan  5 21:18:59 2011
@@ -63,7 +63,7 @@ public class LongType extends AbstractTy
         }
         
         
-        return String.valueOf(bytes.getLong(bytes.position()+bytes.arrayOffset()));
+        return String.valueOf(bytes.getLong(bytes.position()));
     }
 
     public ByteBuffer fromString(String source)

Modified: cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/utils/UUIDGen.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/utils/UUIDGen.java?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/utils/UUIDGen.java (original)
+++ cassandra/branches/cassandra-0.7.0/src/java/org/apache/cassandra/utils/UUIDGen.java Wed
Jan  5 21:18:59 2011
@@ -56,7 +56,7 @@ public class UUIDGen
     /** creates a type 1 uuid from raw bytes. */
     public static UUID getUUID(ByteBuffer raw)
     {
-        return new UUID(raw.getLong(raw.position() + raw.arrayOffset()), raw.getLong(raw.position()
+ raw.arrayOffset() + 8));
+        return new UUID(raw.getLong(raw.position()), raw.getLong(raw.position() + 8));
     }
 
     /** decomposes a uuid into raw bytes. */

Modified: cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/NameSortTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/NameSortTest.java?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/NameSortTest.java
(original)
+++ cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/NameSortTest.java
Wed Jan  5 21:18:59 2011
@@ -124,7 +124,7 @@ public class NameSortTest extends Cleanu
                 assert subColumns.size() == 4;
                 for (IColumn subColumn : subColumns)
                 {
-                    long k = subColumn.name().getLong(subColumn.name().position() + subColumn.name().arrayOffset());
+                    long k = subColumn.name().getLong(subColumn.name().position());
                     byte[] bytes = (j + k) % 2 == 0 ? "a".getBytes() : "b".getBytes();
                     assertEquals(new String(bytes), ByteBufferUtil.string(subColumn.value()));
                 }

Modified: cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java?rev=1055642&r1=1055641&r2=1055642&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java
(original)
+++ cassandra/branches/cassandra-0.7.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java
Wed Jan  5 21:18:59 2011
@@ -89,8 +89,8 @@ public class TypeCompareTest
         for (int i = 1; i < data.length; i++)
         {
         	
-            long l0 = data[i - 1].getLong(data[i - 1].position()+data[i - 1].arrayOffset());
-            long l1 = data[i].getLong(data[i].position()+data[i].arrayOffset());
+            long l0 = data[i - 1].getLong(data[i - 1].position());
+            long l1 = data[i].getLong(data[i].position());
             assert l0 <= l1;
         }
     }



Mime
View raw message