如何从 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恐怕没有办法让 Cassandra 为你做这件事;您需要从 Cassandra 获取整行(对大行进行分页)并在客户端中对其进行排序。
如果您的解决方案可以处理非最新结果,您可以使用定期 MapReduce 作业来为您执行此操作,并将作业结果缓存回 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.
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.