cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dop Sun" <su...@dopsun.com>
Subject RE: lazyboy - batch insert
Date Fri, 23 Apr 2010 14:32:00 GMT
http://code.google.com/p/jassandra/source/browse/trunk/org.softao.jassandra/
src/org/softao/jassandra/thrift/ThriftColumnFamily.java

 

Insert and Delete method of this class are using batch_mutation.

Cheers.

Dop

 

From: Lubos Pusty [mailto:lubospusty@gmail.com] 
Sent: Friday, April 23, 2010 9:40 PM
To: user@cassandra.apache.org
Subject: lazyboy - batch insert

 

Hello,

 

Is there a possibility to execute batch mutation (e.g. insert) over
different rows with supercolumns in lazyboy?

 

To be more concrete:

 

Keyspace1: {

 

ColumnFamily1: {

  rowid1: {

    SuperColumn1: {

       key1_1 : val1,

       key1_2 : val2,

..

     },

    SuperColumn2: {

       key2_1 : val1,

       key2_2 : val2,

    }

  }

  rowid2: {

    SuperColumn3: {

...

}

 

}

 

Records are part of same columnfamily with following keys:

 

Key(keyspace='Keyspace',column_family='ColumnFamily1',super_column='SuperCol
umn1', key='rowid1')

Key(keyspace='Keyspace',column_family='ColumnFamily1',super_column='SuperCol
umn2', key='rowid1')

Key(keyspace='Keyspace',column_family='ColumnFamily1',super_column='SuperCol
umn3', key='rowid2')

 

Having those records filled with data and keys, I'd like to insert them in
batch instead of doing it one by one (as it is currently implemented in
lazyboy):

 

recordset.py:

 

 
def save(self, consistency=None):
 
        consistency = consistency or self.consistency
 
        records = modified(self.itervalues())
 
        if not valid(records):
 
            raise ErrorMissingField("Missing required field(s):",
 
                                    missing(records))
 
        for record in records:
 
            record.save(consistency)
 
        return self
 
 
I've seen in thrift interface specification method batch_mutate with
mutation_map, is it relevant to this type of operation?
 
 
Thanks,
 
 
Lubos
 

Mime
View raw message