cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r930902 - in /cassandra/trunk: interface/cassandra.avpr src/java/org/apache/cassandra/avro/AvroRecordFactory.java
Date Mon, 05 Apr 2010 17:01:21 GMT
Author: eevans
Date: Mon Apr  5 17:01:20 2010
New Revision: 930902

URL: http://svn.apache.org/viewvc?rev=930902&view=rev
Log:
ColumnParent schema and record factory method

Patch by eevans

Modified:
    cassandra/trunk/interface/cassandra.avpr
    cassandra/trunk/src/java/org/apache/cassandra/avro/AvroRecordFactory.java

Modified: cassandra/trunk/interface/cassandra.avpr
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.avpr?rev=930902&r1=930901&r2=930902&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.avpr (original)
+++ cassandra/trunk/interface/cassandra.avpr Mon Apr  5 17:01:20 2010
@@ -10,6 +10,12 @@
             {"name": "column", "type": ["bytes", "null"]}
         ]
       },
+      {"name": "ColumnParent", "type": "record",
+          "fields": [
+            {"name": "column_family", "type": "string"},
+            {"name": "super_column", "type": ["bytes", "null"]}
+        ]
+      },
       {"name": "Column", "type": "record",
           "fields": [
             {"name": "name", "type": "bytes"},

Modified: cassandra/trunk/src/java/org/apache/cassandra/avro/AvroRecordFactory.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/avro/AvroRecordFactory.java?rev=930902&r1=930901&r2=930902&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/avro/AvroRecordFactory.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/avro/AvroRecordFactory.java Mon Apr  5 17:01:20
2010
@@ -83,6 +83,15 @@ public class AvroRecordFactory
         ByteBuffer wrappedColumn = (column != null) ? ByteBuffer.wrap(column) : null;
         return newColumnPath(cfName, wrappedSuperColumn, wrappedColumn);
     }
+
+    public static ColumnParent newColumnParent(String cfName, byte[] superColumn)
+    {
+        ColumnParent cp = new ColumnParent();
+        cp.column_family = new Utf8(cfName);
+        if (superColumn != null)
+            cp.super_column = ByteBuffer.wrap(superColumn);
+        return cp;
+    }
 }
 
 class ErrorFactory



Mime
View raw message