Repository: cassandra
Updated Branches:
  refs/heads/trunk c63ee74b5 -> e9995c9b5


Add schema_triggers cleanup to SystemKeyspace#finishStartup()


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

Branch: refs/heads/trunk
Commit: c3a809584a131bb665f32e93256b3c473570139f
Parents: 4868854
Author: Aleksey Yeschenko <alek...@apache.org>
Authored: Fri Nov 7 21:28:33 2014 +0300
Committer: Aleksey Yeschenko <alek...@apache.org>
Committed: Fri Nov 7 21:28:33 2014 +0300

----------------------------------------------------------------------
 .../org/apache/cassandra/db/SystemKeyspace.java | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c3a80958/src/java/org/apache/cassandra/db/SystemKeyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemKeyspace.java 
b/src/java/org/apache/cassandra/db/SystemKeyspace.java
index 30e6d47..64a487c 100644
--- a/src/java/org/apache/cassandra/db/SystemKeyspace.java
+++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java
@@ -112,20 +112,17 @@ public class SystemKeyspace
         copyAllAliasesToColumnsProper();
 
         // add entries to system schema columnfamilies for the hardcoded 
system definitions
-        for (String ksname : Schema.systemKeyspaceNames)
-        {
-            KSMetaData ksmd = Schema.instance.getKSMetaData(ksname);
+        KSMetaData ksmd = Schema.instance.getKSMetaData(Keyspace.SYSTEM_KS);
 
-            // delete old, possibly obsolete entries in schema columnfamilies
-            for (String cfname : 
Arrays.asList(SystemKeyspace.SCHEMA_KEYSPACES_CF, 
SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF, SystemKeyspace.SCHEMA_COLUMNS_CF))
-            {
-                String req = String.format("DELETE FROM system.%s WHERE 
keyspace_name = '%s'", cfname, ksmd.name);
-                processInternal(req);
-            }
+        // delete old, possibly obsolete entries in schema columnfamilies
+        for (String cfname : Arrays.asList(SystemKeyspace.SCHEMA_KEYSPACES_CF,
+                                           
SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF,
+                                           SystemKeyspace.SCHEMA_COLUMNS_CF,
+                                           SystemKeyspace.SCHEMA_TRIGGERS_CF))
+            processInternal(String.format("DELETE FROM system.%s WHERE 
keyspace_name = '%s'", cfname, ksmd.name));
 
-            // (+1 to timestamp to make sure we don't get shadowed by the 
tombstones we just added)
-            ksmd.toSchema(FBUtilities.timestampMicros() + 1).apply();
-        }
+        // (+1 to timestamp to make sure we don't get shadowed by the 
tombstones we just added)
+        ksmd.toSchema(FBUtilities.timestampMicros() + 1).apply();
     }
 
     // Starting with 2.0 (CASSANDRA-5125) we keep all the 'aliases' in 
system.schema_columns together with the regular columns,

Reply via email to