cassandra-2.0

Cassandra Cluster - Specific Node - specific table high Dropped Mutations

大憨熊 提交于 2019-12-22 12:06:08
问题 My Compression strategy in Production was LZ4 Compression. But I modified it to Deflate For compression change, we had to use nodetool Upgradesstables to forcefully upgrade the compression strategy on all sstables But once upgradesstabloes command completed on all the 5 nodes in the cluster, My requests started to fail, both read and write The issue is traced to a specific node out of the 5 node cluster and to a spcific table on that node. My whole cluster has roughly same amount of data and

Fetching datapoint in cassandra based on statistics

喜夏-厌秋 提交于 2019-12-22 08:24:09
问题 I'm testing out Cassandra (2.0) as a possible replacement for storing our time-series data. I made a simple table and dumped some of our data into it: CREATE TABLE DataRaw( channelId int, sampleTime timestamp, value double, PRIMARY KEY (channelId, sampleTime) ) WITH CLUSTERING ORDER BY (sampleTime ASC); I can quite easily perform the most used queries like first value, last value (current) and get statistics via max, min, count, avg etc. But I also need to not only fetch the max value in a

There is no rollback in Cassandra, then how does Cassandra remove failed writes?

情到浓时终转凉″ 提交于 2019-12-22 07:18:19
问题 Suppose I have a 2 node cluster with Replication Factor(RF) = 2. I fire an insert with Consistency 2. Cassandra starts to write to these 2 nodes while client is waiting for a response. In between one node fails and could not complete the write, while write on other node succeeded. Client will not get a success message as consistency cannot be met. There is no rollback in Cassandra. So how and when does Cassandra remove the inserted record from that one node or mark it as 'not to be used'?

How can I create User Defined Functions in Cassandra with Custom Java Class?

你。 提交于 2019-12-22 06:45:22
问题 I couldn't find this anywhere online. How can I create a custom user defined function in cassandra?. For Ex : CREATE OR REPLACE FUNCTION customfunc(custommap map<text, int>) CALLED ON NULL INPUT RETURNS map<int,bigint> LANGUAGE java AS 'return MyClass.mymethod(custommap);'; Where "MyClass" is a class that I can register in the Classpath? 回答1: Just adding my 2 cents to this thread as I tried building an external class method to support something similar. After trying for hours with Datastax

how to construct range query in cassandra?

故事扮演 提交于 2019-12-22 04:58:28
问题 CREATE TABLE users ( userID uuid, firstname text, lastname text, state text, zip int, age int, PRIMARY KEY (userID) ); I want to construct the following queries: select * from users where age between 30 and 40 select * from users where state in "AZ" AND "WA" I know I need two more tables to do this query but I dont know how the should be? EDIT From Carlo's comments, I see this is the only possibility CREATE TABLE users ( userID uuid, firstname text, lastname text, state text, zip int, age int

High number of tombstones with TTL columns in Cassandra

眉间皱痕 提交于 2019-12-22 01:29:17
问题 I have a cassandra Column Family, or CQL table with the following schema: CREATE TABLE user_actions ( company_id varchar, employee_id varchar, inserted_at timeuuid, action_type varchar, PRIMARY KEY ((company_id, employee_id), inserted_at) ) WITH CLUSTERING ORDER BY (inserted_at DESC); Basically a composite partition key that is made up of a company ID and an employee ID, and a clustering column, representing the insertion time, that is used to order the columns in reverse chronological order

Cassandra : java.lang.OutOfMemoryError: Java heap space

谁都会走 提交于 2019-12-21 21:15:36
问题 I am using cassandra 2.0.8 and getting this exception INFO 16:44:50,132 Initializing system.batchlog INFO 16:44:50,138 Initializing system.sstable_activity INFO 16:44:50,142 Opening /var/lib/cassandra/data/system/sstable_activity/system-sstable_activity-jb-10 (826 bytes) INFO 16:44:50,142 Opening /var/lib/cassandra/data/system/sstable_activity/system-sstable_activity-jb-9 (827 bytes) INFO 16:44:50,142 Opening /var/lib/cassandra/data/system/sstable_activity/system-sstable_activity-jb-11 (825

Modeling many-to-many relations in Cassandra 2 with CQL3

橙三吉。 提交于 2019-12-21 02:42:08
问题 What is the canonical way to model many-to-many relations with CQL3 ? Let's say I have to tables CREATE TABLE actor ( id text PRIMARY KEY, given text, surname text, ) CREATE TABLE fan ( id text PRIMARY KEY, given text, surname text, ) and I'd like to model the fact that an actor can have many fan and each fan can like many actors. The first idea that came to my my was to use sets, like in the following (and the other way around for fans): CREATE TABLE actor ( id text PRIMARY KEY, given text,

Cassandra “no viable alternative at input”

扶醉桌前 提交于 2019-12-20 09:31:21
问题 I am trying to insert a simple row into the table. Can someone point out what is happening here ? CREATE TABLE recommendation_engine_poc.user_by_category ( game_category text, customer_id text, amount double, game_date timestamp, PRIMARY KEY (game_category, customer_id) ) WITH CLUSTERING ORDER BY (customer_id ASC) AND bloom_filter_fp_chance = 0.01 AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' AND comment = '' AND compaction = {'class': 'org.apache.cassandra.db.compaction

Cassandra: Coordinator node timed out waiting for replica nodes' responses

跟風遠走 提交于 2019-12-20 05:38:49
问题 I was importing about 4 million rows from CSV using COPY. 90 minutes into the process, I got the following error which suggests some problem in waiting for replica nodes. The Keyspace is setup with replication factor of 1 and there is only one node in the cluster. So why does the coordinator have to wait for any other node? Processed 4050000 rows; Write: 624.27 rows/ss code=1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0