cassandra-3.0

Secondary index in Apache Cassandra

故事扮演 提交于 2019-12-13 18:09:19
问题 I tried to understand the secondary Index in Cassandra using the following link: https://www.youtube.com/watch?v=BPvZIj5fvl4 Let's say we have 5 node N1, N2, N3, N4 and N5 cluster with Replication Factor of 3 which means a partition data will be replicated to 3 nodes in the cluster (say N1, N2 and N3). Now when I execute this query: SELECT * FROM user WHERE partitionKey = "somedata" AND ClusteringKey = "test"; with the Read consistency as '2' It will query from any two of the nodes N1, N2 or

Cassandra failed to connect

て烟熏妆下的殇ゞ 提交于 2019-12-13 15:15:14
问题 I'm newbie in cassandra apache. In the tutorial video, it says type bin/nodetools status to check the status of node but when I tried to input it. Terminal returns Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'. Check this image I tried to change JVM_OPTS to "$JVM_OPTS -Djava.rmi.server.hostname=localhost" in cassandra-env.sh but still can't connect. What I gonna do to fix this error? Debug.logs DEBUG [main] 2017-01-21 13:57:48,095

Cassandra question v3.11.3 … select count(*) from table1

拥有回忆 提交于 2019-12-13 14:22:44
问题 I have imported more than 1 core records in a table and when I do Select query count(*) it gives me error. I know it is a costly query but, can any one help me get a solution for the same. SELECT COUNT(*) FROM TABLE1; Error: OperationTimedOut: errors={'10.20.30.10': 'Client request timeout. See Session.execute_async'}, last_host=10.20.30.10 回答1: After performing multiple R&D I got a solution for count(*) issue. Steps: Setup presto on Cassandra Cluster (I used presto-server-0.215 version

org.apache.spark.sql.catalyst.parser.ParseException: in spark scala cassandra api

无人久伴 提交于 2019-12-13 05:43:49
问题 i have written the below spark scala code, where in i am trying to implement spark cassandra api. when i try to run it ,i am getting the exception like input mismatch on the date field. and automatically its populating with the data values. i am not able to understand to solve this. please help me on the same. Below is the method which is converting long to Date format: def getTimeInMillis2Date( timeInMillis :Long):Date = { if (timeInMillis == 0l) { return null; } val calendar = Calendar

In cassandra SASI custom index, need to change Analyzer class from StandardAnalyzer to NonTokenizingAnalyzer. Does it causes impact on any means?

放肆的年华 提交于 2019-12-13 03:56:10
问题 Which analyzer is costlier over time, disk space , based on search criteria over the data? Note: I'm using NonTokenizing Analyzer for the case-sensitive feature. 回答1: Analyzer_class : Analyzers can be specified that will analyze the text in the specified column. The NonTokenizingAnalyzer is used for cases where the text is not analyzed, but case normalization or sensitivity is required. The StandardAnalyzer is used for analysis that involves stemming, case normalization, case sensitivity,

How partition read is chosen in Cassandra

微笑、不失礼 提交于 2019-12-13 03:55:58
问题 I have 3 nodes with number of partition data distributed across 3 nodes, When I look for the end points with partition key like below, ./nodetool getendpoints keyspacename tablename partitionkeyvalue 172.30.56.63 172.30.56.62 172.30.56.61 I am also able to see from the ./nodetool ring that the different partitions are distributed from -2 power 63 to +2 power 63 using virtual nodes I am also able to see the queried hosts (using the response object) that It used the token aware policy to choose

Cassandra - recovery of data after accidental delete

不羁岁月 提交于 2019-12-13 03:43:02
问题 As the data in case of Cassandra is physically removed during compaction, is it possible to access the recently deleted data in any way? I'm looking for something similar to Oracle Flashback feature ( AS OF TIMESTAMP ). Also, I can see the pieces of deleted data in the relevant commit log file, however it's obviously unreadable. Is it possible to convert this file to a more readable format? 回答1: You will want to execute a restore from your commitlog. The safest is to copy the commitlog to a

Cassandra read_request_timeout_in_ms set up for external(Client) request

雨燕双飞 提交于 2019-12-13 03:01:50
问题 As per Documentation and given knowledge on the internet. It seems that the below-given properties - request_timeout_in_ms - write_request_timeout_in_ms - read_request_timeout_in_ms Works only for internal(server side) Cassandra requests. I was even convinced to this fact when I set these parameters in cassandra.yaml file to 80000 but still got the Timeout error against my Select query to a bit bigger record by following two ways: 1) when I tried to connect to Cassandra via cqlsh without

How to read the UDTs from collection(for ex:list) of UDTs with cassandra-driver in java?

萝らか妹 提交于 2019-12-12 21:05:37
问题 I have table emp(id,name,list<frozen<address>>) . Here address is cassandra UDT defined as create TYPE address (hno int,street text); . I am trying to read all address's for a given id in emp using below code and I get the following error: Exception in thread "main" com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [frozen<'address'> <-> com.xyz.cassandra.address] String query1="select * from iotbilling.emp where id=?"; PreparedStatement

in cassandra Maximum memory usage reached (536870912 bytes), cannot allocate chunk of 1048576 bytes

我的梦境 提交于 2019-12-12 11:12:34
问题 I'm using apache cassandra-3.0.6 ,4 node cluster, RF=3, CONSISTENCY is '1', Heap 16GB. Im getting info message in system.log as " INFO [SharedPool-Worker-1] 2017-03-14 20:47:14,929 NoSpamLogger.java:91 - Maximum memory usage reached (536870912 bytes), cannot allocate chunk of 1048576 bytes " don't know exactly which memory it mean and I have tried by increasing the file_cache_size_in_mb to 1024 from 512 in Cassandra.yaml file But again it immediatly filled the remaining 512MB increased and