cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] cassandra git commit: Add schema_triggers cleanup to SystemKeyspace#finishStartup()
Date Fri, 07 Nov 2014 18:36:50 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 cb9d3881f -> 7920ebebe


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/cassandra-2.1
Commit: c3a809584a131bb665f32e93256b3c473570139f
Parents: 4868854
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Fri Nov 7 21:28:33 2014 +0300
Committer: Aleksey Yeschenko <aleksey@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,


Mime
View raw message