cassandra

What happens if a coordinator node goes down during a write in Apache Cassandra?

你离开我真会死。 提交于 2021-02-11 12:36:01
问题 Pretty much the title, but I realize that there are a lot of different edge cases here, but I am somehow not able to find a credible source on this. 回答1: If co-ordinator goes down mid request , cassandra drivers are designed to handle such case with retry policy which you can configure. More Details 来源: https://stackoverflow.com/questions/37722828/what-happens-if-a-coordinator-node-goes-down-during-a-write-in-apache-cassandra

Using Cassandra as a Queue

做~自己de王妃 提交于 2021-02-11 09:15:36
问题 Using Cassandra as Queue: Is it really that bad? Setup: 5 node cluster, all operations execute at quorum Using DateTieredCompaction should significantly reduce the cost of TombStones, and allow entire SSTables to be dropped at once. We add all messages to the queue with the same TTL We partition messages based on time (say 1 minute intervals), and keep track of the read-position. Messages consumed will be explicitly deleted. (only 1 thread extracts messages) Some Messages may be explicitly

Spark writing to Cassandra with varying TTL

我们两清 提交于 2021-02-10 18:12:20
问题 In Java Spark, I have a dataframe that has a 'bucket_timestamp' column, which represents the time of the bucket that the row belongs to. I want to write the dataframe to a Cassandra DB. The data must be written to the DB with TTL. The TTL should be depended on the bucket timestamp - where each row's TTL should be calculated as ROW_TTL = CONST_TTL - (CurrentTime - bucket_timestamp) , where CONST_TTL is a constant TTL that I configured. Currently I am writing to Cassandra with spark using a

Spark writing to Cassandra with varying TTL

江枫思渺然 提交于 2021-02-10 18:04:59
问题 In Java Spark, I have a dataframe that has a 'bucket_timestamp' column, which represents the time of the bucket that the row belongs to. I want to write the dataframe to a Cassandra DB. The data must be written to the DB with TTL. The TTL should be depended on the bucket timestamp - where each row's TTL should be calculated as ROW_TTL = CONST_TTL - (CurrentTime - bucket_timestamp) , where CONST_TTL is a constant TTL that I configured. Currently I am writing to Cassandra with spark using a

Cassandra Predicates on non-primary-key columns (eventtype) are not yet supported for non secondary index queries

你说的曾经没有我的故事 提交于 2021-02-10 16:48:29
问题 i developed a table as shown as below with primary key as id which is a uuid type id | date | eventtype | log | password | priority | sessionid | sourceip | user | useragent --------------------------------------+--------------------------+--------------+----------+----------+----------+-----------+--------------+------------+------------ 6b47e9b0-d11a-11e8-883c-5153f134200b | null | LoginSuccess | demolog | 1234 | 10 | Demo_1 | 123.12.11.11 | Aqib | demoagent 819a58d0-cd3f-11e8-883c

Configuring Cassandra's TokenAware and LatencyAware policy together in C++ driver

一个人想着一个人 提交于 2021-02-10 16:20:54
问题 After reading about the different load balancing policies available(https://datastax.github.io/cpp-driver/topics/configuration/), it seems to me that for best performance,particularly in multi data-center cluster, token-aware and latency-aware policy should be used together('Performance Tips' section of the above mentioned article). As per my understanding(assuming replication factor > 1), when we'll use both of these policies together, then the client will calculate the hash of the primary

Configuring Cassandra's TokenAware and LatencyAware policy together in C++ driver

耗尽温柔 提交于 2021-02-10 16:09:44
问题 After reading about the different load balancing policies available(https://datastax.github.io/cpp-driver/topics/configuration/), it seems to me that for best performance,particularly in multi data-center cluster, token-aware and latency-aware policy should be used together('Performance Tips' section of the above mentioned article). As per my understanding(assuming replication factor > 1), when we'll use both of these policies together, then the client will calculate the hash of the primary

Cassandra: filtering based one specific value in a set

房东的猫 提交于 2021-02-10 15:46:08
问题 I have a data table in Cassandra and one of the columns is: customer_favourites , with each value being of type set and it has the details of each customer's favourite foods. For example one customer could have {'Mexican', 'Italian', 'Indian'} and another customer could have {'Mexican', 'French'} and another could have {'Mexican'} . I have the following code: SELECT customer_id, customer_fname, customer_lname FROM customers WHERE customer_favourites CONTAINS ‘Mexican’ ALLOW FILTERING; I want

How do I set CONSISTENCY to SERIAL in cqlsh?

眉间皱痕 提交于 2021-02-10 14:23:59
问题 I am trying to experiment with lightweight transactions in Cassandra by using SERIAL consistency. However, trying to set the consistency level in cqlsh results in an error: cqlsh:learning> CONSISTENCY SERIAL; Improper CONSISTENCY command. The WITH CONSISTENCY statement has been removed from CQL and so I cannot use that. Is there a way to enable serial consistency from cqlsh? Or do I have to do it using a driver? 回答1: The CONSISTENCY command should still work in cqlsh. But valid values for

How do I set CONSISTENCY to SERIAL in cqlsh?

我怕爱的太早我们不能终老 提交于 2021-02-10 14:23:05
问题 I am trying to experiment with lightweight transactions in Cassandra by using SERIAL consistency. However, trying to set the consistency level in cqlsh results in an error: cqlsh:learning> CONSISTENCY SERIAL; Improper CONSISTENCY command. The WITH CONSISTENCY statement has been removed from CQL and so I cannot use that. Is there a way to enable serial consistency from cqlsh? Or do I have to do it using a driver? 回答1: The CONSISTENCY command should still work in cqlsh. But valid values for