Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
Hey Colin, On Tue, Feb 25, 2014 at 10:26 PM, Colin Blower wrote: > It looks like you are trying to implement the Decimal type. You might want > to start with implementing the Integer type. The Decimal type follows pretty > easily from the Integer type. > > For example: > i = unmarchalInteger(data

Re: Update multiple rows in a CQL lightweight transaction

2014-02-25 Thread Sylvain Lebresne
Sorry to interfere again here but CASSANDRA-5633 will not be picked up because pretty much everything it was set to fix is fixed by CASSANDRA-6561, this is *not* a syntax problem anymore. On Wed, Feb 26, 2014 at 3:18 AM, Tupshin Harper wrote: > Unfortunately there is no option to vote for a "re

Re: Default serial consistency level

2014-02-25 Thread Sylvain Lebresne
On Tue, Feb 25, 2014 at 10:04 PM, Wayne Schroeder < wschroe...@pinsightmedia.com> wrote: > I have some conditional insert/update operations that set quorum > consistency. I was using this with the 1.0 driver, back before the 2.0 > features required the 2.0 driver. Now that I'm on the 2.0 driver,

RE: Supported Cassandra version for CentOS 5.5

2014-02-25 Thread Hari Rajendhran
Hi, Thanks for the update.Could you please suggest the last possible apache cassandra version supported for CentOS 5.5?? Best Regards Hari Krishnan Rajendhran Hadoop Admin DESS-ABIM ,Chennai BIGDATA Galaxy Tata Consultancy Services Cell:- 9677985515 Mailto: hari.rajendh...@tcs.com Website: ht

Re: Getting the most-recent version from time-series data

2014-02-25 Thread Tupshin Harper
I failed to address the matter of not knowing the families in advance. I can't really recommend any solution to that other than storing the list of families in another structure that is readily queryable. I don't know how many families you are thinking, but if it is in the millions or more, You mi

Re: Getting the most-recent version from time-series data

2014-02-25 Thread Tupshin Harper
Hi Clint, What you are describing could actually be accomplished with the Thrift API and a multiget_slice with a slicerange having a count of 1. Initially I was thinking that this was an important feature gap between Thrift and CQL, and was going to suggest that it should be implemented (possible

Re: Update multiple rows in a CQL lightweight transaction

2014-02-25 Thread Tupshin Harper
Unfortunately there is no option to vote for a "resolved" ticket, but if you can propose a better syntax that people agree on, you could probably get some fresh traction on it. -Tupshin On Feb 25, 2014 7:20 PM, "Clint Kelly" wrote: > Hi Tupshin, > > Thanks for your help! Unfortunately in my cas

Re: Getting the most-recent version from time-series data

2014-02-25 Thread Clint Kelly
Hi Jonathan, Thanks for the suggestion! I see a couple of problems with this approach: 1. I do not know a priori all of the family names (so I still would not know what value to use for LIMIT). 2. The "versions" here are similar to timestamps, so one "family" may get updated far more often than

Re: Thrift Server Implementations

2014-02-25 Thread Robert Coli
On Thu, Feb 13, 2014 at 10:37 AM, Christopher Wirt wrote: > TL;DR: > > Has anyone ever tried using the new thrift 0.9 TThreadSelectorServer for > their thrift server? > > I did today and have found it performs pretty well. > > Is this something people would like to see in the C* trunk? > I'd be i

Re: Getting the most-recent version from time-series data

2014-02-25 Thread Jonathan Lacefield
Clint One approach would be to create a copy of this table and switch the clustering columns around so version precedes family. This way you could easily grab the 1st, 2nd, N version rows. Would this help you in your situation? Jonathan > On Feb 25, 2014, at 7:49 PM, Clint Kelly wrote: > >

Getting the most-recent version from time-series data

2014-02-25 Thread Clint Kelly
Hi everyone, Let's say that I have a table that looks like the following: CREATE TABLE time_series_stuff ( key text, family text, version int, val text, PRIMARY KEY (key, family, version) ) WITH CLUSTERING ORDER BY (family ASC, version DESC) AND bloom_filter_fp_chance=0.01 AND c

Re: Update multiple rows in a CQL lightweight transaction

2014-02-25 Thread Clint Kelly
Hi Tupshin, Thanks for your help! Unfortunately in my case, I will need to do a compare and set in which the compare is against a value in a dynamic column. In general, I need to be able to do the following: - Check whether a given value exists in a dynamic column - If so, perform some nu

RE: Supported Cassandra version for CentOS 5.5

2014-02-25 Thread Donald Smith
I was unable to get cassandra working with CentOS 5.X . I needed to use CentOS 6.2 or 6.4. Don From: Hari Rajendhran Sent: Tuesday, February 25, 2014 2:34 AM To: user@cassandra.apache.org Subject: Supported Cassandra version for CentOS 5.5 Hi, Currently i am

Re: CQL decimal encoding

2014-02-25 Thread Colin Blower
Hey Ben, It looks like you are trying to implement the Decimal type. You might want to start with implementing the Integer type. The Decimal type follows pretty easily from the Integer type. For example: i = unmarchalInteger(data[4:]) s = decInt(data[0:4]) out = inf.newDec(i, s) On 02/24/2014 09

Re: Cassandra Data Model and Surrogate Keys

2014-02-25 Thread Daniel Chia
If you look at https://github.com/Netflix/astyanax/wiki , they have both distributed lock, as well as a uniqueness constraint recipe. Once you get past the thrift/astyanax style code, the underlying principle is fairly simple which you should be able to port it to CQL3. Thanks, Daniel On Tue, F

Fwd: Cassandra Data Model and Surrogate Keys

2014-02-25 Thread John Stager
Hello Daniel, That is correct this is for user creation and collisions should be rare. Is the astyanax recipe a distributed lock? I do not understand what you mean by a combination of reads and writes? We are using cql3 with the Datastax java driver Thanks *From: *Daniel Chia *Sent: *Tuesday,

Default serial consistency level

2014-02-25 Thread Wayne Schroeder
I have some conditional insert/update operations that set quorum consistency. I was using this with the 1.0 driver, back before the 2.0 features required the 2.0 driver. Now that I'm on the 2.0 driver, I have found the new setSerialConsistencyLevel routine for statements. Multiple places it r

Re: How should clients handle the user defined types in 2.1?

2014-02-25 Thread Michael Dykman
Please do. I too am working at a driver implementation and would be delighted to be spared the research. On Feb 25, 2014 11:29 AM, "Theo Hultberg" wrote: > thanks for the high level description of the format, I'll see if I can > make a stab at implementing support for custom types now. > > and m

Re: Cassandra Data Model and Surrogate Keys

2014-02-25 Thread Daniel Chia
Hi John, Since this is presumably for creation of users, which should have low activity per user, you can use a combination of reads / writes to acquire a "lock" on the username. I believe astyanax has a recipe with what you want that works for C1.2 (although you might have to port it to CQL3 if t

RE: Reverse a delete operation

2014-02-25 Thread PARASHAR, BHASKARJYA JAY
Thanks! From: Jonathan Lacefield [mailto:jlacefi...@datastax.com] Sent: Tuesday, February 25, 2014 11:17 AM To: user@cassandra.apache.org Subject: Re: Reverse a delete operation A couple of options: 1) Do you have a snapshot? If so, you could recover form the snapshot? 2) Look in the stable

Re: Which SSTable caused CorruptSSTableException?

2014-02-25 Thread Robert Coli
On Tue, Feb 25, 2014 at 9:48 AM, Ike Walker wrote: > Running Cassandra 1.2.9 in AWS with a 12 host cluster, I am getting lots > of CorruptSSTableException in system.log on one of my hosts. > > Is it possible to find out which SSTable(s) is/are corrupt? > This feature has been requested a few tim

Which SSTable caused CorruptSSTableException?

2014-02-25 Thread Ike Walker
Running Cassandra 1.2.9 in AWS with a 12 host cluster, I am getting lots of CorruptSSTableException in system.log on one of my hosts. Is it possible to find out which SSTable(s) is/are corrupt? I'm currently running "nodetool scrub" on the relevant host, but that doesn't seem like an efficient wa

Re: Reverse a delete operation

2014-02-25 Thread Jonathan Lacefield
A couple of options: 1) Do you have a snapshot? If so, you could recover form the snapshot? 2) Look in the stable via SSTable2JSON and find the pre-deleted row state then reinsert it. There are probably other options as well. Jonathan Lacefield Solutions Architect, DataStax (404) 822 3487 <

Reverse a delete operation

2014-02-25 Thread PARASHAR, BHASKARJYA JAY
We deleted a row by mistake. Is there a way to somehow recover it? Thanks

Re: How should clients handle the user defined types in 2.1?

2014-02-25 Thread Theo Hultberg
thanks for the high level description of the format, I'll see if I can make a stab at implementing support for custom types now. and maybe I should take all of the reverse engineering I've done of the type encoding and decoding and send a pull request for the protocol spec, or write an appendix.

Re: Handling data consistency

2014-02-25 Thread Steven A Robenalt
Hi Kasper, Given the 2 most common queries you mention (top 5 and 5 nearest), I will assume that these are relative to the current user, so basically, they would correspond to the top 5 among my friends, and the 5 closest to my own top score. If that is your intention, I would suggest that you cou

Re: CQL decimal encoding

2014-02-25 Thread Peter Lin
sounds like maybe the bytes aren't being converted to big endian before sending the bytes to to Cassandra. In my C# driver, this is what I do. 1. I get the bytes for the scale and unscaled value 2. I reverse both byte arrays 3. I copy the bytes to a new byte array here is the actual C# code.

Re: Mixing CAS and TTL.

2014-02-25 Thread J Robert Ray
Good to hear, thanks. I didn't find that in my searches. On Feb 25, 2014 3:13 AM, "Sylvain Lebresne" wrote: > You're running into https://issues.apache.org/jira/browse/CASSANDRA-6623. > It will be fixed in 2.0.6 but you can read the comments there for more > details. > > > On Tue, Feb 25, 2014 at

Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
On Tue, Feb 25, 2014 at 12:50 PM, Peter Lin wrote: > > if I have time this week, I'll try to make a patch for the spec. Can't > promise I can get to it this week, but having come across this issue with > FluentCassandra, I'd like to help others avoid it. So I may be running into an encoding bug w

Cassandra-cli and Composite columns

2014-02-25 Thread Ken Hancock
I've been trying to do some simple data modeling and since we're currently using Hector have been doing that modeling with cassandra-cli and running into issues with CompositeType columns. If I do a "help set", I see: The help for "create column family" shows: create column family UseComposites

Re: Cassandra Data Model and Surrogate Keys

2014-02-25 Thread john . stager
Thanks again Michael. Those are the conclusions that I came to as well. For us the window is small for possible duplicate users so I think we will have to do the read before like you suggested. We will also have to be able to handle the case where the duplicate users exist. And thanks for the

Re: CQL decimal encoding

2014-02-25 Thread Peter Lin
if I have time this week, I'll try to make a patch for the spec. Can't promise I can get to it this week, but having come across this issue with FluentCassandra, I'd like to help others avoid it. On Tue, Feb 25, 2014 at 5:38 AM, Sylvain Lebresne wrote: > On Mon, Feb 24, 2014 at 8:50 PM, Theo Hul

Re: CQL decimal encoding

2014-02-25 Thread Ben Hood
Sylvain, On Tue, Feb 25, 2014 at 10:38 AM, Sylvain Lebresne wrote: > The honest answer is, no-one took the time to write that down properly and > include it in the spec. My small excuse for initially skipping it in the > spec is that the CQL data type encodings are really not different from what

Re: Mixing CAS and TTL.

2014-02-25 Thread Sylvain Lebresne
You're running into https://issues.apache.org/jira/browse/CASSANDRA-6623. It will be fixed in 2.0.6 but you can read the comments there for more details. On Tue, Feb 25, 2014 at 9:02 AM, J Robert Ray wrote: > Thanks Daniel. > > I am taking care to only expire the one column. There are other col

Re: How should clients handle the user defined types in 2.1?

2014-02-25 Thread Sylvain Lebresne
> > > Is there any documentation on how CQL clients should handle the new user > defined types coming in 2.1? There's nothing in the protocol specification > on how to handle custom types as far as I can see. > Can't say there is much documentation so far for that. As for the spec, it was written

Re: Update multiple rows in a CQL lightweight transaction

2014-02-25 Thread Sylvain Lebresne
On Mon, Feb 24, 2014 at 11:32 PM, Tupshin Harper wrote: > Hi Clint, > > That does appear to be an omission in CQL3. It would be possible to > simulate it by doing > BEGIN BATCH > UPDATE foo SET z = 10 WHERE x = 'a' AND y = 1 IF t= 2 AND z=10; > UPDATE foo SET t = 5,z=6 where x = 'a' AND y

Re: CQL decimal encoding

2014-02-25 Thread Sylvain Lebresne
On Mon, Feb 24, 2014 at 8:50 PM, Theo Hultberg wrote: > I don't know if it's by design or if it's by oversight that the data types > aren't part of the binary protocol specification. > The honest answer is, no-one took the time to write that down properly and include it in the spec. My small exc

Supported Cassandra version for CentOS 5.5

2014-02-25 Thread Hari Rajendhran
Hi, Currently i am using CentOS 5.5 OS.I need a clarification on the latest cassandra version(preferably 2.0.4) that my OS supports. Best Regards Hari Krishnan Rajendhran Hadoop Admin DESS-ABIM ,Chennai BIGDATA Galaxy Tata Consultancy Services Cell:- 9677985515 Mailto: hari.rajendh...@tcs.com

Re: Handling data consistency

2014-02-25 Thread Kasper Middelboe Petersen
Hi Steve, I've considered this approach before and I'm partial to going this way again. The reason I haven't yet is the fact that I'm fairly confident that the user patterns would have a lot more highscore list reads than setting of highscores or adding friends. And most of the reads from highsco

RE: Mixing CAS and TTL.

2014-02-25 Thread J Robert Ray
Thanks Daniel. I am taking care to only expire the one column. There are other columns so my row isn't completely deleted. On Feb 24, 2014 11:37 PM, "Daniel Shelepov" wrote: > For the case where you don't get the update, is your whole row removed > when TTL expires? If so, you're essentially lo