cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alaksh...@apache.org
Subject svn commit: r757232 - /incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java
Date Sun, 22 Mar 2009 18:46:03 GMT
Author: alakshman
Date: Sun Mar 22 18:46:02 2009
New Revision: 757232

URL: http://svn.apache.org/viewvc?rev=757232&view=rev
Log:
Applied the patch for returning a valid Column Sort type.

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java?rev=757232&r1=757231&r2=757232&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamily.java Sun Mar 22 18:46:02
2009
@@ -42,7 +42,8 @@
 public final class ColumnFamily implements Serializable
 {
     private static ICompactSerializer2<ColumnFamily> serializer_;
-    public static final short utfPrefix_ = 2;
+    public static final short utfPrefix_ = 2;   
+    public static final String defaultColumnSortProperty_ = "Time";
     /* The column serializer for this Column Family. Create based on config. */
 
     private static Logger logger_ = Logger.getLogger( ColumnFamily.class );
@@ -85,7 +86,8 @@
     {
     	if ( columnIndexProperty == null )
     		return indexTypes_.get("Time");
-    	return indexTypes_.get(columnIndexProperty);
+        String columnSortType = indexTypes_.get(columnIndexProperty);
+    	return (columnSortType == null) ? ColumnFamily.defaultColumnSortProperty_ : columnSortType;
     }
 
     private transient AbstractColumnFactory columnFactory_;
@@ -493,12 +495,11 @@
         /* write if this cf is marked for delete */
         dos.writeBoolean(columnFamily.isMarkedForDelete());
     	/* write the size is the number of columns */
-        dos.writeInt(columns.size());
-
+        dos.writeInt(columns.size());                    
         /* write the column data */
     	for ( IColumn column : columns )
         {
-            columnFamily.getColumnSerializer().serialize(column, dos);
+            columnFamily.getColumnSerializer().serialize(column, dos);            
         }
     }
 



Mime
View raw message