cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: convert internal_insert to use more-efficient RowMutation constructor
Date Thu, 28 Feb 2013 16:30:37 GMT
Updated Branches:
  refs/heads/trunk a37355fcc -> c7378a035


convert internal_insert to use more-efficient RowMutation constructor


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7378a03
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7378a03
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7378a03

Branch: refs/heads/trunk
Commit: c7378a035796348ac33078ab2744a08be055413e
Parents: a37355f
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Feb 28 10:30:26 2013 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Feb 28 10:30:26 2013 -0600

----------------------------------------------------------------------
 .../apache/cassandra/thrift/CassandraServer.java   |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7378a03/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 9ca2675..36b0e13 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -677,14 +677,16 @@ public class CassandraServer implements Cassandra.Iface
         ThriftValidation.validateColumnNames(metadata, column_parent, Arrays.asList(column.name));
         ThriftValidation.validateColumnData(metadata, column, column_parent.super_column
!= null);
 
-        RowMutation rm = new RowMutation(cState.getKeyspace(), key);
+        RowMutation rm;
         try
         {
             ByteBuffer name = column.name;
             if (metadata.isSuper())
                 name = CompositeType.build(column_parent.super_column, name);
 
-            rm.add(column_parent.column_family, name, column.value, column.timestamp, column.ttl);
+            ColumnFamily cf = ColumnFamily.create(Schema.instance.getId(cState.getKeyspace(),
column_parent.column_family));
+            cf.addColumn(name, column.value, column.timestamp, column.ttl);
+            rm = new RowMutation(cState.getKeyspace(), key, cf);
         }
         catch (MarshalException e)
         {


Mime
View raw message