cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject git commit: ignore deprecated KsDef/CfDef/ColumnDef fields in native schema patch by Pavel Yaskevich; reviewed by Jonathan Ellis for CASSANDRA-3963
Date Mon, 27 Feb 2012 16:59:26 GMT
Updated Branches:
  refs/heads/cassandra-1.1.0 a15c35b09 -> b2b8a5349


ignore deprecated KsDef/CfDef/ColumnDef fields in native schema
patch by Pavel Yaskevich; reviewed by Jonathan Ellis for CASSANDRA-3963


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

Branch: refs/heads/cassandra-1.1.0
Commit: b2b8a5349a6306f75cd69aa2ed081221b92f3a7f
Parents: a15c35b
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Mon Feb 27 18:07:42 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Mon Feb 27 19:55:47 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../org/apache/cassandra/config/CFMetaData.java    |    6 ++++++
 .../apache/cassandra/config/ColumnDefinition.java  |    6 ++++++
 .../org/apache/cassandra/config/KSMetaData.java    |   12 ++++++++++++
 4 files changed, 25 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2b8a534/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d7babd6..cd05765 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@
  * Remove deprecated merge_shard_chance (CASSANDRA-3940)
  * add a convenient way to reset a node's schema (CASSANDRA-2963)
  * fix for intermittent SchemaDisagreementException (CASSANDRA-3884)
+ * ignore deprecated KsDef/CfDef/ColumnDef fields in native schema (CASSANDRA-3963)
 Merged from 1.0:
  * remove the wait on hint future during write (CASSANDRA-3870)
  * (cqlsh) ignore missing CfDef opts (CASSANDRA-3933)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2b8a534/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 a7d1d14..fb77366 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -1195,6 +1195,12 @@ public final class CFMetaData
             assert attr.length == 2;
 
             CfDef._Fields field = CfDef._Fields.findByName(attr[1]);
+
+            // this means that given field was deprecated
+            // but still exists in the serialized schema
+            if (field == null)
+                continue;
+
             cfDef.setFieldValue(field, deserializeValue(cfAttr.value(), getValueClass(CfDef.class,
field.getFieldName())));
         }
         return cfDef;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2b8a534/src/java/org/apache/cassandra/config/ColumnDefinition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ColumnDefinition.java b/src/java/org/apache/cassandra/config/ColumnDefinition.java
index dbba216..da006c2 100644
--- a/src/java/org/apache/cassandra/config/ColumnDefinition.java
+++ b/src/java/org/apache/cassandra/config/ColumnDefinition.java
@@ -253,6 +253,12 @@ public class ColumnDefinition
             }
 
             ColumnDef._Fields field = ColumnDef._Fields.findByName(components[2]);
+
+            // this means that given field was deprecated
+            // but still exists in the serialized schema
+            if (field == null)
+                continue;
+
             columnDef.setFieldValue(field, deserializeValue(column.value(), getValueClass(ColumnDef.class,
field.getFieldName())));
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2b8a534/src/java/org/apache/cassandra/config/KSMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/KSMetaData.java b/src/java/org/apache/cassandra/config/KSMetaData.java
index 48cb589..e671511 100644
--- a/src/java/org/apache/cassandra/config/KSMetaData.java
+++ b/src/java/org/apache/cassandra/config/KSMetaData.java
@@ -307,6 +307,12 @@ public final class KSMetaData
                 continue;
 
             KsDef._Fields field = KsDef._Fields.findByName(comparator.getString(ksAttr.name()));
+
+            // this means that given field was deprecated
+            // but still exists in the serialized schema
+            if (field == null)
+                continue;
+
             ksDef.setFieldValue(field, deserializeValue(ksAttr.value(), getValueClass(KsDef.class,
field.getFieldName())));
         }
 
@@ -381,6 +387,12 @@ public final class KSMetaData
             }
 
             CfDef._Fields field = CfDef._Fields.findByName(attr[1]);
+
+            // this means that given field was deprecated
+            // but still exists in the serialized schema
+            if (field == null)
+                continue;
+
             cfDef.setFieldValue(field, deserializeValue(column.value(), getValueClass(CfDef.class,
field.getFieldName())));
         }
 


Mime
View raw message