Questions tagged [datastax-java-driver]

A Java client driver for Apache Cassandra. This driver works exclusively with the Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol.

The DataStax Java driver for Apache Cassandra is the de-facto standard for connecting to a Cassandra cluster from a Java application. Can be used to connect to:

  • Apache Cassandra
  • DataStax Enterprise (DSE)
  • DataStax Astra DB

Support and documentation: https://docs.datastax.com/en/developer/java-driver/latest/

997 questions
10
votes
2 answers

EmbeddedCassandra : Cannot run unit tests

I am using EmbeddedCassandraServerHelper to perform unit tests. Here is my pom org.apache.nifi nifi-api 1.4.0
AbtPst
  • 7,778
  • 17
  • 91
  • 172
10
votes
2 answers

Datastax Cassandra Driver throwing CodecNotFoundException

The exact Exception is as follows com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [varchar <-> java.math.BigDecimal] These are the versions of Software I am using Spark 1.5…
10
votes
2 answers

How to know affected rows in Cassandra(CQL)?

There doesn't seem to be any direct way to know affected rows in cassandra for update, and delete statements. For example if I have a query like this: DELETE FROM xyztable WHERE PKEY IN (1,2,3,4,5,6); Now, of course, since I've passed 6 keys, it is…
pinkpanther
  • 4,770
  • 2
  • 38
  • 62
10
votes
2 answers

Optimal settings for Cassandra Java driver to write to the local data centre only

I have recently started using Datastax Java driver for our Cassandra use case... We will be using Datastax Java driver for reading/writing into Cassandra... I am successfully able to create Cassandra connection using Datastax Java driver... But I am…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
10
votes
4 answers

Cassandra Frequent Read Write Timeouts

I had changed whole codebase from Thrift to CQL using datastax java driver 1.0.1 and cassandra 1.2.6.. with thrift I was getting frequent timeouts from start, I was not able to proceed...Adopting CQL, tables designed as per that I got success and…
user2572801
  • 151
  • 1
  • 2
  • 11
9
votes
2 answers

Cassandra timeout during read query at consistency ONE (1 responses were required but only 0 replica responded)

I am doing read and update queries on a table having 500000 rows and some times getting below error after processing around 300000 rows, even when no node is down. Cassandra timeout during read query at consistency ONE (1 responses were required…
9
votes
2 answers

How to prevent Cassandra commit logs filling up disk space

I'm running a two node Datastax AMI cluster on AWS. Yesterday, Cassandra started refusing connections from everything. The system logs showed nothing. After a lot of tinkering, I discovered that the commit logs had filled up all the disk space on…
plamb
  • 5,636
  • 1
  • 18
  • 31
9
votes
2 answers

Cassandra NoHostAvailableException: All host(s) tried for query failed in Production

We have 10 Cassandra nodes in production running Cassandra-2.1.8. We recently upgraded to 2.1.8 version. Previously we were using only 3 nodes running Cassandra-2.1.2. First we upgraded the initial 3 nodes from 2.1.2 to 2.1.8 (following the…
abi_pat
  • 572
  • 2
  • 12
  • 35
9
votes
2 answers

Prepared statements vs Bound statements in Cassandra?

I am wondering what is the advantage of using BoundStatement over PreparedStatement? PreparedStatement statement = session.prepare( "INSERT INTO simplex.songs " + "(id, title, album, artist) " + …
brain storm
  • 30,124
  • 69
  • 225
  • 393
9
votes
2 answers

Is there a good way to check whether a Datastax Session.executeAsync() has thrown an exception?

I'm trying to speed up our code by calling session.executeAsync() instead of session.execute() for DB writes. We have use cases where the DB connection might be down, currently the previous execute() throws an exception when the connection is lost…
8
votes
1 answer

Is there a way to convert NULL to some value in Spring converter?

The database (Cassandra) does not allow specifying a default value when adding new columns. New columns are therefore null for every row. Now, we added a flag to our entity (which might get more entries in the future): enum UsageFlag { OTHER, …
nikeee
  • 10,248
  • 7
  • 40
  • 66
8
votes
2 answers

Map Cassandra Materialized View with DSE's Java API

I have a cassandra table with an associated materialized view. The primary key is a single id of type uuid, and I have no sort key. Let's call it my_table_id. This table contains a related_id that I want to use to search. Then I have a materialized…
redwulf
  • 1,317
  • 3
  • 13
  • 35
8
votes
3 answers

Cassandra replication factor greater than number of nodes

I am using the datastax java driver for Apache Cassandra (v. 2.1.9) and I am wondering what should happen when I set replication_factor greater than number of nodes. I've read somewhere that Cassandra allows for this operation, but should fail when…
bemol
  • 381
  • 3
  • 18
8
votes
1 answer

How to keep 2 Cassandra tables within same partition

I tried reading up on datastax blogs and documentation but could not find any specific on this Is there a way to keep 2 tables in Cassandra to belong to same partition? For example: CREATE TYPE addr ( street_address1 text, city text, state…
8
votes
2 answers

Datastax Java Cassandra Driver: Multiple AND statements using WHERE?

I'm trying to run the following CQL statement using the latest Datastax Cassandra driver for Java: SELECT * FROM tablename WHERE column_one=1 AND column_2=9 AND column_3=50; Here's what I have so far (only 2 ANDs), but I can't find a way to chain…
mikestaszel
  • 362
  • 1
  • 4
  • 9
1
2
3
66 67