mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 23:08:22 -05:00
tdb_cassandra: Resurrect View.get_time_sorted_columns.
This commit is contained in:
committed by
Neil Williams
parent
0aaf9b9307
commit
ed44ccf213
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user