cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: fix native cell ByteOrder patch by bes; reviewed by jbellis and tested by mshuler for CASSANDRA-7201
Date Wed, 21 May 2014 18:25:33 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 dd6a22959 -> e06d74ef5
  refs/heads/trunk 6581abfae -> f9e2990d5


fix native cell ByteOrder
patch by bes; reviewed by jbellis and tested by mshuler for CASSANDRA-7201


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e06d74ef
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e06d74ef
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e06d74ef

Branch: refs/heads/cassandra-2.1
Commit: e06d74ef534770ff0f5d4c1b95234bb321fc1a68
Parents: dd6a229
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed May 21 13:25:17 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed May 21 13:25:17 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/AbstractNativeCell.java | 5 +++--
 src/java/org/apache/cassandra/db/NativeCounterCell.java  | 5 -----
 2 files changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e06d74ef/src/java/org/apache/cassandra/db/AbstractNativeCell.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/AbstractNativeCell.java b/src/java/org/apache/cassandra/db/AbstractNativeCell.java
index d21171f..f3128b8 100644
--- a/src/java/org/apache/cassandra/db/AbstractNativeCell.java
+++ b/src/java/org/apache/cassandra/db/AbstractNativeCell.java
@@ -18,6 +18,7 @@
 package org.apache.cassandra.db;
 
 import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
 import java.security.MessageDigest;
 
 import org.apache.cassandra.config.CFMetaData;
@@ -183,7 +184,7 @@ public abstract class AbstractNativeCell extends AbstractCell implements
CellNam
     public ByteBuffer value()
     {
         long offset = valueStartOffset();
-        return getByteBuffer(offset, (int) (internalSize() - (postfixSize() + offset)));
+        return getByteBuffer(offset, (int) (internalSize() - (postfixSize() + offset))).order(ByteOrder.BIG_ENDIAN);
     }
 
     private int clusteringSizeDelta()
@@ -291,7 +292,7 @@ public abstract class AbstractNativeCell extends AbstractCell implements
CellNam
         int cellNamesOffset = nameDeltaOffset(size);
         int startDelta = i == 0 ? 0 : getShort(nameDeltaOffset(i));
         int endDelta = i < size - 1 ? getShort(nameDeltaOffset(i + 1)) : valueStartOffset()
- cellNamesOffset;
-        return getByteBuffer(cellNamesOffset + startDelta, endDelta - startDelta);
+        return getByteBuffer(cellNamesOffset + startDelta, endDelta - startDelta).order(ByteOrder.BIG_ENDIAN);
     }
 
     private static final ThreadLocal<byte[]> BUFFER = new ThreadLocal<byte[]>()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e06d74ef/src/java/org/apache/cassandra/db/NativeCounterCell.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/NativeCounterCell.java b/src/java/org/apache/cassandra/db/NativeCounterCell.java
index 5eba27c..374eb23 100644
--- a/src/java/org/apache/cassandra/db/NativeCounterCell.java
+++ b/src/java/org/apache/cassandra/db/NativeCounterCell.java
@@ -68,11 +68,6 @@ public class NativeCounterCell extends NativeCell implements CounterCell
         return getLong(internalSize() - 8);
     }
 
-    public ByteBuffer value()
-    {
-        return super.value().order(ByteOrder.BIG_ENDIAN);
-    }
-
     @Override
     public long total()
     {


Mime
View raw message