datastax-java-driver

How to get tombstone count for a cql query?

◇◆丶佛笑我妖孽 提交于 2020-01-24 02:29:13
问题 I am trying to evaluate number of tombstones getting created in one of tables in our application. For that I am trying to use nodetool cfstats. Here is how I am doing it: create table demo.test(a int, b int, c int, primary key (a)); insert into demo.test(a, b, c) values(1,2,3); Now I am making the same insert as above. So I expect 3 tombstones to be created. But on running cfstats for this columnfamily, I still see that there are no tombstones created. nodetool cfstats demo.test Average live

I have three node dse graph cluster. Two node graph enabled one is search enabled. The problem is when i run api request goes on it does not response

a 夏天 提交于 2020-01-16 03:29:08
问题 I have three node dse Cassandra cluster. One node is search enabled, Two node is graph enabled. When I run APIs(which is coded in scala play framework), POST or GET request keeps going and going it does gives a response. There is no any information in logs of Cassandra it is working normally. Earlier i used to use single node cluster where is graph enabled. 回答1: You need to have same workload on all nodes of the same data center, so you need to enable both graph and search on all nodes. 来源:

NoHostAvailableException: All host(s) tried for query failed (no host was tried)

纵饮孤独 提交于 2020-01-15 09:13:47
问题 We recently (this week) upgraded our java driver from 2.0.4 to 2.1.4 (we are running Cassandra version 2.0.12). We were using 2.0.4 for a long time (more than an year) in production and did not have this issue. But, after upgrading we starting seeing intermittent NoHostAvailableExceptions (that fail all the requests on client side): Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried) at com.datastax.driver.core

NoHostAvailableException: All host(s) tried for query failed (no host was tried)

时间秒杀一切 提交于 2020-01-15 09:13:09
问题 We recently (this week) upgraded our java driver from 2.0.4 to 2.1.4 (we are running Cassandra version 2.0.12). We were using 2.0.4 for a long time (more than an year) in production and did not have this issue. But, after upgrading we starting seeing intermittent NoHostAvailableExceptions (that fail all the requests on client side): Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried) at com.datastax.driver.core

NoHostAvailableException: All host(s) tried for query failed (no host was tried)

给你一囗甜甜゛ 提交于 2020-01-15 09:13:06
问题 We recently (this week) upgraded our java driver from 2.0.4 to 2.1.4 (we are running Cassandra version 2.0.12). We were using 2.0.4 for a long time (more than an year) in production and did not have this issue. But, after upgrading we starting seeing intermittent NoHostAvailableExceptions (that fail all the requests on client side): Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried) at com.datastax.driver.core

Cassandra .setFetchSize() on statement is not honoured

非 Y 不嫁゛ 提交于 2020-01-14 13:54:08
问题 I want to implement pagination on the UI, so I set fetchSize like this: boundStatement.setFetchSize(20) But the setFetchSize() is not honored. My table has 400 rows as of now and all 400 rows are retrieved. When I retrieve the next set of rows using rs.getExecutionInfo().getPagingState(); then the next 380 rows are retrieved. So the paging state is correctly set and retrieved, but why is the driver retreiving all 400 rows from the table and how can I avoid this or make it retrieve only 400

Cassandra NoClassDefFoundError: com/google/common/util/concurrent/AsyncFunction

若如初见. 提交于 2020-01-14 13:46:13
问题 cluster = Cluster.builder() .addContactPoint("localhost") .build(); Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/AsyncFunction The only jars I have in my path are the 2 cassandra java driver jars cassandra-driver-core-2.1.10.3.jar and cassandra-driver-mapping-2.1.10.3.jar Thanks 回答1: The issue is with missing guava.jar. Adding this in the class path solved (this) issue. Overall issue is lack of suitable DataSatx documentaion 来源: https:/

Cassandra NoClassDefFoundError: com/google/common/util/concurrent/AsyncFunction

ⅰ亾dé卋堺 提交于 2020-01-14 13:46:12
问题 cluster = Cluster.builder() .addContactPoint("localhost") .build(); Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/AsyncFunction The only jars I have in my path are the 2 cassandra java driver jars cassandra-driver-core-2.1.10.3.jar and cassandra-driver-mapping-2.1.10.3.jar Thanks 回答1: The issue is with missing guava.jar. Adding this in the class path solved (this) issue. Overall issue is lack of suitable DataSatx documentaion 来源: https:/

How can I store Objects in cassandra using the blob datatype

六月ゝ 毕业季﹏ 提交于 2020-01-13 20:23:49
问题 I tried with the data type blob . That's giving some Datastax exception. I tried the object itself, bytearray. Still no good: Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Invalid STRING constant ([B@547248ad) for user_object of type blob This is the failing INSERT: executeSting.append("INSERT INTO htadb.objecttable (object_id, bucket_name, object_key, link, user_status, user_object) ") .append("VALUES (") .append(objectId).append(",'") .append(bucketName).append("','"

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

强颜欢笑 提交于 2020-01-10 14:30:34
问题 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 features in my below code which uses Datastax Java driver.. /** * Performs an upsert of the specified attributes for the specified id. */ public void upsertAttributes(final String userId, final Map<String, String> attributes, final String columnFamily)