cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1211522 - /cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
Date Wed, 07 Dec 2011 16:36:35 GMT
Author: eevans
Date: Wed Dec  7 16:36:35 2011
New Revision: 1211522

URL: http://svn.apache.org/viewvc?rev=1211522&view=rev
Log:
Update to support TimeUUIDType (CASSANDRA-3541)

Patch by eevans; reviewed by Pavel Yaskevich for CASSANDRA-2268

Modified:
    cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java

Modified: cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java?rev=1211522&r1=1211521&r2=1211522&view=diff
==============================================================================
--- cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
(original)
+++ cassandra/trunk/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
Wed Dec  7 16:36:35 2011
@@ -30,6 +30,7 @@ import org.apache.cassandra.stress.Sessi
 import org.apache.cassandra.stress.util.Operation;
 import org.apache.cassandra.thrift.Cassandra;
 import org.apache.cassandra.thrift.Compression;
+import org.apache.cassandra.utils.UUIDGen;
 
 public class CqlInserter extends Operation
 {
@@ -55,8 +56,15 @@ public class CqlInserter extends Operati
         {
             if (i > 0)
                 query.append(',');
-            query.append('C').append(i).append('=');
-            query.append(getQuotedCqlBlob(values.get(i % values.size()).array()));
+
+            // Column name
+            if (session.timeUUIDComparator)
+                query.append(UUIDGen.makeType1UUIDFromHost(Session.getLocalAddress()).toString());
+            else
+                query.append('C').append(i);
+
+            // Column value
+            query.append('=').append(getQuotedCqlBlob(values.get(i % values.size()).array()));
         }
         
         String key = String.format("%0" + session.getTotalKeysLength() + "d", index);



Mime
View raw message