cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Date Fri, 23 Jan 2015 15:28:19 GMT
Merge branch 'cassandra-2.1' into trunk

Conflicts:
	src/java/org/apache/cassandra/config/DatabaseDescriptor.java
	src/java/org/apache/cassandra/tools/SSTableExport.java
	src/java/org/apache/cassandra/tools/SSTableImport.java
	src/java/org/apache/cassandra/tools/StandaloneScrubber.java
	src/java/org/apache/cassandra/tools/StandaloneSplitter.java
	src/java/org/apache/cassandra/tools/StandaloneUpgrader.java


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

Branch: refs/heads/trunk
Commit: 27ad2db02f5ae0b3c59e817a7eb82163a4695f95
Parents: d4b23b0 3a5f79e
Author: Yuki Morishita <yukim@apache.org>
Authored: Fri Jan 23 09:27:53 2015 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Jan 23 09:27:53 2015 -0600

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/Schema.java  | 18 ++++++++++++++++--
 .../org/apache/cassandra/tools/SSTableExport.java |  2 +-
 .../org/apache/cassandra/tools/SSTableImport.java |  2 +-
 .../cassandra/tools/SSTableLevelResetter.java     |  2 +-
 .../cassandra/tools/StandaloneScrubber.java       |  2 +-
 .../cassandra/tools/StandaloneSplitter.java       |  2 +-
 .../cassandra/tools/StandaloneUpgrader.java       |  2 +-
 7 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/config/Schema.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/Schema.java
index 694c05c,8e9802f..af1b502
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@@ -82,20 -80,10 +82,34 @@@ public class Schem
      }
  
      /**
 -     * Initialize empty schema object
 +     * Initialize empty schema object and load the hardcoded system tables
       */
      public Schema()
 -    {}
 +    {
 +        load(SystemKeyspace.definition());
 +    }
 +
-     /** 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 Schema loadFromDisk()
 +    {
++        return loadFromDisk(true);
++    }
++
++    /**
++     * Load schema definitions from disk.
++     *
++     * @param updateVersion true if schema version needs to be updated
++     */
++    public Schema loadFromDisk(boolean updateVersion)
++    {
 +        load(LegacySchemaTables.readSchemaFromSystemTables());
-         updateVersion();
++        if (updateVersion)
++            updateVersion();
 +        return this;
 +    }
  
      /**
       * Load up non-system keyspaces

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/tools/SSTableExport.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/SSTableExport.java
index 76bfa3b,a90f405..b62f516
--- a/src/java/org/apache/cassandra/tools/SSTableExport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableExport.java
@@@ -418,7 -419,7 +418,7 @@@ public class SSTableExpor
          String[] excludes = cmd.getOptionValues(EXCLUDEKEY_OPTION);
          String ssTableFileName = new File(cmd.getArgs()[0]).getAbsolutePath();
  
-         Schema.instance.loadFromDisk();
 -        DatabaseDescriptor.loadSchemas(false);
++        Schema.instance.loadFromDisk(false);
          Descriptor descriptor = Descriptor.fromFilename(ssTableFileName);
  
          // Start by validating keyspace name

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/tools/SSTableImport.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/SSTableImport.java
index ee6bf59,87d52be..84613e9
--- a/src/java/org/apache/cassandra/tools/SSTableImport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableImport.java
@@@ -501,7 -501,7 +501,7 @@@ public class SSTableImpor
              isSorted = true;
          }
  
-         Schema.instance.loadFromDisk();
 -        DatabaseDescriptor.loadSchemas(false);
++        Schema.instance.loadFromDisk(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/27ad2db0/src/java/org/apache/cassandra/tools/SSTableLevelResetter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/SSTableLevelResetter.java
index 815620e,2b273c5..d73a325
--- a/src/java/org/apache/cassandra/tools/SSTableLevelResetter.java
+++ b/src/java/org/apache/cassandra/tools/SSTableLevelResetter.java
@@@ -61,7 -63,7 +61,7 @@@ public class SSTableLevelResette
          try
          {
              // load keyspace descriptions.
-             Schema.instance.loadFromDisk();
 -            DatabaseDescriptor.loadSchemas();
++            Schema.instance.loadFromDisk(false);
  
              String keyspaceName = args[1];
              String columnfamily = args[2];

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/StandaloneScrubber.java
index 80640d0,82e3783..c2438d7
--- a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
@@@ -58,10 -58,10 +58,10 @@@ public class StandaloneScrubbe
          try
          {
              // load keyspace descriptions.
-             Schema.instance.loadFromDisk();
 -            DatabaseDescriptor.loadSchemas(false);
++            Schema.instance.loadFromDisk(false);
  
              if (Schema.instance.getCFMetaData(options.keyspaceName, options.cfName) == null)
 -                throw new IllegalArgumentException(String.format("Unknown keyspace/columnFamily
%s.%s",
 +                throw new IllegalArgumentException(String.format("Unknown keyspace/table
%s.%s",
                                                                   options.keyspaceName,
                                                                   options.cfName));
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/StandaloneSplitter.java
index 90ab48e,5ed1543..28f9dd7
--- a/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
@@@ -52,7 -52,7 +52,7 @@@ public class StandaloneSplitte
          try
          {
              // load keyspace descriptions.
-             Schema.instance.loadFromDisk();
 -            DatabaseDescriptor.loadSchemas(false);
++            Schema.instance.loadFromDisk(false);
  
              String ksName = null;
              String cfName = null;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ad2db0/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
index 6617b96,92b6445..06cc98e
--- a/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
@@@ -46,10 -46,10 +46,10 @@@ public class StandaloneUpgrade
          try
          {
              // load keyspace descriptions.
-             Schema.instance.loadFromDisk();
 -            DatabaseDescriptor.loadSchemas(false);
++            Schema.instance.loadFromDisk(false);
  
              if (Schema.instance.getCFMetaData(options.keyspace, options.cf) == null)
 -                throw new IllegalArgumentException(String.format("Unknown keyspace/columnFamily
%s.%s",
 +                throw new IllegalArgumentException(String.format("Unknown keyspace/table
%s.%s",
                                                                   options.keyspace,
                                                                   options.cf));
  


Mime
View raw message