incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lubos Pusty <lubospu...@gmail.com>
Subject lazyboy - batch insert
Date Fri, 23 Apr 2010 13:40:02 GMT
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='SuperColumn1',
key='rowid1')
Key(keyspace='Keyspace',column_family='ColumnFamily1',super_column='SuperColumn2',
key='rowid1')
Key(keyspace='Keyspace',column_family='ColumnFamily1',super_column='SuperColumn3',
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