Re: Ordering by multiple columns?

2016-10-10 Thread Ali Akhtar
Really helpful slides. Is there a video to go with them? On Sun, Oct 9, 2016 at 11:48 AM, DuyHai Doan wrote: > Yes it is possible, read this: http://www.slideshare. > net/doanduyhai/datastax-day-2016-cassandra-data-modeling-basics/24 > > and the following slides > > On

Re: Ordering by multiple columns?

2016-10-10 Thread DuyHai Doan
No, we didn't record the talk this time unfortunately :( On Mon, Oct 10, 2016 at 8:17 PM, Ali Akhtar wrote: > Really helpful slides. Is there a video to go with them? > > On Sun, Oct 9, 2016 at 11:48 AM, DuyHai Doan wrote: > >> Yes it is possible,

Re: JVM safepoints, mmap, and slow disks

2016-10-10 Thread Ariel Weisberg
Hi, > That StackOverflow headline is interesting. Based on my reading of > Hotspot's > code, it looks like sun.misc.unsafe is used under the hood to > perform mmapped > I/O. I need to learn more about Hotspot's implementation before I can > comment > further. A memory mapped file is "just"

Re: JVM safepoints, mmap, and slow disks

2016-10-10 Thread Josh Snyder
On Sat, Oct 8, 2016 at 9:02 PM, Ariel Weisberg wrote: ... > You could use this to minimize the cost. > http://stackoverflow.com/questions/36298111/is-it-possible-to-use-sun-misc-unsafe-to-call-c-functions-without-jni/36309652#36309652 That StackOverflow headline is

Re: JVM safepoints, mmap, and slow disks

2016-10-10 Thread Josh Snyder
That's a great idea. Even if the results were immediately thrown away, pre-reading in a JNI method would eliminate cache misses with very high probability. The only thing I'd worry about is the increased overhead of JNI interfering with the fast path (cache hits). I don't have enough knowledge on

Re: JVM safepoints, mmap, and slow disks

2016-10-10 Thread Josh Snyder
Do you know if there are any publicly available benchmarks on disk_access_mode, preferably after the fix from CASSANDRA-10249? If it turns out that syscall I/O is not significantly slower, I'd consider switching. If I don't know the costs, I think I'd prefer to stick with the devil I know how to

Re: sstableloader question

2016-10-10 Thread Rajath Subramanyam
Hi Osman, You cannot restart the streaming only to the failed nodes specifically. You can restart the sstableloader job itself. Compaction will eventually take care of the redundant rows. - Rajath Rajath Subramanyam On Sun, Oct 9, 2016 at 7:38 PM, Adam Hutson

Re: Where to change the datacenter name?

2016-10-10 Thread Ali Akhtar
Yeah, so what's happening is, I'm running Cassandra thru a docker image in production, and so over there, it is using the datacenter name that I specified thru an env variable. But on my local machine, Cassandra is annoyingly insisting on 'datacenter1'. So in order to maintain the same .cql

Re: Ordering by multiple columns?

2016-10-10 Thread Mikhail Krupitskiy
Looks like ordering by multiple columns in Cassandra has few sides that are not obvious. I wasn’t able to find this information in the official documentation but it’s quite well described here: http://stackoverflow.com/questions/35708118/where-and-order-by-clauses-in-cassandra-cql

Re: Where to change the datacenter name?

2016-10-10 Thread Surbhi Gupta
Data center name is there in two file , if you are using gossip as GossipingPropertyFileSnitch in Cassandra.yaml then data center name is in cassandra-rackdc.properties If you are using PropertyFileSnitch in Cassandra.yaml then file name where data center name is Cassandra-topology.properties

Re: Where to change the datacenter name?

2016-10-10 Thread Amit Trivedi
I believe it is coming from system.local. You can verify by executing select data_center from system.local; I would be careful changing datacenter name, particularly in production. This is essentially because if change of datacenter requires snitch configuration change, it may result in stale

Re: Doing a calculation in a query?

2016-10-10 Thread DuyHai Doan
Assuming you're using Cassandra 3.0 or more, User Defined Functions (UDF) can help you to compute the shipment_delay. For the ordering, since this column is computed and not a clustering column, ordering won't be possible More details about UDF: http://www.doanduyhai.com/blog/?p=1876 On Mon, Oct

Re: [Marketing Mail] Re: sstableloader question

2016-10-10 Thread Osman YOZGATLIOGLU
Hello, Thank you Adam and Rajath. I'll split input sstables and run parallel jobs for each. I tested this approach and run 3 parallel sstableloader job without -t parameter. I raised stream_throughput_outbound_megabits_per_sec parameter from 200 to 600 Mbit/sec at all of target nodes. But each

Re: Understanding cassandra data directory contents

2016-10-10 Thread Nicolas Douillet
Hi Json, I'm not familiar enough with Cassandra 3, but it might be snapshots. Snapshots are usually hardlinks to sstable directories. Try this : nodetool clearsnapshot Does it change anything? -- Nicolas Le sam. 8 oct. 2016 à 21:26, Jason Kania a écrit : > Hi

Where to change the datacenter name?

2016-10-10 Thread Ali Akhtar
Where can I change the default name 'datacenter1'? I've looked through the configuration files in /etc/cassandra , and can't find where this value is being defined.

Re: Where to change the datacenter name?

2016-10-10 Thread Adam Hutson
There is a cluster name in the cassandra.yaml for naming the cluster, aka data center. Then you assign keyspaces to the data center within the CREATE KEYSPACE stmt with NetworkTopology. On Monday, October 10, 2016, Ali Akhtar wrote: > Where can I change the default name

Re: Where to change the datacenter name?

2016-10-10 Thread Ali Akhtar
So I see this: cluster_name: 'Test Cluster' But when I grep -i or ctrl + f for 'datacenter1` in cassandra.yaml, I don't see that anywhere except in a comment. Yet when I do nodetool status, I see: datacenter1 And unless I define my replication as: '{'class': 'NetworkTopologyStrategy',

Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Ali Akhtar
According to http://docs.datastax.com/en/cql/3.3/cql/cql_using/useCreateUDT.html > In Cassandra 3.6 and later, the frozen keyword is not required for UDTs that contain only non-collection fields. However if I create a type with 4-5 all text fields, and try to use that type in another table, I

Doing a calculation in a query?

2016-10-10 Thread Ali Akhtar
I have a table for tracking orders. Each order has an `ordered_at` field (can be a timestamp, or a long with the milliseconds of the timestamp) and `shipped_at` field (ditto, timestamp or long). orderd_at tracks when the order was made. shipped_at tracks when the order was shipped. When

Re: Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Abhishek Verma
Thanks Jonathan, Utkarsh and Jeff. We will try to find a way for our Mesos framework to support upgrading the nodes in-place. On Mon, Oct 10, 2016 at 5:11 PM, Jonathan Haddad wrote: > During the upgrade you'll want to avoid the following operations that > result in data

NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Ali Akhtar
In working with Jackson, it has a NamingStrategy which lets you automatically map snake_case fields in json to camelCase fields on the Java class. Last time I worked w/ Cassandra, I didn't find anything like that, and had to define an @Column annotation for each field. Please tell me this has

[RELEASE] Apache Cassandra 2.1.16 released

2016-10-10 Thread Michael Shuler
The Cassandra team is pleased to announce the release of Apache Cassandra version 2.1.16. Apache Cassandra is a fully distributed database. It is the right choice when you need scalability and high availability without compromising performance. http://cassandra.apache.org/ Downloads of source

Re: Ordering by multiple columns?

2016-10-10 Thread Ali Akhtar
Okay.. so, how would you achieve the above scenario in cassandra? On Tue, Oct 11, 2016 at 3:25 AM, Peddi, Praveen wrote: > That's not just a bad idea but that's impossible. Any field that is part > of primary key is immutable. You should read up the Cassandra documentation >

Re: Ordering by multiple columns?

2016-10-10 Thread Nicolas Douillet
If I correctly understand the answers, the solution to your ordering question is to use clustering keys. I'm agree, but I just wanted to warn you about one limitation : the values of keys can't be updated, unless by using a delete and then an insert. (In the case of your song "example", putting

Re: Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Jonathan Haddad
You can't stream between major versions. Don't tear down your first data center, upgrade it instead. On Mon, Oct 10, 2016 at 4:35 PM Abhishek Verma wrote: > Hi Cassandra users, > > We are trying to upgrade our Cassandra version from 2.2.5 to 3.0.8 > (running on Mesos, but that's

Re: Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Utkarsh Sengar
As Johathan said, you need to upgrade cassandra directly and use "nodetool upgradesstables". Datastax has an excellent resource on upgrading cassandra https://docs.datastax.com/en/latest-upgrade/upgrade/cassandra/upgdCassandra.html, specifically

Re: Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Jeff Jirsa
No need to cc dev@, user@ is the right list for this question. As Jon mentioned, you can’t stream (bootstrap/rebuild/repair) across major versions, so don’t try to destroy the cluster – just upgrade in place. It IS a good idea to do one DC at a time, but an in-place upgrade is pretty

Re: Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Jonathan Haddad
During the upgrade you'll want to avoid the following operations that result in data streaming: 1. Bootstrapping nodes 2. Decomissioning nodes 3. Repair On Mon, Oct 10, 2016 at 5:00 PM Jeff Jirsa wrote: > > > No need to cc dev@, user@ is the right list for this

Re: Ordering by multiple columns?

2016-10-10 Thread Peddi, Praveen
That's not just a bad idea but that's impossible. Any field that is part of primary key is immutable. You should read up the Cassandra documentation and understand the basics before start using it. Otherwise you could easily abuse it inadvertently. Praveen On Oct 10, 2016, at 6:22 PM, Ali

Bootstrapping data from Cassandra 2.2.5 datacenter to 3.0.8 datacenter fails because of streaming errors

2016-10-10 Thread Abhishek Verma
Hi Cassandra users, We are trying to upgrade our Cassandra version from 2.2.5 to 3.0.8 (running on Mesos, but that's besides the point). We have two datacenters, so in order to preserve our data, we are trying to upgrade one datacenter at a time. Initially both DCs (dc1 and dc2) are running

Re: Ordering by multiple columns?

2016-10-10 Thread Ali Akhtar
Huh - So if I wanted to search / filter by a timestamp field, and this timestamp needed to get updated, that won't be possible? On Tue, Oct 11, 2016 at 3:07 AM, Nicolas Douillet < nicolas.douil...@gmail.com> wrote: > If I correctly understand the answers, the solution to your ordering > question

Re: Ordering by multiple columns?

2016-10-10 Thread Ali Akhtar
E.g if I wanted to select * from foo where last_updated <= ? In this case, (I believe) last_updated will have to be a clustering key. If the record got updated and I wanted to update last_updated accordingly, that's a bad idea? :S On Tue, Oct 11, 2016 at 3:19 AM, Ali Akhtar

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Ali Akhtar
CREATE TYPE test ( foo text, bar text ); CREATE TABLE test_table ( id text, this_doesnt_work test, PRIMARY KEY (id) ); On Tue, Oct 11, 2016 at 9:23 AM, Andrew Tolbert wrote: > Can you please share an example where it doesn't work? > > Thanks, > Andy > > On Mon,

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Andrew Tolbert
Indeed it is possible to use UDTs with the mapper (docs ). Pojos are annotated with @UDT and their fields are mapped with @Field (like table pojos are annotated with @Table and @Column respectively). You are

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Andrew Tolbert
Is the column you are using that has the UDT type is the or is part of the primary key? If that is the case it still needs to be frozen (the same goes for list, set, tuple as part of primary key). This is the error I get when I try that: InvalidRequest: Error from server: code=2200 [Invalid

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Ali Akhtar
Thanks. Btw, is it possible to use UDTs and have them mapped via the java driver? If so, how does that work - do I just create a pojo for the UDT, and use @Column on the fields, and it will work if I define a field in the table mapping class as being of that pojo type? On Tue, Oct 11, 2016 at

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Andrew Tolbert
Can you please share an example where it doesn't work? Thanks, Andy On Mon, Oct 10, 2016 at 11:21 PM Ali Akhtar wrote: > Not sure I understand the question, sorry. > > The column isn't part of the primary key. > > I defined a UDT and then I tried to define a column (not

Re: Where to change the datacenter name?

2016-10-10 Thread Vladimir Yudovin
Hello, on my local machine, Cassandra is annoyingly insisting on 'datacenter1'. I don't believe Cassandra does it on its own ))) What is parameter endpoint_snitch in cassandra.yaml file? As it was mentioned, different snitches use different configuration files and you can set the same data

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Andrew Tolbert
Hi Ali, As far as I know this hasn't changed. Either the field name on the class has to match the name of the column or you have to use the @Column with the name attribute to set the column name being mapped by that field. Thanks, Andy On Mon, Oct 10, 2016 at 8:03 PM Ali Akhtar

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Ali Akhtar
Please fix this. On Tue, Oct 11, 2016 at 8:28 AM, Andrew Tolbert wrote: > Hi Ali, > > As far as I know this hasn't changed. Either the field name on the class > has to match the name of the column or you have to use the @Column with the > name attribute to set

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Ali Akhtar
Not sure I understand the question, sorry. The column isn't part of the primary key. I defined a UDT and then I tried to define a column (not primary or cluster key) as being of that type, but it doesn't let me do that unless i set it as frozen. Docs indicate otherwise though On Tue, Oct 11,

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Jonathan Haddad
Works for me. You can see the version, CREATE TYPE, CREATE TABLE, insertion, and describing the table jhaddad@rustyrazorblade ~/dev/cassandra$ bin/cqlsh c1fa214 Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4] Use HELP

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Ali Akhtar
Is it possible to use fields on the UDT as primary / cluster keys? On Tue, Oct 11, 2016 at 9:49 AM, Ali Akhtar wrote: > Yeah, you're right, it does work if I run it thru cqlsh. I was using > DevCenter which shows that error. > > On Tue, Oct 11, 2016 at 9:48 AM, Andrew

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Andrew Tolbert
> > Is it possible to use fields on the UDT as primary / cluster keys? That is not supported as far as I know. In that case it's probably best to either use a frozen UDT or make the field a separate column. Thanks, Andy On Mon, Oct 10, 2016 at 11:50 PM, Jonathan Haddad

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Jonathan Haddad
No, you can't. Keep in mind parts of the primary key are immutable, so there would be no usability difference between a frozen UDT in your PK and a non-frozen one other than the frozen keyword. On Mon, Oct 10, 2016 at 10:07 PM Andrew Tolbert wrote: > Is it possible

Re: Understanding cassandra data directory contents

2016-10-10 Thread Vladimir Yudovin
Snapshots are created inside of table folder (one with ID suffix): $ nodetool snapshot music Requested creating snapshot(s) for [music] with snapshot name [1476165047920] Snapshot directory: 1476165047920 $pwd

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Andrew Tolbert
I agree this would be a nice mechanism for the driver mapper given the difference between java field name conventions and how cql column names are typically defined. I've created JAVA-1316 for this. Thanks, Andy On Mon, Oct 10, 2016 at

Re: NamingStrategy for the Java Driver for camelCase / snake_case conversion?

2016-10-10 Thread Ali Akhtar
Awesome, thank you. Perhaps this should be updated on the docs here: http://docs.datastax.com/en/developer/java-driver//3.1/manual/udts/ On Tue, Oct 11, 2016 at 9:27 AM, Andrew Tolbert wrote: > Indeed it is possible to use UDTs with the mapper (docs >

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Ali Akhtar
Yeah, you're right, it does work if I run it thru cqlsh. I was using DevCenter which shows that error. On Tue, Oct 11, 2016 at 9:48 AM, Andrew Tolbert wrote: > That works for me. Are you sure you are on 3.6+? What error message are > you getting? > > Thanks, >

Re: Being asked to use frozen for UDT in 3.9

2016-10-10 Thread Andrew Tolbert
That works for me. Are you sure you are on 3.6+? What error message are you getting? Thanks, Andy On Mon, Oct 10, 2016 at 11:25 PM Ali Akhtar wrote: > CREATE TYPE test ( > foo text, > bar text > ); > > CREATE TABLE test_table ( > id text, > this_doesnt_work test, >