创建键空间

发布于 2025-01-04 16:11:07 字数 1553 浏览 6 评论 0原文

我正在尝试从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

战皆罪 2025-01-11 16:11:07

我会使用 https://github.com/ostinelli/erlcassa 而不是 Erlang 的原始 Thrift。

I would use https://github.com/ostinelli/erlcassa over raw Thrift from Erlang.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文