简体   繁体   English

com.datastax.oss -> java-driver-core 和 com.datastax.cassandra -> cassandra-driver-core 之间的 Cassandra 区别

[英]Cassandra difference between com.datastax.oss -> java-driver-core and com.datastax.cassandra -> cassandra-driver-core

I wrote a program with the following package我用以下包编写了一个程序

<dependency>
   <groupId>com.datastax.cassandra</groupId>
   <artifactId>cassandra-driver-core</artifactId>
   <version>3.6.0</version>
</dependency>

But when I change it to 4.0.0 it doesn't have some critical classes.但是当我将其更改为4.0.0它没有一些关键类。

I search and read in Datastax that I must use the following package:我在 Datastax 中搜索并阅读我必须使用以下包:

<dependency>
  <groupId>com.datastax.oss</groupId>
  <artifactId>java-driver-core</artifactId>
  <version>4.0.0</version>
</dependency>

So, it totally have different classes, So what is the right package from Datastax to use in java for connecting and working with Cassandra?那么,它完全有不同的类,那么在 Java 中使用 Datastax 的正确包是什么来连接和使用 Cassandra? Which one is better to use and what is the main difference?哪个更好用,主要区别是什么?

This really depends on your requirements:这实际上取决于您的要求:

  • if you're developing completely new application, then you need to use 4.x versions of the driver, as 3.x won't get new functionality, only critical bug fixes.如果您正在开发全新的应用程序,那么您需要使用 4.x 版本的驱动程序,因为 3.x 不会获得新功能,只会修复关键的错误。 Latest version right now is 4.9.0 - check documentation for exact Maven definition - it should match your second snippet. 现在的最新版本是 4.9.0 - 检查文档以获取确切的 Maven 定义 - 它应该与您的第二个代码段匹配。 Please take into account that this driver is quite different from the 3.x versions, so copy-pasting old examples won't work, but you can follow the upgrade guide to translate them to the new version.请注意,此驱动程序与 3.x 版本有很大不同,因此复制粘贴旧示例将不起作用,但您可以按照升级指南将它们转换为新版本。
  • if you have existing code, then you may stick to the latest 3.x version ( 3.10 right now ) because porting to 4.x versions could lead to significant rewrite of application caused by architectural changes in new version.如果您有现有代码,那么您可能会坚持使用最新的 3.x 版本(现在3.10 ),因为移植到 4.x 版本可能会导致由于新版本的架构变化而导致应用程序的大量重写。 Consult upgrade guide for details of porting.有关移植的详细信息,请参阅升级指南。 Also, you can check following repository for examples of code ported to 4.x.此外,您可以查看以下存储库以获取移植到 4.x 的代码示例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Caused by: com.datastax.oss.driver.api.core.InvalidKeyspaceException: Invalid keyspace mykeyspace in Spring Boot Cassandra - Caused by: com.datastax.oss.driver.api.core.InvalidKeyspaceException: Invalid keyspace mykeyspace in Spring Boot Cassandra java cassandra connection java.lang.ClassNotFoundException:com.datastax.driver.core.Cluster - java cassandra connection java.lang.ClassNotFoundException: com.datastax.driver.core.Cluster Java,Spark和Cassandra java.lang.ClassCastException:com.datastax.driver.core.DefaultResultSetFuture无法转换为阴影 - Java, Spark and Cassandra java.lang.ClassCastException: com.datastax.driver.core.DefaultResultSetFuture cannot be cast to shade Cassandra-com.datastax.driver.core.exceptions.DriverException:尝试获取可用连接时超时 - Cassandra - com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection Cassandra概念验证面临的问题:异常-com.datastax.driver.core.DataType.asJavaClass()Ljava / lang / Class; - Facing issues with Cassandra Proof of concepts: Exception - com.datastax.driver.core.DataType.asJavaClass()Ljava/lang/Class; 卡桑德拉数据库。 com.datastax.driver.core.exceptions.InvalidQueryException:未配置的表人 - Cassandra DB. com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table person Databricks Spark Cassandra 连接抛出异常:com.datastax.driver.core.exceptions.NoHostAvailableException - Databricks Spark Cassandra connectivity throwing exception: com.datastax.driver.core.exceptions.NoHostAvailableException 为什么 Cassandra 抛出 com.datastax.driver.core.exceptions.InvalidQueryException:为列找到多个定义 - Why Cassandra throwing com.datastax.driver.core.exceptions.InvalidQueryException: Multiple definitions found for column NoClassDefFoundError-Cassandra的datastax Java驱动程序 - NoClassDefFoundError - datastax java driver for Cassandra Cassandra DataStax驱动程序慢吗? - Cassandra DataStax driver slow?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM