Reputation: 2759
I need to get all column:column_value pairs for a key. the constraint is columns have a common Prefix , is there a way to get it using Hector ?
Upvotes: 0
Views: 208
Reputation: 16400
you can do a SliceQuery, and do a range from the prefix to prefix|, providing its only alphanumerics that should work.
StringSerializer ss = StringSerializer.get();
SliceQuery sliceQuery = HFactory.createSliceQuery(keySpace, rowSerializer, ss, ss);
sliceQuery.setColumnFamily(MY_COLUMN_FAMILY);
sliceQuery.setKey(rowKey);
sliceQuery.setRange("prefix", "prefix|", false, Integer.MAX_INT);
Upvotes: 0