gpt4 book ai didi

java - apache cassandra 依赖问题

转载 作者:行者123 更新时间:2023-11-29 05:04:58 25 4
gpt4 key购买 nike

我正在按照教程了解 Cassandra 的工作原理,但是我有一个导入问题

import static com.datastax.spark.connector.CassandraJavaUtil.*;

无法识别此导入,尤其是这一行:

javaFunctions(productsRDD, Product.class).saveToCassandra("java_api", "products");

我的 pom.xml 是这样的:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.sparkexamples</groupId>
<artifactId>cassandraExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>cassandraExample</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_2.10</artifactId>
<version>1.3.0-M1</version>
</dependency>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector-java_2.10</artifactId>
<version>1.3.0-M1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.10</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
</project>

我该如何解决?

提前致谢。

最佳答案

使用此导入,您正在使用旧 API。

import static com.datastax.spark.connector.japi.CassandraJavaUtil.javaFunctions;

关于java - apache cassandra 依赖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30661856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com