datastax-java-driver

NoHostAvailableException With Cassandra & DataStax Java Driver If Large ResultSet

本小妞迷上赌 提交于 2020-01-03 20:57:31
问题 The setup: 2-node Cassandra 1.2.6 cluster replicas=2 very large CQL3 table with no secondary index Rowkey is a UUID.randomUUID().toString() read consistency set to ONE Using DataStax java driver 1.0 The request: Attempting to do a table scan by " SELECT some-col from schema.table LIMIT nnn; " The fail: Once I go beyond a certain nnn LIMIT, I start to get NoHostAvailableExceptions from the driver. It reads like this: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s)

All masters are unresponsive ! ? Spark master is not responding with datastax architecture

核能气质少年 提交于 2020-01-03 04:35:10
问题 Tried using both Spark shell and Spark submit, getting this exception? Initializing SparkContext with MASTER: spark://1.2.3.4:7077 ERROR 2015-06-11 14:08:29 org.apache.spark.scheduler.cluster.SparkDeploySchedulerBackend: Application has been killed. Reason: All masters are unresponsive! Giving up. WARN 2015-06-11 14:08:29 org.apache.spark.scheduler.cluster.SparkDeploySchedulerBackend: Application ID is not initialized yet. ERROR 2015-06-11 14:08:30 org.apache.spark.scheduler.TaskSchedulerImpl

How to create a graph and its schema without using Datastax Studio but through Java?

老子叫甜甜 提交于 2020-01-03 02:22:13
问题 I was trying to create my first connection with DSE Graph through java.. public static void main(String args[]){ DseCluster dseCluster = null; try { dseCluster = DseCluster.builder() .addContactPoint("192.168.1.43") .build(); DseSession dseSession = dseCluster.connect(); GraphTraversalSource g = DseGraph.traversal(dseSession, new GraphOptions().setGraphName("graph")); GraphStatement graphStatement = DseGraph.statementFromTraversal(g.addV("test")); GraphResultSet grs = dseSession.executeGraph

NoClassDefFoundError - datastax java driver for Cassandra

限于喜欢 提交于 2020-01-02 23:14:33
问题 I am currently unable to connect to my cassandra database using the datastax driver. I am getting the following error: com.datastax.driver.core.TransportException: [/127.0.0.1] Unexpected exception triggered (java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.copyOf(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;) at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:556) at org.jboss.netty.channel.SimpleChannelUpstreamHandler

How to executing batch statement and LWT as a transaction in Cassandra

杀马特。学长 韩版系。学妹 提交于 2020-01-02 11:27:09
问题 I have two table with below model: CREATE TABLE IF NOT EXISTS INV ( CODE TEXT, PRODUCT_CODE TEXT, LOCATION_NUMBER TEXT, QUANTITY DECIMAL, CHECK_INDICATOR BOOLEAN, VERSION BIGINT, PRIMARY KEY ((LOCATION_NUMBER, PRODUCT_CODE))); CREATE TABLE IF NOT EXISTS LOOK_INV ( LOCATION_NUMBER TEXT, CHECK_INDICATOR BOOLEAN, PRODUCT_CODE TEXT, CHECK_INDICATOR_DDTM TIMESTAMP, PRIMARY KEY ((LOCATION_NUMBER), CHECK_INDICATOR, PRODUCT_CODE)) WITH CLUSTERING ORDER BY (CHECK_INDICATOR ASC, PRODUCT_CODE ASC); I

Cassandra load balancing with TokenAwarePolicy and shuffleReplicas

一笑奈何 提交于 2020-01-01 16:09:23
问题 We have 6 node cluster where we deploy everything to one region on AWS with 3 Availability Zones. We are using Ec2Snitch which should distribute one replica in each availability zone. We use DataStax Java driver. Servers doing write and read are distributed in availability zones same as nodes are (1 server by AZ). What we want to achieve is best possible read performance, write for us is not that important in a sense that we need to write data but not necessary fast. We use replication factor

Cassandra load balancing with TokenAwarePolicy and shuffleReplicas

家住魔仙堡 提交于 2020-01-01 16:09:13
问题 We have 6 node cluster where we deploy everything to one region on AWS with 3 Availability Zones. We are using Ec2Snitch which should distribute one replica in each availability zone. We use DataStax Java driver. Servers doing write and read are distributed in availability zones same as nodes are (1 server by AZ). What we want to achieve is best possible read performance, write for us is not that important in a sense that we need to write data but not necessary fast. We use replication factor

How Cassandra handle blocking execute statement in datastax java driver

微笑、不失礼 提交于 2019-12-30 10:13:09
问题 Blocking execute fethod from com.datastax.driver.core.Session public ResultSet execute(Statement statement); Comment on this method: This method blocks until at least some result has been received from the database. However, for SELECT queries, it does not guarantee that the result has been received in full. But it does guarantee that some response has been received from the database, and in particular guarantee that if the request is invalid, an exception will be thrown by this method. Non

Cassandra: How to insert a new wide row with good performance using CQL

北慕城南 提交于 2019-12-29 04:07:19
问题 I am evaluating cassandra. I am using the datastax driver and CQL. I would like to store some data with the following internal structure, where the names are different for each update. +-------+-------+-------+-------+-------+-------+ | | name1 | name2 | name3 | ... | nameN | | time +-------+-------+-------+-------+-------+ | | val1 | val2 | val3 | ... | valN | +-------+-------+-------+-------|-------+-------+ So time should be the column key, and name should be the row key. The CQL statement

How to bind values to bound statement in a generic way using datastax java driver?

孤街醉人 提交于 2019-12-25 08:38:05
问题 I am working with Datastax Java driver to read and write data into Cassandra. I am using datastax java driver 3.1.0 and my cassandra cluster version is 2.0.10. I have created below two methods to execute my cql query. I am calling first method when I don't need to set any value in my cql query so it works for cql string like below: select * from testkeyspace.testtable where row_id=1 // cql-1 select * from testkeyspace.meta where row_id=1 // cql-2 select * from testkeyspace.proc where row_id=1