cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/6] git commit: Check that key_aliases/column_aliases exists before using them Patch by brandonwilliams, reviewed by iamaleksey for CASSANDRA-6589
Date Fri, 17 Jan 2014 00:21:02 GMT
Updated Branches:
  refs/heads/cassandra-2.0 ee7938391 -> 90f661eee
  refs/heads/trunk dd49497e9 -> fac3042db


Check that key_aliases/column_aliases exists before using them
Patch by brandonwilliams, reviewed by iamaleksey for CASSANDRA-6589


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

Branch: refs/heads/cassandra-2.0
Commit: cead348d9d646b50f086d5cdcdceb5eecf66e806
Parents: ee79383
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Jan 16 18:05:59 2014 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Thu Jan 16 18:05:59 2014 -0600

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/CFMetaData.java    | 4 +++-
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cead348d/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index c026824..a693dee 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -1637,7 +1637,9 @@ public final class CFMetaData
              * In other words, the ColumnDefinition the following lines add may be replaced
later when ColumnDefinition.fromSchema
              * is called but that's ok.
              */
-            cfm.addColumnMetadataFromAliases(aliasesFromStrings(fromJsonList(result.getString("key_aliases"))),
cfm.keyValidator, ColumnDefinition.Type.PARTITION_KEY);
+            if (result.has("key_aliases"))
+                cfm.addColumnMetadataFromAliases(aliasesFromStrings(fromJsonList(result.getString("key_aliases"))),
cfm.keyValidator, ColumnDefinition.Type.PARTITION_KEY);
+            if (result.has("column_aliases"))
             cfm.addColumnMetadataFromAliases(aliasesFromStrings(fromJsonList(result.getString("column_aliases"))),
cfm.comparator, ColumnDefinition.Type.CLUSTERING_KEY);
 
             if (result.has("value_alias"))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cead348d/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 4d7d6f2..2cc325b 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -408,7 +408,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
             Descriptor desc = entry.getKey();
             generations.add(desc.generation);
             if (!desc.isCompatible())
-                throw new RuntimeException(String.format("Can't open incompatible SSTable!
Current version %s, found file: %s", Descriptor.Version.CURRENT, desc));
+                logger.warn(String.format("Old SSTable found: Current version %s, found file:
%s.  Please run upgradesstables.", Descriptor.Version.CURRENT, desc));
         }
         Collections.sort(generations);
         int value = (generations.size() > 0) ? (generations.get(generations.size() - 1))
: 0;


Mime
View raw message