问题
Can we read list of all available subcolumns for multiple supercolumns against a key in one request.
for example
we have a key "y1" with supercolumns x1,x2,x3
x1 has subcolumns with names like c1,c2,c3
x2 has subcolumns c9 and c8
x3 has c1,c3,c10
I want to read all the subcolumns in one request against one key "y1".
回答1:
You'll want to use a super slice query and specify a range. Here's a Hector example:
SuperSliceQuery query = HFactory.createSuperSliceQuery(keyspace, ... serializers ...);
query.setColumnFamily(columnFamily)
.setKey(key)
.setRange("", "", false, Integer.MAX_VALUE);
来源:https://stackoverflow.com/questions/10541044/all-subcolumns-for-multiple-supercolumns-against-a-key-in-cassandra