如何从Cassandra获取排序的计数器 [英] How to get sorted counters from Cassandra

查看:152
本文介绍了如何从Cassandra获取排序的计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一排计数器,我想得到它的列按值排序。是否有任何策略或数据模型?

I have a row of counters and I want to get its' columns sorted by values. Is there any strategies or data models for that?

推荐答案

恐怕没有办法让Cassandra为你做这个;您将需要从Cassandra中获取整行(分页为大行)并在客户端中排序。

I'm afraid there is no way of having Cassandra do this for you; you will need to get the entire row from Cassandra (paging for large rows) and sort it in the client.

您可以使用定期的MapReduce作业为您执行此操作,并将作业的结果缓存到Cassandra,如果您的解决方案可以处理非最新的结果。

You could use a periodic MapReduce job to do this for you, and cache the result of the job back into Cassandra, if your solution can cope with non-uptodate results.

这篇关于如何从Cassandra获取排序的计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆