You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/10/25 16:56:45 UTC

[3/6] git commit: add path to MmappedSegmentedFile assertions

add path to MmappedSegmentedFile assertions


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

Branch: refs/heads/trunk
Commit: dcbf35c552a53e7779d7da917cbce78ecf109021
Parents: 08a2272
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Oct 25 09:47:00 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Oct 25 09:47:00 2013 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dcbf35c5/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java b/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
index cb812bc..eeaf46e 100644
--- a/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
+++ b/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
@@ -54,10 +54,10 @@ public class MmappedSegmentedFile extends SegmentedFile
      */
     private Segment floor(long position)
     {
-        assert 0 <= position && position < length: position + " vs " + length;
+        assert 0 <= position && position < length: String.format("%d >= %d in %s", position, length, path);
         Segment seg = new Segment(position, null);
         int idx = Arrays.binarySearch(segments, seg);
-        assert idx != -1 : "Bad position " + position + " in segments " + Arrays.toString(segments);
+        assert idx != -1 : String.format("Bad position %d for segments %s in %s", position, Arrays.toString(segments), path);
         if (idx < 0)
             // round down to entry at insertion point
             idx = -(idx + 2);