You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2014/05/09 17:05:52 UTC

[1/3] git commit: Fix hardcoded overhead size in commit log test.

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 b2dd6a7f6 -> 259e17df3
  refs/heads/trunk 70d18cd3e -> b7d5f5a16


Fix hardcoded overhead size in commit log test.

Patch by Benedict, reviewed by brandonwilliams for CASSANDRA-6974


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

Branch: refs/heads/cassandra-2.1
Commit: 259e17df3bd39d1cedf5e3a40c88b1d0d8efdc33
Parents: b2dd6a7
Author: Brandon Williams <br...@apache.org>
Authored: Fri May 9 10:04:55 2014 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri May 9 10:04:55 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | 2 +-
 test/unit/org/apache/cassandra/db/CommitLogTest.java             | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/259e17df/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
index 2120d3e..c87b328 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
@@ -74,7 +74,7 @@ public class CommitLogSegment
     }
 
     // The commit log entry overhead in bytes (int: length + int: head checksum + int: tail checksum)
-    static final int ENTRY_OVERHEAD_SIZE = 4 + 4 + 4;
+    public static final int ENTRY_OVERHEAD_SIZE = 4 + 4 + 4;
 
     // The commit log (chained) sync marker/header size in bytes (int: length + int: checksum [segmentId, position])
     static final int SYNC_MARKER_SIZE = 4 + 4;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/259e17df/test/unit/org/apache/cassandra/db/CommitLogTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/CommitLogTest.java b/test/unit/org/apache/cassandra/db/CommitLogTest.java
index ddab9ea..660e91e 100644
--- a/test/unit/org/apache/cassandra/db/CommitLogTest.java
+++ b/test/unit/org/apache/cassandra/db/CommitLogTest.java
@@ -34,6 +34,7 @@ import org.apache.cassandra.config.Config;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.commitlog.CommitLogDescriptor;
+import org.apache.cassandra.db.commitlog.CommitLogSegment;
 import org.apache.cassandra.db.composites.CellName;
 import org.apache.cassandra.net.MessagingService;
 
@@ -174,7 +175,7 @@ public class CommitLogTest extends SchemaLoader
         rm.add("Standard1", Util.cellname("c1"), ByteBuffer.allocate(0), 0);
 
         int max = (DatabaseDescriptor.getCommitLogSegmentSize() / 2);
-        max -= (4 + 8 + 8); // log entry overhead
+        max -= CommitLogSegment.ENTRY_OVERHEAD_SIZE; // log entry overhead
         return max - (int) Mutation.serializer.serializedSize(rm, MessagingService.current_version);
     }
 


[2/3] git commit: Fix hardcoded overhead size in commit log test.

Posted by br...@apache.org.
Fix hardcoded overhead size in commit log test.

Patch by Benedict, reviewed by brandonwilliams for CASSANDRA-6974


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

Branch: refs/heads/trunk
Commit: 259e17df3bd39d1cedf5e3a40c88b1d0d8efdc33
Parents: b2dd6a7
Author: Brandon Williams <br...@apache.org>
Authored: Fri May 9 10:04:55 2014 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri May 9 10:04:55 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | 2 +-
 test/unit/org/apache/cassandra/db/CommitLogTest.java             | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/259e17df/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
index 2120d3e..c87b328 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
@@ -74,7 +74,7 @@ public class CommitLogSegment
     }
 
     // The commit log entry overhead in bytes (int: length + int: head checksum + int: tail checksum)
-    static final int ENTRY_OVERHEAD_SIZE = 4 + 4 + 4;
+    public static final int ENTRY_OVERHEAD_SIZE = 4 + 4 + 4;
 
     // The commit log (chained) sync marker/header size in bytes (int: length + int: checksum [segmentId, position])
     static final int SYNC_MARKER_SIZE = 4 + 4;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/259e17df/test/unit/org/apache/cassandra/db/CommitLogTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/CommitLogTest.java b/test/unit/org/apache/cassandra/db/CommitLogTest.java
index ddab9ea..660e91e 100644
--- a/test/unit/org/apache/cassandra/db/CommitLogTest.java
+++ b/test/unit/org/apache/cassandra/db/CommitLogTest.java
@@ -34,6 +34,7 @@ import org.apache.cassandra.config.Config;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.commitlog.CommitLogDescriptor;
+import org.apache.cassandra.db.commitlog.CommitLogSegment;
 import org.apache.cassandra.db.composites.CellName;
 import org.apache.cassandra.net.MessagingService;
 
@@ -174,7 +175,7 @@ public class CommitLogTest extends SchemaLoader
         rm.add("Standard1", Util.cellname("c1"), ByteBuffer.allocate(0), 0);
 
         int max = (DatabaseDescriptor.getCommitLogSegmentSize() / 2);
-        max -= (4 + 8 + 8); // log entry overhead
+        max -= CommitLogSegment.ENTRY_OVERHEAD_SIZE; // log entry overhead
         return max - (int) Mutation.serializer.serializedSize(rm, MessagingService.current_version);
     }
 


[3/3] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by br...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: b7d5f5a16a656e36f11d26b69e423c29ea31a04e
Parents: 70d18cd 259e17d
Author: Brandon Williams <br...@apache.org>
Authored: Fri May 9 10:05:46 2014 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri May 9 10:05:46 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | 2 +-
 test/unit/org/apache/cassandra/db/CommitLogTest.java             | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------