thrift - Cassandra createSliceQuery clarification -
i'm trying retrieve columns of row in cassandra using thrift 1.0 lib. found examples googling , in particular:
slicequery<string, string, string> slicequery = hectortemplate.createslicequery( stringserializer.get(), stringserializer.get(), stringserializer.get()); slicequery.setcolumnfamily("myname"); slicequery.setkey("myid"); slicequery.setrange(null, null, false, 20); queryresult<columnslice<string,string>> queryresult = slicequery.execute(); columnslice<string,string> slice = queryresult.get(); list<hcolumn<string, string>> retrievedcolumns = slice.getcolumns(); (hcolumn<string, string> column : retrievedcolumns) { system.out.println(column.getname() +"::"+ column.getvalue()); }
however, not find information on parameters , types in hector objects are??
for example, here:
slicequery<string, string, string>
- all types here string - types of? column name type? column value types?
then, specify parameters createslicequery():
hectortemplate.createslicequery( stringserializer.get(), stringserializer.get(), stringserializer.get());
again - serializers for? why there 3 serializers - if first , last column, , else? if many columns, how specify serializers them?
then, retrieve
list<hcolumn<string, string>>
-- again, these string types for? if have column of type bytestype - specify that?
if there decent api docs (not method signatures no explanation of parameters are) - point me them?
thanks! marina
in case slicequery<k, c, v>
, here type parameters:
k -- type of key
c -- type of column name
v -- type of column value
again in case of hcolumn<n,v>
, type parameters are
n -- type of column name
v -- type of column value
similar case of createslicequery
Comments
Post a Comment