erocksdb:open总是返回{ok,<<>>},但是<<>>不是空的二进制文件,它是db句柄的ref。为什么?

时间:2017-01-18 09:57:20

标签: erlang rocksdb

(veronica1@10.20.0.68)13> {ok, Ref} = erocksdb:open("data/test.db", [{create_if_missing, true}], []).
{ok, <<>>}
(veronica1@10.20.0.68)14> Ref =:= <<>>.
true
(veronica1@10.20.0.68)15> erocksdb:get(Ref, <<"a">>, []).
{ok,<<"b">>}
(veronica1@10.20.0.68)16> erocksdb:get(<<>>, <<"a">>, []).
** exception error: bad argument
     in function  erocksdb:async_get/4
        called as erocksdb:async_get(#Ref<0.0.8.180>,<<>>,<<"a">>,[])
     in call from erocksdb:get/3 (/Users/tiexiao/code/my_projects/riak_core_x/_build/default/lib/erocksdb/src/erocksdb.erl, line 339)

为什么“Ref”如此特别?

有人能帮助我吗?

0 个答案:

没有答案