Updated Branches:
  refs/heads/trunk b06c45a96 -> 6f4dc48b4

synchronize getLevelSize


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

Branch: refs/heads/trunk
Commit: 6f4dc48b4f2769d530ac3c8699e421c23f8f90ce
Parents: b06c45a
Author: Jonathan Ellis <[email protected]>
Authored: Sat Mar 16 15:11:16 2013 -0500
Committer: Jonathan Ellis <[email protected]>
Committed: Sat Mar 16 15:11:16 2013 -0500

----------------------------------------------------------------------
 .../cassandra/db/compaction/LeveledManifest.java   |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4dc48b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java 
b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index d241a85..643fe44 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -132,9 +132,7 @@ public class LeveledManifest
         // the level for the added sstables is the max of the removed ones,
         // plus one if the removed were all on the same level
         for (SSTableReader sstable : removed)
-        {
             remove(sstable);
-        }
 
         // it's valid to do a remove w/o an add (e.g. on truncate)
         if (!added.iterator().hasNext())
@@ -274,9 +272,11 @@ public class LeveledManifest
         return Collections.emptyList();
     }
 
-    public int getLevelSize(int i)
+    public synchronized int getLevelSize(int i)
     {
-        return generations.length > i ? generations[i].size() : 0;
+        if (i > generations.length)
+            throw new ArrayIndexOutOfBoundsException("Maximum valid generation 
is " + (generations.length - 1));
+        return generations[i].size();
     }
 
     public synchronized int[] getAllLevelSize()

Reply via email to