Re: Unable to add columns to empty row in Column family: Cassandra

2011-05-19 Thread anuya joshi
Thank you Narendra/Aaron. Sorry for late respponse.  PFB further information
on this.

1) How do you delete the data in the cli ? Is it a row delete e.g. del
MyCF['my-key'];
*[Anuya]:* Yeach. Exactly the same way.

2) What client are you using the insert the row the second time ? e.g.
custom thrift wrapper or pycassa
*[Anuya]:* I am using Thrift APIs in JAVA code directly. No high level
Cassandra client. I am using Cassandra client's INSERT and REMOVE methods
to insert and delete rows programmatically.

3) How is the second read done, via the cli ?
*[Anuya]:* Operations are as follows:
  1) INSERT #1: Programmatically
  2) DELETE #1: Command line
  3) INSERT #2: Programmatically

A READ opeation, after each of the above steps, is done using CLI

4) Does the same test work when you only use your app ?
*[Anuya]:* Exactly, INSERT - DELETE - INSERT scenario with same
row key works well if executed only from command line OR  only
programmatically. Basically, over here, I am trying to resuse the row key.
So, I create a row with a specific key, delete that row (But, Cassandra
delete does not delete a row key.  Only deletes all columns in a row.) and
then I want to insert the columns in a same row with same row id.  Correct
me if I go wrong, reusing the row key should work as per Cassandra data
model definition/structure.

5) Cassandra-cli will be using the current time as it's time stamp for the
delete. If I had to guess what was happening it would be a problem with the
timestamps your app is creating.
*[Anuya]:* Well, regarding timestamps..
My JAVA code to generate timstamps is simply: System.currentTimeMillis();
So, I also use current time as a timestamp similar to Cassandra as you
mentioned. Then, irrespective of which client was used for insert/delete
operations, this INSERT - DELETE - INSERT scenario should work. Because,
as per the sequence of these operations (INSERT - DELETE - INSERT) the
timestamp condition *TS[INSERT #2]  TS[DELETE  #1]  TS[INSERT  #1] will be
obviously satisfied. *
**
But, the fact is, this scenario does not work while switching between
clients for INSERT and DELETE opeations as mentioned in point #3 above.

So, is this a clock synchronization issue? I mean the clock used by
program to generate timstamps is out of sync with clock used by CLI?

On this, FYI, I am running linux based VMs which in turn run a Cassandra
servers. The command line client is obviously on VM and the JAVA program is
on host machine running a VM.  If the clocks of these two machines are in
sync then, I think, switching between clients should not matter?

Before I hit the send button, :), I scrutinized the clocks on VM and
host m/c. The clock on VM is exactly 4 seconds behind the clock on host m/c.

I welcome your comments on above.

   Thanks,
   Anuya










On Thu, May 12, 2011 at 4:31 PM, Narendra Sharma
narendra.sha...@gmail.comwrote:

 Can u share the code?


 On Mon, May 2, 2011 at 11:34 PM, anuya joshi anu...@gmail.com wrote:

 Hello,

 I am using Cassandra for my application.My Cassandra client uses Thrift
 APIs directly. The problem I am facing currently is as follows:

 1) I added a row and columns in it dynamically via Thrift API Client
 2) Next, I used command line client to delete row which actually deleted
 all the columns in it, leaving empty row with original row id.
 3) Now, I am trying to add columns dynamically using client program into
 this empty row with same row key
 However, columns are not being inserted.
 But, when tried from command line client, it worked correctly.

 Any pointer on this would be of great use

 Thanks in  advance,

 Regards,
 Anuya




 --
 Narendra Sharma
 Solution Architect
 *http://www.persistentsys.com*
 *http://narendrasharma.blogspot.com/*





Re: Unable to add columns to empty row in Column family: Cassandra

2011-05-12 Thread Narendra Sharma
Can u share the code?

On Mon, May 2, 2011 at 11:34 PM, anuya joshi anu...@gmail.com wrote:

 Hello,

 I am using Cassandra for my application.My Cassandra client uses Thrift
 APIs directly. The problem I am facing currently is as follows:

 1) I added a row and columns in it dynamically via Thrift API Client
 2) Next, I used command line client to delete row which actually deleted
 all the columns in it, leaving empty row with original row id.
 3) Now, I am trying to add columns dynamically using client program into
 this empty row with same row key
 However, columns are not being inserted.
 But, when tried from command line client, it worked correctly.

 Any pointer on this would be of great use

 Thanks in  advance,

 Regards,
 Anuya




-- 
Narendra Sharma
Solution Architect
*http://www.persistentsys.com*
*http://narendrasharma.blogspot.com/*


Re: Unable to add columns to empty row in Column family: Cassandra

2011-05-11 Thread aaron morton
How do you delete the data in the cli ? Is it a row delete e.g. del 
MyCF['my-key'];

What client are you using the insert the row the second time ? e.g. custom 
thrift wrapper or pycassa 

How is the second read done, via the cli ? 

Does the same test work when you only use your app ? 
 
Cassandra-cli will be using the current time as it's time stamp for the delete. 
If I had to guess what was happening it would be a problem with the timestamps 
your app is creating.

Thanks

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 12 May 2011, at 12:42, anuya joshi wrote:

 Thanks aaron. here come the details:
 
 1) Version: 0.7.4
 2) Its a two node cluster with RF=2
 3) It works perfectly after 1st get. Then I delete all the columns in a row. 
 Finally, I try to insert into the same row with same row id. However, its not 
 getting inserted programmatically. 
 
 Thanks,
 Anuya
 
 On Tue, May 3, 2011 at 2:03 AM, aaron morton aa...@thelastpickle.com wrote:
 If your are still having problems can you say what version, how many nodes, 
 what RF, what CL and if after inserting and failing on the first get it works 
 on a subsequent get. 
 
 
 Thanks
 Aaron
 
 On 3 May 2011, at 18:54, chovatia jaydeep wrote:
 
 One small correction in my mail below. 
 Second insertion time-stamp has to be greater than delete time-stamp 
 in-order to retrieve the data.
 
 Thank you,
 Jaydeep
 From: chovatia jaydeep chovatia_jayd...@yahoo.co.in
 To: user@cassandra.apache.org user@cassandra.apache.org
 Sent: Monday, 2 May 2011 11:52 PM
 Subject: Re: Unable to add columns to empty row in Column family: Cassandra
 
 Hi Anuya,
 
  However, columns are not being inserted.
 
 Do you mean to say that after insert operation you couldn't retrieve the 
 same data? If so, then please check the time-stamp when you reinserted after 
 delete operation. Your second insertion time-stamp has to be greater than 
 the previous insertion.
 
 Thank you,
 Jaydeep
 From: anuya joshi anu...@gmail.com
 To: user@cassandra.apache.org
 Sent: Monday, 2 May 2011 11:34 PM
 Subject: Re: Unable to add columns to empty row in Column family: Cassandra
 
 Hello,
 
 I am using Cassandra for my application.My Cassandra client uses Thrift APIs 
 directly. The problem I am facing currently is as follows:
 
 1) I added a row and columns in it dynamically via Thrift API Client
 2) Next, I used command line client to delete row which actually deleted all 
 the columns in it, leaving empty row with original row id.
 3) Now, I am trying to add columns dynamically using client program into 
 this empty row with same row key
 However, columns are not being inserted.
 But, when tried from command line client, it worked correctly.
 
 Any pointer on this would be of great use
 
 Thanks in  advance,
 
 Regards,
 Anuya
 
 
 
 
 
 



Unable to add columns to empty row in Column family: Cassandra

2011-05-03 Thread anuya joshi
Hello,

I am using Cassandra for my application.My Cassandra client uses Thrift APIs
directly. The problem I am facing currently is as follows:

1) I added a row and columns in it dynamically via Thrift API Client
2) Next, I used command line client to delete row which actually deleted all
the columns in it, leaving empty row with original row id.
3) Now, I am trying to add columns dynamically using client program into
this empty row with same row key
However, columns are not being inserted.
But, when tried from command line client, it worked correctly.

Any pointer on this would be of great use

Thanks in  advance,

Regards,
Anuya


Re: Unable to add columns to empty row in Column family: Cassandra

2011-05-03 Thread chovatia jaydeep
Hi Anuya,

 However, columns are not being inserted.


Do you mean to say that after insert operation you couldn't retrieve the same 
data? If so, then please check the time-stamp when you reinserted after delete 
operation. Your second insertion time-stamp has to be greater than the previous 
insertion.

Thank you,
Jaydeep


From: anuya joshi anu...@gmail.com
To: user@cassandra.apache.org
Sent: Monday, 2 May 2011 11:34 PM
Subject: Re: Unable to add columns to empty row in Column family: Cassandra


Hello,

I am using Cassandra for my application.My Cassandra client uses Thrift APIs 
directly. The problem I am facing currently is as follows:

1) I added a row and columns in it dynamically via Thrift API Client
2) Next, I used command line client to delete row which actually deleted all 
the columns in it, leaving empty row with original row id.
3) Now, I am trying to add columns dynamically using client program into this 
empty row with same row key
    However, columns are not being inserted.
    But, when tried from command line client, it worked correctly.

Any pointer on this would be of great use

Thanks in  advance,

Regards,
Anuya

Re: Unable to add columns to empty row in Column family: Cassandra

2011-05-03 Thread chovatia jaydeep
One small correction in my mail below. 
Second insertion time-stamp has to be greater than delete time-stamp in-order 
to retrieve the data.

Thank you,
Jaydeep


From: chovatia jaydeep chovatia_jayd...@yahoo.co.in
To: user@cassandra.apache.org user@cassandra.apache.org
Sent: Monday, 2 May 2011 11:52 PM
Subject: Re: Unable to add columns to empty row in Column family: Cassandra


Hi Anuya,

 However, columns are not being inserted.


Do you mean to say that after insert operation you couldn't retrieve the same 
data? If so, then please check the time-stamp when you reinserted after delete 
operation. Your second insertion time-stamp has to be greater than the previous 
insertion.

Thank you,
Jaydeep


From: anuya joshi anu...@gmail.com
To: user@cassandra.apache.org
Sent: Monday, 2 May 2011 11:34 PM
Subject: Re: Unable to add columns to empty row in Column family: Cassandra


Hello,

I am using Cassandra for my application.My Cassandra client uses Thrift APIs 
directly. The problem I am facing currently is as follows:

1) I added a row and columns in it dynamically via Thrift API Client
2) Next, I used command line client to delete row which actually deleted all 
the columns in it, leaving empty row with original row id.
3) Now, I am trying to add columns dynamically using client program into this 
empty row with same row key
    However, columns are not being inserted.
    But, when tried from command line client, it worked correctly.

Any pointer on this would be of great use

Thanks in  advance,

Regards,
Anuya