cassandra-2.0

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

date column which is a text type in Cassandra.so I need a UDF to convert that text to timestamp so I can query on that column

三世轮回 提交于 2021-01-29 05:29:19
问题 I have writeen code like belo but getting error as below:- InvalidRequest: Error from server: code=2200 [Invalid query] message="Java source compilation failed: Line 1: java.util.String cannot be resolved to a type Line 1: Syntax error on token "Date", @ expected Line 4: SimpleDateFormat cannot be resolved to a type CREATE FUNCTION saumya.text2dt ( input text ) RETURNS NULL ON NULL INPUT RETURNS timestamp LANGUAGE java AS $$ java.text.ParseException java.text.SimpleDateFormat java.util.Date

Executing CQL through Shell Script?

梦想与她 提交于 2020-08-03 12:55:10
问题 I am trying to execute the CQL commands from shell script. I am able to connect to the cqlsh (CQL version i'm using is 1.1.18) but unable to send the queries to cql. Any ideas or suggestion how to proceed on this? Do I need to connect to Cassandra and execute few commands (select/update ) with shell script ?? 回答1: cqlsh -e "select * from ks.table limit 1;" > ~/output 回答2: I'm not sure about Cassandra 1.1.18, but you should be able to accomplish this with the -f flag of cqlsh . Let's say have

Cassandra java driver protocol version and connection limits don't match

陌路散爱 提交于 2020-06-12 18:56:23
问题 I am using java driver version: 2.1.4 Cassandra version: dsc-cassandra-2.1.10 Output from cql gives the following cqlsh 5.0.1 | Cassandra 2.1.10 | CQL spec 3.2.1 | Native protocol v3 I am protocol V3. But it throws an exception when I try to set it to more than 128 requests per connection. This seems to be a restriction in V2. Explained below: The following code block: PoolingOptions poolingOptions = new PoolingOptions(); poolingOptions.setCoreConnectionsPerHost(HostDistance.LOCAL, 8);