cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1095239 - in /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal: AbstractCommutativeType.java UUIDType.java
Date Wed, 20 Apr 2011 00:13:02 GMT
Author: jbellis
Date: Wed Apr 20 00:13:02 2011
New Revision: 1095239

URL: http://svn.apache.org/viewvc?rev=1095239&view=rev
Log:
add decompose methods to new-since-0.7 AbstractTypes
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/UUIDType.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java?rev=1095239&r1=1095238&r2=1095239&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
Wed Apr 20 00:13:02 2011
@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.context.CounterContext;
+import org.apache.cassandra.utils.ByteBufferUtil;
 
 public abstract class AbstractCommutativeType extends AbstractType<Long>
 {
@@ -37,6 +38,11 @@ public abstract class AbstractCommutativ
         return CounterContext.instance().total(bytes);
     }
 
+    public ByteBuffer decompose(Long value)
+    {
+        return ByteBufferUtil.bytes(value);
+    }
+
     /**
      * create commutative column
      */

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/UUIDType.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/UUIDType.java?rev=1095239&r1=1095238&r2=1095239&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/UUIDType.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/marshal/UUIDType.java
Wed Apr 20 00:13:02 2011
@@ -204,6 +204,11 @@ public class UUIDType extends AbstractTy
         return uuid.toString();
     }
 
+    public ByteBuffer decompose(UUID value)
+    {
+        return ByteBuffer.wrap(UUIDGen.decompose(value));
+    }
+
     @Override
     public ByteBuffer fromString(String source) throws MarshalException
     {



Mime
View raw message