cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/3] git commit: Fix hardcoded overhead size in commit log test.
Date Fri, 09 May 2014 15:05:53 GMT
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 <brandonwilliams@apache.org>
Authored: Fri May 9 10:04:55 2014 -0500
Committer: Brandon Williams <brandonwilliams@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);
     }
 


Mime
View raw message