cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [3/6] cassandra git commit: Do not write commitlog from standalone tools
Date Fri, 23 Jan 2015 15:28:16 GMT
Do not write commitlog from standalone tools

patch by yukim; reviewed by Tyler Hobbs for CASSANDRA-8616


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

Branch: refs/heads/trunk
Commit: 2bf63f61e33587a8ba94fce3a1433e8cd866d1f0
Parents: cc5fb19
Author: Yuki Morishita <yukim@apache.org>
Authored: Fri Jan 23 08:58:47 2015 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Jan 23 08:58:47 2015 -0600

----------------------------------------------------------------------
 .../cassandra/config/DatabaseDescriptor.java      | 18 ++++++++++++++++--
 .../org/apache/cassandra/tools/SSTableExport.java |  2 +-
 .../org/apache/cassandra/tools/SSTableImport.java |  2 +-
 .../cassandra/tools/StandaloneScrubber.java       |  2 +-
 .../cassandra/tools/StandaloneSplitter.java       |  2 +-
 .../cassandra/tools/StandaloneUpgrader.java       |  2 +-
 6 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 2bfdb16..286014e 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -516,9 +516,22 @@ public class DatabaseDescriptor
         return conf.dynamic_snitch ? new DynamicEndpointSnitch(snitch) : snitch;
     }
 
-    /** load keyspace (keyspace) definitions, but do not initialize the keyspace instances.
*/
+    /**
+     * load keyspace (keyspace) definitions, but do not initialize the keyspace instances.
+     * Schema version may be updated as the result.
+     */
     public static void loadSchemas()
     {
+        loadSchemas(true);
+    }
+
+    /**
+     * Load schema definitions.
+     *
+     * @param updateVersion true if schema version needs to be updated
+     */
+    public static void loadSchemas(boolean updateVersion)
+    {
         ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_KEYSPACES_CF);
 
         // if keyspace with definitions is empty try loading the old way
@@ -536,7 +549,8 @@ public class DatabaseDescriptor
             Schema.instance.load(DefsTables.loadFromKeyspace());
         }
 
-        Schema.instance.updateVersion();
+        if (updateVersion)
+            Schema.instance.updateVersion();
     }
 
     private static boolean hasExistingNoSystemTables()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/tools/SSTableExport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableExport.java b/src/java/org/apache/cassandra/tools/SSTableExport.java
index f8b85c3..0b96924 100644
--- a/src/java/org/apache/cassandra/tools/SSTableExport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableExport.java
@@ -448,7 +448,7 @@ public class SSTableExport
         String[] excludes = cmd.getOptionValues(EXCLUDEKEY_OPTION);
         String ssTableFileName = new File(cmd.getArgs()[0]).getAbsolutePath();
 
-        DatabaseDescriptor.loadSchemas();
+        DatabaseDescriptor.loadSchemas(false);
         Descriptor descriptor = Descriptor.fromFilename(ssTableFileName);
 
         // Start by validating keyspace name

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/tools/SSTableImport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableImport.java b/src/java/org/apache/cassandra/tools/SSTableImport.java
index 11bfc81..3135fe6 100644
--- a/src/java/org/apache/cassandra/tools/SSTableImport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableImport.java
@@ -545,7 +545,7 @@ public class SSTableImport
             oldSCFormat = true;
         }
 
-        DatabaseDescriptor.loadSchemas();
+        DatabaseDescriptor.loadSchemas(false);
         if (Schema.instance.getNonSystemKeyspaces().size() < 1)
         {
             String msg = "no non-system keyspaces are defined";

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
index 315e4e1..81dfdc3 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
@@ -57,7 +57,7 @@ public class StandaloneScrubber
         try
         {
             // load keyspace descriptions.
-            DatabaseDescriptor.loadSchemas();
+            DatabaseDescriptor.loadSchemas(false);
 
             if (Schema.instance.getCFMetaData(options.keyspaceName, options.cfName) == null)
                 throw new IllegalArgumentException(String.format("Unknown keyspace/columnFamily
%s.%s",

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneSplitter.java b/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
index 546f22f..1f0feb4 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
@@ -59,7 +59,7 @@ public class StandaloneSplitter
         try
         {
             // load keyspace descriptions.
-            DatabaseDescriptor.loadSchemas();
+            DatabaseDescriptor.loadSchemas(false);
 
             String ksName = null;
             String cfName = null;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bf63f61/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java b/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
index 7e73e9d..c3e3554 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
@@ -51,7 +51,7 @@ public class StandaloneUpgrader
         try
         {
             // load keyspace descriptions.
-            DatabaseDescriptor.loadSchemas();
+            DatabaseDescriptor.loadSchemas(false);
 
             if (Schema.instance.getCFMetaData(options.keyspace, options.cf) == null)
                 throw new IllegalArgumentException(String.format("Unknown keyspace/columnFamily
%s.%s",


Mime
View raw message