cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ROGER PUIG GANZA <rp...@tid.es>
Subject client code supercolumn insertion from cassandra 0.3.0 to 0.4.0
Date Fri, 02 Oct 2009 08:50:24 GMT
Hi, I'm having problems with the translation of the client code for Cassandra 0.3.0 to the
0.4.0
My code for inserting columns is working properly but the one for the supercolumns is not
working.
Can anyone point me where the error is?

I'm skipping the exception handling code.

Code for Cassandra 0.3.0  is working properly, I can get the values with the client code using
the get_superColumn method and throught Cassandra-cli using get <tablename>.<CFName>[<key>][<col>][<subcol>]

Map<String, List<superColumn_t>> sColMap = new HashMap<String,List<superColumn_t>>();;
Map<String,List<column_t>> colMap = new HashMap<String,List<column_t>>();;
List<superColumn_t> sCol = new ArrayList<superColumn_t>();;
List<column_t> columns= new ArrayList<column_t>();

columns.add(new column_t(subColKey, "".getBytes("UTF-8"), timestamp));

sCol.add(new superColumn_t(columnName, columns));

sColMap.put(superColumnName, sCol);

batch_mutation_super_t bms = new batch_mutation_super_t(keyspace, superColKey, sColMap);

client.batch_insert_superColumn(bms, false);


Code for Cassandra 0.4.0 . It's suppoded to be working but when I fetch a superColumn with
using the superKey, it returns a NotFoundException and when using the Cassandra-cli, I get
this
InvalidRequestException(why:column parameter is not optional for super CF <CFName>

List<Column> colums = new ArrayList<Column>();
Map<String,List<ColumnOrSuperColumn>> map = new HashMap<String, List<ColumnOrSuperColumn>>();
List<ColumnOrSuperColumn> subColumns = new ArrayList<ColumnOrSuperColumn>();

columns.add(new Column(key.getBytes("UTF-8"), "".getBytes("UTF-8"), timestamp));
subColumns.add(new ColumnOrSuperColumn(null, new SuperColumn(InfoPerUserColNames.CFDevel.getBytes("UTF-8"),
columns)));

map.put(superColumnName, subColumns);
client.batch_insert(keyspace, superKey, map, ConsistencyLevel.ZERO);


thanks for your help.

Roger Puig


Mime
View raw message