datastax

How to return a Vertex in the tinkerpop/gremlin format instead of the DSE graph format?

为君一笑 提交于 2019-12-31 04:03:09
问题 I am trying to return a Vertex (in tinkerpop format) that it was just created with Gremlin: DseCluster dseCluster = DseCluster.builder() .addContactPoint(DbC.dseHost) .build(); DseSession dseSession = dseCluster.connect(); GraphTraversal traversal = graph.addV(VertexLabels.User) .property("username", "testuser") GraphStatement graphStatement = DseGraph.statementFromTraversal( traversal ); GraphResultSet grs = dseSession.executeGraph(graphStatement.setGraphName(DbC.graphName)); Vertex v = grs

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

Installing php datastax driver on ubuntu

旧街凉风 提交于 2019-12-30 06:35:09
问题 I am trying to install the datastax php driver for Cassandra and when i run the following command: pecl install ext/package.xml after checking it out of git i get the following message: configure: error: Unable to load libcassandra ERROR: `/tmp/pear/temp/cassandra/configure' failed Can anyone point me in the right direction in order to successfully install this driver please? version of cassandra i am using is 2.1.8 so maybe the driver has not been updated to connect to the latest version of

Writing Spark Structure Streaming data into Cassandra

£可爱£侵袭症+ 提交于 2019-12-29 09:21:46
问题 I want to write Structure Streaming Data into Cassandra using Pyspark API. My data flow is like below: Nifi -> Kafka -> Spark Structure Streaming -> Cassandra I have tried below way: query = df.writeStream\ .format("org.apache.spark.sql.cassandra")\ .option("keyspace", "demo")\ .option("table", "test")\ .start() But getting below error message: "org.apache.spark.sql.cassandra" does not support streaming write. Also another approach I have tried: [ Source - DSE 6.0 Administrator Guide] query =

How can I filter `filter(lambda x:len(x[1])>=2)` in dataframe?

强颜欢笑 提交于 2019-12-25 15:40:29
问题 I am not sure about how to filter(lambda x:len(x[1])>=2) in dataframe. I would like to improve the speed of my spark app. Thanks for your help! This some context from my spark app: article_ids = sqlContext.read.format("org.apache.spark.sql.cassandra").options(table="article_by_created_at", keyspace=source).load().where(range_expr).select('article','created_at').repartition(64*2) axes = sqlContext.read.format("org.apache.spark.sql.cassandra").options(table="axes", keyspace=source).load() speed

cassandra getendpoints with partition key has space

我们两清 提交于 2019-12-25 15:02:39
问题 my partition keys are id(int) and name(text). Below command works fine until there is no space in name(text). nodetool getendpoints test testtable2 1:aaa; if am using nodetool getendpoints test testtable2 3:aac cc; it throws an error as : nodetool: getendpoints requires keyspace, table and partition key arguments See 'nodetool help' or 'nodetool help '. i got token by executing SELECT id,name, token(id,name) FROM test.testtable2 where name='aac cc'AND id=3; and tried to search nodetool

Cannot connect to datastax agent

半世苍凉 提交于 2019-12-25 14:23:29
问题 I am unable to connect to any nodes through opscenter. In opscenter it says that agents need to be connected inorder for opscenter to work. I checked in datastax-agent/agent.log file and found below errors. ERROR [clojure-agent-send-off-pool-0] 2016-01-27 09:30:54,545 Can't connect to Cassandra (All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect))), retrying soon. I checked port 9042 and 7199 both are

Cannot connect to datastax agent

天涯浪子 提交于 2019-12-25 14:23:16
问题 I am unable to connect to any nodes through opscenter. In opscenter it says that agents need to be connected inorder for opscenter to work. I checked in datastax-agent/agent.log file and found below errors. ERROR [clojure-agent-send-off-pool-0] 2016-01-27 09:30:54,545 Can't connect to Cassandra (All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect))), retrying soon. I checked port 9042 and 7199 both are

Cassandra driver(datastax) load balancing with TokenAwarePolicy

北慕城南 提交于 2019-12-25 07:27:11
问题 My question is a follow up of this topic : Cassandra load balancing with TokenAwarePolicy and shuffleReplicas I'm encountering some issues regarding the TokenAwarePolicy that I don't understand. Cluster configuration : 3 nodes Replication factor = 3 Load balancing policy : new TokenAwarePolicy(new RoundRobinPolicy(), false) Consitancy level (Reads/Writes) : ONE Shuffling replicas is set to false on purpose. But the thing is that I'm encountering consistency problems when reading datas in my

Data reference and updation in cassandra tables

自作多情 提交于 2019-12-25 04:36:22
问题 I have a table Called 'usertab' to store user details such as: userid uuid, firstname text, lastname text email text gender int image text Most of the other tables contains userid as a field for referencing 'usertab', but when I retrieve data from other table, I need to execute another select query to get user details. So if 10,000 or more data retrieved, same number of select query executed for getting user details. This makes our system slow. So we add usertab fields such as firstname