cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goffi...@apache.org
Subject svn commit: r1068028 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
Date Mon, 07 Feb 2011 17:39:56 GMT
Author: goffinet
Date: Mon Feb  7 17:39:55 2011
New Revision: 1068028

URL: http://svn.apache.org/viewvc?rev=1068028&view=rev
Log:
Fix internal exception when not passing in column_metadata over Thrift patch by goffinet;
reviewed by gdusbabek for CASSANDRA-2096

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java?rev=1068028&r1=1068027&r2=1068028&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/CFMetaData.java
Mon Feb  7 17:39:55 2011
@@ -801,14 +801,17 @@ public final class CFMetaData
         newDef.subcomparator_type = def.getSubcomparator_type();
         
         List<org.apache.cassandra.avro.ColumnDef> columnMeta = new ArrayList<org.apache.cassandra.avro.ColumnDef>();
-        for (org.apache.cassandra.thrift.ColumnDef cdef : def.getColumn_metadata())
+        if (def.isSetColumn_metadata())
         {
-            org.apache.cassandra.avro.ColumnDef tdef = new org.apache.cassandra.avro.ColumnDef();
-            tdef.name = ByteBufferUtil.clone(cdef.BufferForName());
-            tdef.validation_class = cdef.getValidation_class();
-            tdef.index_name = cdef.getIndex_name();
-            tdef.index_type = cdef.getIndex_type() == null ? null : org.apache.cassandra.avro.IndexType.valueOf(cdef.getIndex_type().name());
-            columnMeta.add(tdef);
+            for (org.apache.cassandra.thrift.ColumnDef cdef : def.getColumn_metadata())
+            {
+                org.apache.cassandra.avro.ColumnDef tdef = new org.apache.cassandra.avro.ColumnDef();
+                tdef.name = ByteBufferUtil.clone(cdef.BufferForName());
+                tdef.validation_class = cdef.getValidation_class();
+                tdef.index_name = cdef.getIndex_name();
+                tdef.index_type = cdef.getIndex_type() == null ? null : org.apache.cassandra.avro.IndexType.valueOf(cdef.getIndex_type().name());
+                 columnMeta.add(tdef);
+            }
         }
         newDef.column_metadata = columnMeta;
         return newDef;



Mime
View raw message