Re: How to Parse raw CQL text?

2018-02-05 Thread Kant Kodali
I just did some trial and error. Looks like this would work public class Test { public static void main(String[] args) throws Exception { String stmt = "create table if not exists test_keyspace.my_table (field1 text, field2 int, field3 set, field4 map, primary key

Re: How to Parse raw CQL text?

2018-02-05 Thread Kant Kodali
Hi Anant, I just have CQL create table statement as a string I want to extract all the parts like, tableName, KeySpaceName, regular Columns, partitionKey, ClusteringKey, Clustering Order and so on. Thats really it! Thanks! On Mon, Feb 5, 2018 at 1:50 PM, Rahul Singh

Re: Add column if it does not exist?

2018-02-05 Thread Rahul Singh
Yeah, you can handle the exception — what i meant that it wouldnt cause harm to the DB -- Rahul Singh rahul.si...@anant.us Anant Corporation On Feb 5, 2018, 5:07 PM -0500, Oliver Ruebenacker , wrote: > Well, it does throw an InvalidQueryException if the column already exists.

Re: Add column if it does not exist?

2018-02-05 Thread Oliver Ruebenacker
Well, it does throw an InvalidQueryException if the column already exists. On Mon, Feb 5, 2018 at 4:44 PM, Rahul Singh wrote: > Since CQL != SQL, there’s isnt a syntatical way. Just run the alter table > command and it shouldn't be an issue if its there. > > -- >

Re: How to Parse raw CQL text?

2018-02-05 Thread Rahul Singh
I think I understand what you are trying to do … but what is your goal? What do you mean “use it for different” queries… Maybe you want to do an event and have an event processor? Seems like you are trying to basically by pass that pattern and parse a query and split it into several actions?

Re: Add column if it does not exist?

2018-02-05 Thread Rahul Singh
Since CQL != SQL, there’s isnt a syntatical way. Just run the alter table command and it shouldn't be an issue if its there. -- Rahul Singh rahul.si...@anant.us Anant Corporation On Feb 5, 2018, 4:15 PM -0500, Oliver Ruebenacker , wrote: > > Hello, > >   What's the

Add column if it does not exist?

2018-02-05 Thread Oliver Ruebenacker
Hello, What's the easiest way to add a column to a table but only if it does not exist? Thanks! Best, Oliver -- Oliver Ruebenacker Senior Software Engineer, Diabetes Portal , Broad Institute

How to Parse raw CQL text?

2018-02-05 Thread Kant Kodali
Hi All, I have a need where I get a raw CQL create table statement as a String and I need to parse the keyspace, tablename, columns and so on..so I can use it for various queries and send it to C*. I used the example below from this link . I get

Re: Heavy one-off writes best practices

2018-02-05 Thread Romain Hardouin
Hi Julien, We have such a use case on some clusters. If you want to insert big batches at fast pace the only viable solution is to generate SSTables on Spark side and stream them to C*. Last time we benchmarked such a job we achieved 1.3 million partitions inserted per seconde on a 3 C* nodes

Re: Cassandra 2.1: replace running node without streaming

2018-02-05 Thread Oleksandr Shulgin
On Sat, Feb 3, 2018 at 11:23 AM, Kyrylo Lebediev wrote: > Just tested on 3.11.1 and it worked for me (you may see the logs below). > > Just comprehended that there is one important prerequisite this method to > work: new node MUST be located in the same rack (in terms

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Jeff Jirsa
Also: coordinator handles tracing and read repair. Make sure tracing is off for production. Have your data repaired if possible to eliminate that. Use tracing to see what’s taking the time. -- Jeff Jirsa > On Feb 5, 2018, at 6:32 AM, Jeff Jirsa wrote: > > There’s two

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Jeff Jirsa
There’s two parts to latency on the Cassandra side: Local and coordinator When you read, the node to which you connect coordinates the request to the node which has the data (potentially itself). Long tail in coordinator latencies tend to be the coordinator itself gc’ing, which will happen

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Rahul Singh
What are the tbl Local read latency stats vs. the read request latency stats ? Rahul On Feb 5, 2018, 8:41 AM -0500, mohsin k , wrote: > Thanks for response @Nicolas. I was considering the total read latency from > the client to server (as shown in the image above)

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread mohsin k
Thanks for response @Nicolas. I was considering the total read latency from the client to server (as shown in the image above) which is around 30ms. Which I want to get around 3ms (client and server are both on same network). I did not consider read latency provided by the server (which I should

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Nicolas Guyomar
Your row hit rate is 0.971 which is already very high, IMHO there is "nothing" left to do here if you can afford to store your entire dataset in memory Local read latency: 0.030 ms already seems good to me, what makes you think that you can achieve more with the relative "small" box you are using

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread mohsin k
Hey Rahul, Each partition has around 10 cluster keys. Based on nodetool, I can roughly estimate partition size to be less than 1KB. On Mon, Feb 5, 2018 at 5:37 PM, mohsin k wrote: > Hey Nicolas, > > My goal is to reduce latency as much as possible. I did wait for

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread mohsin k
Hey Nicolas, My goal is to reduce latency as much as possible. I did wait for warmup. The test ran for more than 15mins, I am not sure why it shows 2mins though. On Mon, Feb 5, 2018 at 5:25 PM, Rahul Singh wrote: > What is the average size of your partitions /

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Rahul Singh
What is the average size of your partitions / rows. 1GB may not be enough. Rahul On Feb 5, 2018, 6:52 AM -0500, mohsin k , wrote: > Hi, > > I have been looking into different configurations for tuning my cassandra > servers. So, initially I loadtested server using

Re: Increased latency after setting row_cache_size_in_mb

2018-02-05 Thread Nicolas Guyomar
Hi, Could you explain a bit more what you are trying to achieve please ? Performance tuning is by far the most complex problem we have to deal with, and there are a lot of configuration changes that can be made on a C* cluster When you do performance tuning, do not forget that you need to warmup

Re: How to start cluster after the yaml file has been changed?

2018-02-05 Thread Nicolas Guyomar
Hi, You have an invalid yaml: file:/etc/cassandra/cassandra.yaml. I suppose what you just changed is not yaml compatible, pay attention to space betwenn semi-colon and value You an use any tool like https://jsonformatter.org/yaml-formatter to help fix this issue On 5 February 2018 at 09:28,

How to start cluster after the yaml file has been changed?

2018-02-05 Thread milenko markovic
I have changed yaml config file.Now I want to start my cassandra cluster.I have restarted node cassandra.service - LSB: distributed storage system for structured data   Loaded: loaded (/etc/init.d/cassandra; bad; vendor preset: enabled)   Active: active (running) since ma. 2018-02-05 09:27:05