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 2014/06/18 21:57:37 UTC
[1/2] git commit: Fix BatchlogManagerTest consistency
Repository: cassandra
Updated Branches:
refs/heads/cassandra-2.1 cf9b8c998 -> 43d248f91
Fix BatchlogManagerTest consistency
patch by Carl Yeksigian; reviewed by Michael Shuler for CASSANDRA-7397
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/760441ba
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/760441ba
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/760441ba
Branch: refs/heads/cassandra-2.1
Commit: 760441ba0f0f536934a611ff1f55f30e658d2a1d
Parents: c1b5c27
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Jun 18 12:53:19 2014 -0700
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jun 18 12:53:19 2014 -0700
----------------------------------------------------------------------
test/unit/org/apache/cassandra/db/BatchlogManagerTest.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/760441ba/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
index 954c1f2..0b6a908 100644
--- a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
@@ -65,10 +65,10 @@ public class BatchlogManagerTest extends SchemaLoader
RowMutation mutation = new RowMutation("Keyspace1", bytes(i));
mutation.add("Standard1", bytes(i), bytes(i), System.currentTimeMillis());
- long timestamp = System.currentTimeMillis();
- if (i < 500)
- timestamp -= DatabaseDescriptor.getWriteRpcTimeout() * 2;
- BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(), timestamp * 1000).apply();
+ long timestamp = i < 500
+ ? (System.currentTimeMillis() - DatabaseDescriptor.getWriteRpcTimeout() * 2) * 1000
+ : Long.MAX_VALUE;
+ BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(), timestamp).apply();
}
// Flush the batchlog to disk (see CASSANDRA-6822).
[2/2] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1
Conflicts:
test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/43d248f9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/43d248f9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/43d248f9
Branch: refs/heads/cassandra-2.1
Commit: 43d248f913b5cc9a7a3f33ef133de1d9307e18f1
Parents: cf9b8c9 760441b
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Jun 18 12:57:32 2014 -0700
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jun 18 12:57:32 2014 -0700
----------------------------------------------------------------------
test/unit/org/apache/cassandra/db/BatchlogManagerTest.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/43d248f9/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
index e0eae6b,0b6a908..57f6844
--- a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
@@@ -62,20 -60,15 +62,21 @@@ public class BatchlogManagerTest extend
// Generate 1000 mutations and put them all into the batchlog.
// Half (500) ready to be replayed, half not.
+ CellNameType comparator = Keyspace.open("Keyspace1").getColumnFamilyStore("Standard1").metadata.comparator;
for (int i = 0; i < 1000; i++)
{
- RowMutation mutation = new RowMutation("Keyspace1", bytes(i));
- mutation.add("Standard1", bytes(i), bytes(i), System.currentTimeMillis());
+ Mutation mutation = new Mutation("Keyspace1", bytes(i));
+ mutation.add("Standard1", comparator.makeCellName(bytes(i)), bytes(i), System.currentTimeMillis());
- long timestamp = System.currentTimeMillis();
- if (i < 500)
- timestamp -= DatabaseDescriptor.getWriteRpcTimeout() * 2;
+ long timestamp = i < 500
+ ? (System.currentTimeMillis() - DatabaseDescriptor.getWriteRpcTimeout() * 2) * 1000
+ : Long.MAX_VALUE;
- BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(), timestamp).apply();
++
+ BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation),
+ UUIDGen.getTimeUUID(),
+ MessagingService.current_version,
- timestamp * 1000)
++ timestamp)
+ .apply();
}
// Flush the batchlog to disk (see CASSANDRA-6822).