You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/11/07 22:54:42 UTC

[1/2] git commit: Fix counter header length shortcut logic

Updated Branches:
  refs/heads/cassandra-2.0 66df206d8 -> 00a68398f


Fix counter header length shortcut logic


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

Branch: refs/heads/cassandra-2.0
Commit: eb577459df33ef2fd0b19c4eb567b4d0395575d6
Parents: e5715f4
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Nov 8 00:53:27 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Nov 8 00:53:27 2013 +0300

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/context/CounterContext.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eb577459/src/java/org/apache/cassandra/db/context/CounterContext.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/context/CounterContext.java b/src/java/org/apache/cassandra/db/context/CounterContext.java
index 9e309f9..a892c8c 100644
--- a/src/java/org/apache/cassandra/db/context/CounterContext.java
+++ b/src/java/org/apache/cassandra/db/context/CounterContext.java
@@ -492,7 +492,7 @@ public class CounterContext implements IContext
     public ByteBuffer markDeltaToBeCleared(ByteBuffer context)
     {
         int headerLength = headerLength(context);
-        if (headerLength == 0)
+        if (headerLength == HEADER_SIZE_LENGTH)
             return context;
 
         ByteBuffer marked = context.duplicate();
@@ -512,7 +512,7 @@ public class CounterContext implements IContext
     public ByteBuffer clearAllDelta(ByteBuffer context)
     {
         int headerLength = headerLength(context);
-        if (headerLength == 0)
+        if (headerLength == HEADER_SIZE_LENGTH)
             return context;
 
         ByteBuffer cleaned = ByteBuffer.allocate(context.remaining() - headerLength + HEADER_SIZE_LENGTH);
@@ -528,8 +528,7 @@ public class CounterContext implements IContext
 
     public void validateContext(ByteBuffer context) throws MarshalException
     {
-        int headerLength = headerLength(context);
-        if (headerLength < 0 || (context.remaining() - headerLength) %  STEP_LENGTH != 0)
+        if ((context.remaining() - headerLength(context)) % STEP_LENGTH != 0)
             throw new MarshalException("Invalid size for a counter context");
     }
 


[2/2] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by al...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/cassandra-2.0
Commit: 00a68398f576a0cb32dd7f1435ff1b7808256dea
Parents: 66df206 eb57745
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Nov 8 00:54:29 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Nov 8 00:54:29 2013 +0300

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/context/CounterContext.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/00a68398/src/java/org/apache/cassandra/db/context/CounterContext.java
----------------------------------------------------------------------