cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [3/4] git commit: Fix for Test failure: remove hardcoded values in CLT
Date Sun, 08 Jul 2012 11:11:07 GMT
Fix for Test failure: remove hardcoded values in CLT

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

Branch: refs/heads/trunk
Commit: a2bdc8ff9c88b2a6062f23cc5ae1d4931163538e
Parents: 4fd6fe3
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Fri Jul 6 16:49:40 2012 -0700
Committer: Vijay Parthasarathy <vijay2win@gmail.com>
Committed: Fri Jul 6 16:49:40 2012 -0700

----------------------------------------------------------------------
 .../org/apache/cassandra/db/CommitLogTest.java     |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a2bdc8ff/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 4e48d73..92fe175 100644
--- a/test/unit/org/apache/cassandra/db/CommitLogTest.java
+++ b/test/unit/org/apache/cassandra/db/CommitLogTest.java
@@ -27,6 +27,7 @@ import java.util.zip.Checksum;
 import org.junit.Test;
 
 import org.apache.cassandra.SchemaLoader;
+import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.filter.QueryPath;
 
@@ -95,7 +96,7 @@ public class CommitLogTest extends SchemaLoader
         CommitLog.instance.resetUnsafe();
         // Roughly 32 MB mutation
         RowMutation rm = new RowMutation("Keyspace1", bytes("k"));
-        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate(32 * 1024
* 1024), 0);
+        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate(DatabaseDescriptor.getCommitLogSegmentSize()/4),
0);
 
         // Adding it 5 times
         CommitLog.instance.add(rm);
@@ -124,7 +125,7 @@ public class CommitLogTest extends SchemaLoader
         CommitLog.instance.resetUnsafe();
         // Roughly 32 MB mutation
         RowMutation rm = new RowMutation("Keyspace1", bytes("k"));
-        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate(32 * 1024
* 1024), 0);
+        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate(DatabaseDescriptor.getCommitLogSegmentSize()/4),
0);
 
         // Adding it twice (won't change segment)
         CommitLog.instance.add(rm);
@@ -140,7 +141,7 @@ public class CommitLogTest extends SchemaLoader
 
         // Adding new mutation on another CF, large enough (including CL entry overhead)
that a new segment is created
         RowMutation rm2 = new RowMutation("Keyspace1", bytes("k"));
-        rm2.add(new QueryPath("Standard2", null, bytes("c1")), ByteBuffer.allocate(64 * 1024
* 1024), 0);
+        rm2.add(new QueryPath("Standard2", null, bytes("c1")), ByteBuffer.allocate(DatabaseDescriptor.getCommitLogSegmentSize()/2),
0);
         CommitLog.instance.add(rm2);
         // also forces a new segment, since each entry-with-overhead is just over half the
CL size
         CommitLog.instance.add(rm2);
@@ -165,7 +166,7 @@ public class CommitLogTest extends SchemaLoader
         CommitLog.instance.resetUnsafe();
 
         RowMutation rm = new RowMutation("Keyspace1", bytes("k"));
-        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate((128 *
1024 * 1024) - 83), 0);
+        rm.add(new QueryPath("Standard1", null, bytes("c1")), ByteBuffer.allocate((DatabaseDescriptor.getCommitLogSegmentSize())
- 83), 0);
         CommitLog.instance.add(rm);
     }
 


Mime
View raw message