【问题标题】:How can I fetch first n rows in phpcassa(Cassandra)?如何获取 phpcassa(Cassandra) 中的前 n 行?
【发布时间】:2014-07-23 04:21:01
【问题描述】:

我想先获取前 n 行,然后再获取下 n 行,然后继续这样。如何在 phpcassa/Cas​​sandra 中做到这一点?

//编辑
我在 phpcassa 中看到了 ColumnFamily::create_slice_predicate 方法,但它是私有的,并且 get 方法总是需要行键。我想要 Cassandra-Cluster-Admin 的浏览列族功能。我只是想知道是否有 phpcassa 解决方案或者我应该挖掘 thrift API?

【问题讨论】:

    标签: php cassandra phpcassa


    【解决方案1】:

    使用 ColumnFamily::get_range。它做你想做的事,但将它包装在一个漂亮的 Iterator 接口中,这样你就不必自己进行分块。

    您可以在phpcassa tutorial 中找到它的示例。

    【讨论】:

      猜你喜欢
      • 2012-09-04
      • 1970-01-01
      • 2013-12-24
      • 2014-11-21
      • 1970-01-01
      • 2012-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多