datastax-java-driver

Exception in main thread java.lang.NoClassDefFoundError

ε祈祈猫儿з 提交于 2019-12-21 22:10:52
问题 Getting error Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/FutureCallback, while running below code. Pls advise which Jar file am missing. I am executing from Eclipse IDE package Datastax; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Host; import com.datastax.driver.core.Metadata; import com.datastax.driver.core.Session; public class DataStaxPOC { private Cluster cluster; public void connect(String node) { cluster =

Using Cassandra and CQL3, how do you insert an entire wide row in a single request?

这一生的挚爱 提交于 2019-12-21 04:54:29
问题 I want to insert a single row with 50,000 columns into Cassandra 1.2.8. Before inserting, I have all the data for the entire row ready to go (in memory): +---------+------+------+------+------+-------+ | | 0 | 1 | 2 | ... | 49999 | | row_id +------+------+------+------+-------+ | | text | text | text | ... | text | +---------+------+------+------|------+-------+ The column names are integers, allowing slicing for pagination. The column values are a value at that particular index. CQL3 table

CodecNotFoundException: Codec not found for requested operation: [date <-> java.util.Date]

筅森魡賤 提交于 2019-12-20 07:18:51
问题 I am using below datastax versions with java8 <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-core</artifactId> <version>3.7.2</version> </dependency> <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-mapping</artifactId> <version>3.7.2</version> </dependency> My table has a Date column as below cass_table ( data_source_id int, company_id text, create_date date) When I trying to save the data into C* table as below final

Datastax Cassandra Driver Retry Policy Delay?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 01:13:07
问题 I am using the Datastax Cassandra driver and have a RetryPolicy setup to retry when a host is unavailable. However, I have noticed that it retries as fast as it can. I would like to change it to have an increasing delay between retries rather than hammer the cluster if it is struggling. This is particularly important for OVERLOADED request errors since I do want to retry in these scenarios, but with a substantial delay. Where is the right place to put a delay and what is the right mechanism?

How to get current timestamp with CQL while using Command Line?

回眸只為那壹抹淺笑 提交于 2019-12-18 11:37:53
问题 I am trying to insert into my CQL table from the command line. I am able to insert everything. But I am wondering if I have a timestamp column, then how can I insert into timestamp column from the command line? Basically, I want to insert current timestamp whenever I am inserting into my CQL table - Currently, I am hardcoding the timestamp whenever I am inserting into my below CQL table - CREATE TABLE TEST (ID TEXT, NAME TEXT, VALUE TEXT, LAST_MODIFIED_DATE TIMESTAMP, PRIMARY KEY (ID));

Can't connect to cassandra - NoHostAvailableException

怎甘沉沦 提交于 2019-12-17 12:53:54
问题 I know there are several threads about the NoHostAvailableException but they simply don't provide a solution to my problem. I can't connect to Cassandra with the Datastax Java Cassandra Driver. I get the Error: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/54.221.241.107]) I am sure that the configuration is correct. I've set the configuration in cassandra.yaml: start_native_transport: true # port for the CQL native transport to

Can't connect to cassandra - NoHostAvailableException

断了今生、忘了曾经 提交于 2019-12-17 12:53:13
问题 I know there are several threads about the NoHostAvailableException but they simply don't provide a solution to my problem. I can't connect to Cassandra with the Datastax Java Cassandra Driver. I get the Error: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/54.221.241.107]) I am sure that the configuration is correct. I've set the configuration in cassandra.yaml: start_native_transport: true # port for the CQL native transport to

Cassandra and defuncting connection

↘锁芯ラ 提交于 2019-12-13 05:15:22
问题 I've got a question about Cassandra. I haven't found any "understable answer" yet... I made a cluster build on 3 nodes (RackInferringSnitch) on differents VM. I'm using Datastax's Java Driver to read and update my keyspace (with CSVs). When one node is down (ie : 10.10.6.172), I've got this debug warning: INFO 00:47:37,195 New Cassandra host /10.10.6.172:9042 added INFO 00:47:37,246 New Cassandra host /10.10.6.122:9042 added DEBUG 00:47:37,264 [Control connection] Refreshing schema DEBUG 00

How to improve performance my spark job here to load data into cassandra table?

帅比萌擦擦* 提交于 2019-12-13 03:48:48
问题 I am using spark-sql-2.4.1 ,spark-cassandra-connector_2.11-2.4.1 with java8 and apache cassandra 3.0 version. I have my spark-submit or spark cluster enviroment as below to load 2 billion records . --executor-cores 3 --executor-memory 9g --num-executors 5 --driver-cores 2 --driver-memory 4g I am using Cassandra 6 node cluster with below settings : cassandra.output.consistency.level=ANY cassandra.concurrent.writes=1500 cassandra.output.batch.size.bytes=2056 cassandra.output.batch.grouping.key

executeGraph() is not really needed in Datastax DSE 5.0 Graph with Java?

人走茶凉 提交于 2019-12-12 20:01:58
问题 It seems that in both approaches the vertex is stored and can be retrieved properly later. Common configuration: DseCluster dseCluster = DseCluster.builder() .addContactPoint("192.168.1.43") .build(); DseSession dseSession = dseCluster.connect(); GraphTraversalSource g = DseGraph.traversal( dseSession, new GraphOptions().setGraphName("graph") ); Approach 1: Vertex v = g.addV("User").property("uuid","testuuid231").next(); Approach 2: GraphStatement graphStatement = DseGraph