【问题标题】:erlang thrift cassandra multiget_slice returns empty listerlang thrift cassandra multiget_slice 返回空列表
【发布时间】:2012-05-11 00:06:59
【问题描述】:

我在 erlang 中遇到了 multiget_slice cassandra thrift 接口的问题。我能够从 multiget_count 获取同一组键的数据,但是 multiget_slice 返回一个空列表。我正在使用节俭 0.8.0 和 cassandra 1.0.6。这是我的代码

Keys = [<<"key1">>, <<"key2">>],
ColumnParent = #columnParent{column_family=ColumnFamily},                                                                                           
SliceRange = #sliceRange{start="", finish="", reversed=false, count=2147483647},
SlicePredicate = #slicePredicate{slice_range=SliceRange, column_names=undefined},

{ok, Conn} = thrift_client_util:new(Host, Port, cassandra_thrift, [{framed, true}]), ok,
{Conn2, {ok, ok}} = thrift_client:call(Conn, set_keyspace, [Keyspace]),
{NewCon, Response} = thrift_client:call(Conn2, multiget_slice, [Keys, ColumnParent, SlicePredicate, 1]),

Response returns the following: {ok, []}

但是,在同一组键上运行 multiget_count 会产生适当的结果。我在这里做错了什么?

【问题讨论】:

    标签: erlang cassandra thrift


    【解决方案1】:

    似乎您必须在 SliceRange 中指定一些非空的开始和结束。

    【讨论】:

      猜你喜欢
      • 2012-05-17
      • 1970-01-01
      • 2017-06-23
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 2015-10-26
      • 2013-09-27
      • 2019-08-18
      相关资源
      最近更新 更多