tdb_cassandra: Resurrect View.get_time_sorted_columns.

This commit is contained in:
Brian Simpson
2012-11-09 18:05:36 -08:00
committed by Neil Williams
parent 0aaf9b9307
commit ed44ccf213

View File

@@ -1431,6 +1431,14 @@ class View(ThingBase):
# TODO: at present this only grabs max_column_count columns
return self._t
@classmethod
def get_time_sorted_columns(cls, rowkey, limit=None):
q = cls._cf.xget(rowkey, include_timestamp=True)
r = sorted(q, key=lambda i: i[1][1]) # (col_name, (col_val, timestamp))
if limit:
r = r[:limit]
return OrderedDict([(i[0], i[1][0]) for i in r])
@classmethod
@will_write
def _set_values(cls, row_key, col_values,