Cassandra 0.8 = 什么样的“行计数”?提供了哪些功能?
Cassandra 中的“行计数”(在 CF 中)同时支持
RAndomPartitioner 吗?
b) OrderPreservingPartitioner?
http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters" datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters 意味着这很容易实现?引用:““计数”在这里的意思是在单个列值中提供原子增量操作,而不是计算行中的列数或列族中的行数,这两种操作都已受到支持。”
两年前,RP 绝对不支持: Cassandra 中列族的行数
此外,即使使用 OrderPreservingPartitioner ,这是(?)一个非常繁重的操作(据我所知,我必须检索所有对象,这不仅是对行计数的轻量级计数操作,而且还读取所有数据(行?)?)
更新:我绝对知道,新的计数功能与行计数完全不同。但上面的文本暗示行计数也很容易实现,并且支持引用“...两者都受支持...”?这种营销语言是否意味着只能使用 get_range_slice 作为极其沉重的操作?或者是否有一些我完全缺少的新东西,对于两个分区器来说都是轻量级的?
谢谢
马库斯
are "Row Counts" (in a CF) in Cassandra meanwhile supported for
a) RAndomPartitioner ?
b) OrderPreservingPartitioner?
http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters implies this is easily possible? Quote: " “counting,” we mean here to provide an atomic increment operation in a single column value, as opposed to counting the number of columns in a row, or rows in a column family, both of which were already supported."
Two years ago it was defenitely not supported for RP:
Row count of a column family in Cassandra
Furthermoe even with OrderPreservingPartitioner, it was(??) a very heavy Operation (as far as I understood i have to retrieve all objects, this is/was not only a lightweight count operation to the row-count, but rather read also all data (rows?) ?)
Update: I am absolutely aware of, that the new counting feature is completely different to row-counts. But the text above implies row-counts are also easily possible and supported quote "...both of which are supported..."? Is this marketing language meaning it is only possible as an extremely heaving operation using get_range_slice? Or is there something new that I am completly missing, that does this lightweight for both partitioniers?
Thanks
Markus
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
计数器和计算行/列数是两个不同的主题。
http://cassandra-user-incubator -apache-org.3065146.n2.nabble.com/Count-rows-td5420889.html
我会建议,当您向列族添加新行时,只需将计数器 CF/行/键增加+1,您就不必翻阅所有行(如上面的链接所述,如果您有数十亿行怎么办?)--这也让您不必关心您使用哪个分区器......
Counters and counting the number of rows / columns are two different topics.
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Count-rows-td5420889.html
I would suggest, as you add new rows to a column family, simply increment +1 a counter CF/row/key and you wont have to page through all of the rows (as the link above says, what if you have billions?) -- This also allows you to not care which partitioner you use ...
萨沙说到了重点。只是想澄清这一点:
是的,我 12 月 9 日的回答已经过时了。 RandomPartitioner 暂时支持以暴力方式(顺序扫描)计算行数。
Sasha hit the important points. Just wanted to clear this up:
Yes, my answer from Dec 09 is outdated. Counting rows the brute-force way (seq scan) is supported on RandomPartitioner for a while now.
Cassandra 中的行计数实际上是一种反模式。在极少数情况下,您必须执行此操作,您可以使用范围切片查询来迭代所有行并计算总数。这里给出了使用 Hector 的示例:
http://randomizedsort.blogspot.com/2011/10 /counting-all-rows-in-cassandra.html
Row counting in Cassandra is really an anti-pattern. In the rare event that you have to do this, you can use Range Slice Query to iterate through all rows and tally the total. An example using Hector is given here:
http://randomizedsort.blogspot.com/2011/10/counting-all-rows-in-cassandra.html