Our column names are purposefully picked so that they are returned in the order we want (the key is basically an internal sequence number). Our rowkeys are similarly ordered. Basically one rowkey per day, all columns for the day added to that row.
Given that, how do I create a query in Hector to return me the most recent column from the most recent row? Or the oldest? In a nutshell, the two most common queries are "get me the most recent entry" and "get me the oldest entry".
I'm not familiar enough with Cassandra or Hector to puzzle out the correct query though. It should look something like this?
QueryResult<OrderedRows<String, String, Long>> result =
rangeSlicesQuery.setColumnFamily(cf).setKeys("", "").setRowCount(1).setRange("","",true,1).execute();
Since the column names are dynamically generated values and I have no idea when the last or first value is, I don't see any way of getting around the open ended values for keys and column ranges. Hopefully Hector/Cassandra is smart enough to do this quickly or is there some optimization I should make?