I have stored the data in the ComparatorType.BYTESTYPE in the Cassandra database. Now I want to retrieve data in the stored order.
I used the following code in Hector to get data, but the query results seems not sorted.
Keyspace keyspace = HFactory.createKeyspace("ClusterName", cluster);
Map<String, String> resultMap = new HashMap<String, String>();
SliceQuery<String, String, String> query = HFactory.createSliceQuery(keyspace, StringSerializer.get(), StringSerializer.get(), StringSerializer.get());
query.setColumnFamily("ColumnFamilyName").setKey("RowKey")
.setRange("", "", false, Integer.MAX_VALUE);
QueryResult<ColumnSlice<String, String>> result = query.execute();
for (HColumn<String, String> column : result.get().getColumns()) {
resultMap.put(column.getName(), column.getValue());
}
what am I missing?? Do I have to use RangeSliceQueries and OrderedRows??
Thanks in advance.