如何在Spark-Cassandra-Connector中使用bulkSaveToCassandra方法 [英] How to use method bulkSaveToCassandra with spark-cassandra-connector

查看:67
本文介绍了如何在Spark-Cassandra-Connector中使用bulkSaveToCassandra方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将方法 bulkSaveToCassandra 与spark-cassandra-connector一起使用,以优化我在Cassandra数据库中的插入.但是,我找不到该方法,也不知道如何导入该库.

I'm trying to use the method bulkSaveToCassandra with spark-cassandra-connector to optimize my insertions in Cassandra Database. However, I can't find out the method and I don't know how to import the lib.

当前,我正在使用此依赖项:

Currently, I'm using this dependency:

<dependency>
            <groupId>com.datastax.spark</groupId>
            <artifactId>spark-cassandra-connector_2.11</artifactId>
            <version>2.0.2</version>
</dependency>

在Datastax的方法bulkSaveToCassandra的引用下面: http://docs.datastax.com/en/datastax_enterprise/4.7/datastax_enterprise/migration/migratingBulkSparkRDD.html

Below the reference of method bulkSaveToCassandra from Datastax: http://docs.datastax.com/en/datastax_enterprise/4.7/datastax_enterprise/migration/migratingBulkSparkRDD.html

我使用了链接中显示的导入,但是仍然无法正常工作.

I used the import presented in link but it don't work anyway.

最诚挚的问候,

推荐答案

该方法仅在DataStax Enterprise中可用.

That method is only available in DataStax Enterprise.

必需的类在DSE安装随附的dse-spark * .jar中.

The required class is inside of the dse-spark*.jar which comes with the DSE Installation.

例如,可以从 dse spark 外壳程序中获得.

For example this would be available from the dse spark shell.

尽管大多数情况下,我还是建议只使用普通的写方法,因为bulkMethod使用的是sstable writer,它存在可用性问题,不适用于生产用例.

I would recommend just using the normal write method though for most use cases as the bulkMethod uses the sstable writer which has availability issues which don't jive well with production use cases.

这篇关于如何在Spark-Cassandra-Connector中使用bulkSaveToCassandra方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆