创建键空间
我正在尝试从 erlang 访问 cassandra,作为测试,我正在尝试创建一个新的键空间。我这样做如下:
1> rr(cassandra_thrift)。
[authenticationException,authenticationRequest,
authorizationException,cfDef,column,columnDef,
columnOrSuperColumn,columnParent,columnPath,counterColumn,
counterSuperColumn,cqlMetadata,cqlResult,cqlRow,deletion,
endpointDetails,indexClause,indexExpression,
invalidRequestException,keyCount,keyRange,keySlice,ksDef,
mutation,notFoundException,schemaDisagreementException,
slicePredicate,sliceRange,superColumn|...]
2> {ok,C1}=thrift_client_util:new("127.0.0.1",9160,thrift_cassandra,[])。
{ok,{tclient,thrift_cassandra,
{protocol,thrift_binary_protocol,
{binary_protocol,
{transport,thrift_buffered_transport,
{buffered_transport,
{transport,thrift_socket_transport,
{data,#Port<0.593>,infinity}},
[]}},
true,true}},
0}}
3> Reply1=thrift_client:call(C1,set_keyspace,["Test_KS"]).
** exception exit: undef
in function thrift_cassandra:function_info/2
called as thrift_cassandra:function_info(set_keyspace,params_type)
in call from thrift_client:send_function_call/3 (thrift_client.erl, line 70)
in call from thrift_client:call/3 (thrift_client.erl, line 40)
我做错了什么,还是我的 erlang 无法访问 cassandra 函数?我该如何修复它?
I am trying to access cassandra from erlang, as a test I am trying to create a new keyspace. I do it as follows:
1> rr(cassandra_thrift).
[authenticationException,authenticationRequest,
authorizationException,cfDef,column,columnDef,
columnOrSuperColumn,columnParent,columnPath,counterColumn,
counterSuperColumn,cqlMetadata,cqlResult,cqlRow,deletion,
endpointDetails,indexClause,indexExpression,
invalidRequestException,keyCount,keyRange,keySlice,ksDef,
mutation,notFoundException,schemaDisagreementException,
slicePredicate,sliceRange,superColumn|...]
2> {ok,C1}=thrift_client_util:new("127.0.0.1",9160,thrift_cassandra,[]).
{ok,{tclient,thrift_cassandra,
{protocol,thrift_binary_protocol,
{binary_protocol,
{transport,thrift_buffered_transport,
{buffered_transport,
{transport,thrift_socket_transport,
{data,#Port<0.593>,infinity}},
[]}},
true,true}},
0}}
3> Reply1=thrift_client:call(C1,set_keyspace,["Test_KS"]).
** exception exit: undef
in function thrift_cassandra:function_info/2
called as thrift_cassandra:function_info(set_keyspace,params_type)
in call from thrift_client:send_function_call/3 (thrift_client.erl, line 70)
in call from thrift_client:call/3 (thrift_client.erl, line 40)
Am I doing something wrong, or does my erlang not have access to the cassandra functions? How can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会使用 https://github.com/ostinelli/erlcassa 而不是 Erlang 的原始 Thrift。
I would use https://github.com/ostinelli/erlcassa over raw Thrift from Erlang.