Updated Branches:
  refs/heads/trunk 88ae22f38 -> 7833db260

Fix regression from #4416

patch by slebresne; reviewed by jbellis for CASSANDRA-4416


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

Branch: refs/heads/trunk
Commit: 7833db26050eafcee928f6ca7b8becf64a9c5563
Parents: fe57553
Author: Sylvain Lebresne <[email protected]>
Authored: Wed Oct 3 17:29:20 2012 +0200
Committer: Sylvain Lebresne <[email protected]>
Committed: Wed Oct 3 17:29:20 2012 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/DefsTable.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7833db26/src/java/org/apache/cassandra/db/DefsTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefsTable.java 
b/src/java/org/apache/cassandra/db/DefsTable.java
index 3deac35..e696ad5 100644
--- a/src/java/org/apache/cassandra/db/DefsTable.java
+++ b/src/java/org/apache/cassandra/db/DefsTable.java
@@ -19,6 +19,7 @@ package org.apache.cassandra.db;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.CharacterCodingException;
 import java.util.*;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -149,7 +150,7 @@ public class DefsTable
 
         for (Row row : serializedSchema)
         {
-            if (invalidSchemaRow(row))
+            if (invalidSchemaRow(row) || ignoredSchemaRow(row))
                 continue;
 
             keyspaces.add(KSMetaData.fromSchema(row, 
serializedColumnFamilies(row.key)));
@@ -232,6 +233,18 @@ public class DefsTable
         return row.cf == null || (row.cf.isMarkedForDelete() && 
row.cf.isEmpty());
     }
 
+    private static boolean ignoredSchemaRow(Row row)
+    {
+        try
+        {
+            return 
Schema.systemKeyspaceNames.contains(ByteBufferUtil.string(row.key.key));
+        }
+        catch (CharacterCodingException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
     public static ByteBuffer searchComposite(String name, boolean start)
     {
         assert name != null;

Reply via email to