Cassandra- Pelops:尝试将数据插入 cassandra 时出现“没有此类方法”错误

发布于 2024-12-19 16:56:15 字数 1049 浏览 6 评论 0原文

当我尝试使用 pelops api 将数据插入 cassandra 时出现以下错误

 java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V

我正在使用以下 jars

  1. scale7-core-1.3.0.jar
  2. scale7-pelops-0.912-0.7.0-rc4-1.jar
  3. lib 中的所有 jars cassandra-1.0.5 目录

下调用以下函数导致异常

public void writeToBatch(String columnFamily, String rowKey, String colmName,String value, int ttl)
 {
     this.mutator.writeColumn(columnFamily, rowKey,
                mutator.newColumn(colmName, value, ttl));
 }

错误堆栈如下:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:625)
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:562)
    at com.audienceadnetwork.cassandra.sstablewriter.utils.PelopsClient.writeToBatch(Unknown Source)

I am getting following error when m trying to insert data into cassandra using pelops api

 java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V

I am Using following jars

  1. scale7-core-1.3.0.jar
  2. scale7-pelops-0.912-0.7.0-rc4-1.jar
  3. All the jars in lib directory of cassandra-1.0.5

Call to following function causes a exception

public void writeToBatch(String columnFamily, String rowKey, String colmName,String value, int ttl)
 {
     this.mutator.writeColumn(columnFamily, rowKey,
                mutator.newColumn(colmName, value, ttl));
 }

Error stack is as follows:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:625)
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:562)
    at com.audienceadnetwork.cassandra.sstablewriter.utils.PelopsClient.writeToBatch(Unknown Source)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

难理解 2024-12-26 16:56:15

您正在将针对 cassandra-1.0.5 构建的 thrift 绑定与针对更旧的 thrift 绑定构建的 pelops 版本混合在一起。 api 本身是向后兼容的,但你不能像这样混合绑定。您有两个选择:

最好的选择可能是升级到较新版本的 pelops。根据其 github,有适用于 1.0.x 版本的快照版本: https://github.com/s7 /scale7-pelops

如果由于某种原因您需要使用上面使用的 pelops 版本,那么您还需要使用该版本所依赖的 cassandra thrift 绑定,而不是针对 cassandra 1.0.5 构建的绑定。

You are mixing the thrift bindings built against cassandra-1.0.5 with a version of pelops built against much older thrift bindings. The api itself is backwards compatible but you can't mix bindings like this. You have two options:

The best option is probably to upgrade to a newer version of pelops. There are snapshot versions available for the 1.0.x releases according to their github: https://github.com/s7/scale7-pelops.

If for some reason you need to use the version of pelops used above then you also need to use the cassandra thrift bindings that version depends on, rather than the ones built against cassandra 1.0.5.

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