Spring-data-cassandra 1.3.4 not compatible with Cassandra 3.x

不想你离开。 提交于 2019-12-04 06:14:42

Spring-Data-Cassandra 1.3.4 (and even the newest dev version) uses the client driver Cassandra 2.1.x see Datastax driver compatibility chart and you'll see that you need the 3.x client driver to use Cassandra 3.x .

And as Aaron has mentioned isn't the best ORM implementation for C* since it was initially designed for a RDBMS interface first, thus has implementations that are anti-patterns for NoSQL databases like Cassandra.

You mentioned that this is a one-time data load of a bulk of data, I would first read about the best way to load lots of data into Cassandra from this article (hint DO NOT USE batches). I don't know of any really good tools out there to do some data migration out of the box (depends on what your source system is too). So you'll probably have to write something custom, or adapt something.

Unfortunately, this is one of the risks you take when you opt to use a framework driver instead of an approved DataStax Driver.

If you want to be using a cutting-edge version of Cassandra, then to ensure your highest chances for deploying a successful application you should also use the DataStax Java Driver (in your case).

Additionally, there are two other reasons as to why you may want to reconsider using spring-cassandra-data:

  • When you call insert(List<T> entities, WriteOptions options) (and related methods) spring-data-cassandra runs a CQL BATCH INSERT behind-the-scenes. This particular use of batch inserts is a known anti-pattern in Cassandra, and can endanger the stability of your cluster.
  • When paging through many rows, spring-data-cassandra will run a COUNT(*) behind-the-scenes. This is a horribly inefficient query to run on a cluster with many nodes. It will be slow and potentially time-out on larger tables.

As I always say, you cannot go wrong by choosing a DataStax-approved driver.

nested exception is java.lang.NoSuchMethodError: com.datastax.driver.core.DataType.asJavaClass()Ljava/lang/Class; 2016-04-11 13:38:32.808

Maybe the version of the Java driver used by Spring Batch is not using the latest (3.0.0)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!