You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Lubos Pusty <lu...@gmail.com> on 2010/04/23 15:40:02 UTC
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='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
RE: lazyboy - batch insert
Posted by Dop Sun <su...@dopsun.com>.
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