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
8
votes
2 answers

How to use prepared statement efficiently using datastax java driver in Cassandra?

I need to query one of the tables in Cassandra using Datastax Java driver. Below is the code I have which works fine - public class TestCassandra { private Session session = null; private Cluster cluster = null; private…
john
  • 11,311
  • 40
  • 131
  • 251
8
votes
1 answer

"All host(s) tried for query failed" Error

My Java code is as follows: import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Metadata; import com.datastax.driver.core.Session; public class CustomerController { public void execute() { Cluster cluster =…
Pradyumn
  • 400
  • 1
  • 2
  • 15
8
votes
1 answer

How to set up Cassandra client-to-node encryption with the DataStax Java driver?

I've set up node-to-node encryption on my Cassandra cluster. Now I want to set up client-to-node. According to this documentation, it should be as easy as taking the SSL certificate of my client and importing it into every node's truststore. I don't…
2rs2ts
  • 10,662
  • 10
  • 51
  • 95
8
votes
1 answer

Cassandra NoHostAvailableException while there is still alive node

I have two C* 2.0.2 nodes in one DC (with a default configuration in cassandra.yaml) and a keyspace with RF=2. Two clients are connected to this DC with a Datastax Java Driver 1.0.3. Clients read and write data from/to C* with CL=ONE without any…
tilex
  • 1,744
  • 1
  • 17
  • 32
8
votes
2 answers

How to use Asynchronous/Batch writes feature with Datastax Java driver

I am planning to use Datastax Java driver for writing to Cassandra.. I was mainly interested in Batch Writes and Asycnhronous features of Datastax java driver but I am not able to get any tutorials which can explain me how to incorporate these…
arsenal
  • 23,366
  • 85
  • 225
  • 331
7
votes
1 answer

Cassandra write query timeout out after PT2S

I have cassandra monolithic application where I want to write at high rate reading some payloads from queue. Cassandra cluster has 3 nodes . When i start processing large number of messages in parallel(by spawning threads) I get below…
user1228785
  • 512
  • 2
  • 6
  • 19
7
votes
0 answers

How to fix "BlockManagerMasterEndpoint - No more replicas available for rdd" issue?

I am using spark 2.4.1 version and java8 to copy data into cassandra-3.0. My spark job script is $SPARK_HOME/bin/spark-submit \ --master yarn \ --deploy-mode cluster \ --name MyDriver \ --jars "/local/jars/*.jar" \ --files…
7
votes
2 answers

DataStax cassandra core drive dependents on vulnerable Guava-19

DataStax cassandra core java drive is having a transitive dependencies on guava-19 (including latest DataStax) which is having a security vulnerable (CVE-2018-10237). To fix this when I tried excluding guava-19.0 dependencies from DataStax drive…
7
votes
1 answer

Fast estimated count of rows in Cassandra table

I am surprised that this question wasn't raised before. Suppose that we have a huge table in cassandra and we need to obtain an estimated number of rows in it (not exact, just approximation). Apparently simple select count(*) from table is not…
Andremoniy
  • 34,031
  • 20
  • 135
  • 241
7
votes
1 answer

How to send request to cassandra at a particular rate using Guava RateLimiter?

I am using datastax java driver 3.1.0 to connect to cassandra cluster and my cassandra cluster version is 2.0.10. I am writing asynchronously with QUORUM consistency. private final ExecutorService executorService =…
john
  • 11,311
  • 40
  • 131
  • 251
7
votes
2 answers

CQL Engine Exception about a connection name not existing in registry

I get the following exception while trying to connect to a Cassandra DB using a Python Cassandra-Driver client running on Windows 2012 Server R2 - 64 bit. I could get this working on my personal laptop but not a machine that is hosted on Azure. I am…
7
votes
1 answer

Cannot connect java client to cassandra with password authentication enabled

I have a default install of Datastax enterprise on my macbook. I was able to create my keyspace and setup all my applications including using solr. I am trying to develop a set of steps to turn on password authentication for our dev cluster. Thus…
Greg L.
  • 286
  • 2
  • 4
  • 9
7
votes
2 answers

What is the most efficient way to map/transform/cast a Cassandra BoundStatement's ResultSet to a Java classe built using the Object-mapping API?

Is there a builtin way in DataStax Java for Apache Cassandra to map the ResultSet coming from a BoundStatement to the domain objects Java classes built with using the Object-mapping API? I am a newbie moving from the Mapper + Accessor approach to…
user3395041
  • 325
  • 1
  • 3
  • 11
7
votes
1 answer

Cassandra cluster with bad insert performance and insert stability

I have to store around 250 numerical values per second, per client, which is around 900k numbers per hour. It probably will not be a full-day recording (probably between 5-10 hours a day), but I will partition my data based on the client id and the…
7
votes
1 answer

Cassandra read timeout

I am pulling big amount of data from cassandra 2.0, but unfortunately getting timeout exception. My table: CREATE KEYSPACE StatisticsKeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 }; CREATE TABLE…
1 2
3
66 67