cassandra-2.0

Cassandra tombstones count multiple queries vs single query

风流意气都作罢 提交于 2019-12-06 10:50:32
I've a cassandra table definition as following CREATE TABLE mytable ( colA text, colB text, timeCol timestamp, colC text, PRIMARY KEY ((colA, colB, timeCol), colC) ) WITH.... I want to know if number of tombstones would vary between following types of queries: 1. delete from mytable where colA = '...' AND colB = '...' and timeCol = 111 Above query affect multiple records, (multiple values of colC) 2. delete from mytable where colA = '...' AND colB = '...' and timeCol = 111 AND colC = '...' However, 2nd query needs to be executed for each value of last column colC , while 1st query takes care

Unable to run spark master in dse 4.5 and slaves file is missing

大憨熊 提交于 2019-12-06 07:29:00
I have 5 node cluster in DSE 4.5 is running and up. out of 5 nodes 1 node is hadoop_enabled and spark_enabled but spark master is not running. ERROR [Thread-709] 2014-07-02 11:35:48,519 ExternalLogger.java (line 73) SparkMaster: Exception in thread "main" org.jboss.netty.channel.ChannelException: Failed to bind to: /54.xxx.xxx.xxx:7077 Anyone have any idea on this?? I have also tried to export SPARK_LOCAL_IP but this is also not working DSE documentation wrongly mentioned that spark-env.sh configuration file is resources/spark/conf/spark-env.sh. actual path of configuration dir is /etc/dse

Cassandra: Adding new column to the table

邮差的信 提交于 2019-12-06 02:20:30
Hi I just added a new column Business_sys to my table my_table: ALTER TABLE my_table ALTER business_sys TYPE set<text>; But again I just droped this column name because I wanted to change the type of column: ALTER TABLE my_table DROP business_sys; Again when I tried to add the same colmn name with different type am getting error message "Cannnot add a collection with the name business_sys because the collection with the same name and different type has already been used in past" I just tried to execute this command to add a new column with different type- ALTER TABLE my_table ADD business_sys

JavaSparkContext not serializable

房东的猫 提交于 2019-12-06 00:08:08
问题 I'm using spark with cassandra, and i hava a JavaRDD<String> of clients. And for each client, i want to select from cassandra his Interactions like this : avaPairRDD<String, List<InteractionByMonthAndCustomer>> a = client.mapToPair(new PairFunction<String, String, List<InteractionByMonthAndCustomer>>() { @Override public Tuple2<String, List<InteractionByMonthAndCustomer>> call(String s) throws Exception { List<InteractionByMonthAndCustomer> b = javaFunctions(sc) .cassandraTable(CASSANDRA

Consistency Level of Cassandra Lightweight transactions

痞子三分冷 提交于 2019-12-05 22:17:25
问题 I read about Cassandra 2's lightweight transactions. Is the consistency level of such a write always at QUORUM? Would this mean that even if I have a multi data center setup with 100s of nodes, then quorum of the entire cluster (majority of the row's replicas across all data centers) is involved? Won't this be really slow and wont it affect availability? Can we do LOCAL_QUORUM or EACH_QUORUM consistency? This would be preferred if writers for data replicated across multiple data centers would

Cassandra Static Column design [closed]

≡放荡痞女 提交于 2019-12-05 18:28:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . How are static columns stored internally in cassandra? Can someone please post an example discussing the design implementation of static column in cassandra? 回答1: Why don't we take a look at the structure of a table with static columns on disk and find out? cqlsh:test> CREATE TABLE test (k int, v int, s int

Event de-duplication using Cassandra

五迷三道 提交于 2019-12-05 16:20:57
I'm looking for the best way to de-duplicate events using Cassandra. I have many clients receiving event id's (thousands per second). I need to ensure that each event id is processed once and only once with high reliability and high availability. So far I've tried two methods: Use the event id as a partition key, and do an "INSERT ... IF NOT EXISTS". If that fails, then the event is a duplicate and can be dropped. This is a nice clean approach, but the throughput is not great due to Paxos, especially with higher replication factors such as 3. It's also fragile, since IF NOT EXISTS always

Cassandra adding disks / increase storage volume without adding new nodes

≡放荡痞女 提交于 2019-12-05 10:59:44
I have to increase storage volume in an cassandra cluster, the performance and throughput however is still more than enough. My first thoughts were to only add drives. Is it possible to increasing storage volume without adding new nodes? Is it possible with jbod to add new drives live in an running node? Or is the only way taking it offline, add the disks and take it back online afterwards? Any best practises? Thx, I really appreciate your help You can modify the cassandra.yaml to have multiple storage directories specified in data_file_directories. This will require a node restart in order to

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

江枫思渺然 提交于 2019-12-05 10:51:32
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? 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 Sandbox 5.1 I could not get this to work as it couldn't seem to find my class and kept raising type errors. My

Error on Cassandra server: Unable to gossip with any seeds

情到浓时终转凉″ 提交于 2019-12-05 10:49:15
I'm adding a second node to a single-node cassandra cluster, and getting a stack trace on the second node: ERROR 18:13:42,841 Exception encountered during startup java.lang.RuntimeException: Unable to gossip with any seeds at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1193) at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:446) at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:655) at org.apache.cassandra.service.StorageService.initServer(StorageService.java:611) at org.apache.cassandra.service