cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shu Zhang <>
Subject please help with multiget
Date Tue, 18 Jan 2011 00:53:58 GMT
Here's the method declaration for quick reference:
map<string,list<ColumnOrSuperColumn>> multiget_slice(string keyspace, list<string>
keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level)

It looks like you must have the same SlicePredicate for every key in your batch retrieval,
so what are you suppose to do when you need to retrieve different columns for different keys?
I mean, it seems like to fully take advantage of cassandra's data structure, you often want
to put dynamic data as column names, and different rows may have totally different column
names. That's pretty standard practice right? Then it seems like you should be able to batch
get-requests mapping different slicepredicates to different keys in an efficient way.

The only way I can think of to retrieve different columns for different keys (besides breaking
them into individual requests) is to set the SlicePredicate so that you retrieve entire rows
and then parse it on the client side... but that seems a little inefficient and a bit of a
pain. Is that what people do? I can see this not being TOO much more inefficient since a single
row is always kept together physically.

I haven't found a lot of other complaints about this so maybe I am missing something. But
a get request takes a key and a column path, so it seems like a batch-get should allow you
to specify any combination of key-columnPath or key-slicePredicate pairs. I mean, intuitive
design-wise, for any batch operation, it makes sense to allow for batching together any number
of corresponding non-batch operations. Ie. If I can make a non-batch get request for (key1,
colNam1), and I can make a non-batch get request for (key2, colName2), then I should be able
to make a batch request for (key1, colName1) and (key2, colName2).

Furthermore, a batch-get method signature like

map<string,list<ColumnOrSuperColumn>> multiget_slice(string keyspace, map<string,
list<SlicePredicate>>> mutation_map, ConsistencyLevel consistency_level)

look a lot more symmetrical to the batch_mutate method
void batch_mutate(string keyspace, map<string,map<string,list<Mutation>>>
mutation_map, ConsistencyLevel consistency_level)



View raw message