Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 75640 invoked from network); 25 Jul 2010 06:27:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jul 2010 06:27:56 -0000 Received: (qmail 42074 invoked by uid 500); 25 Jul 2010 06:27:54 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 41855 invoked by uid 500); 25 Jul 2010 06:27:52 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 41847 invoked by uid 99); 25 Jul 2010 06:27:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jul 2010 06:27:51 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jshook@gmail.com designates 209.85.216.44 as permitted sender) Received: from [209.85.216.44] (HELO mail-qw0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jul 2010 06:27:44 +0000 Received: by qwe5 with SMTP id 5so1272868qwe.31 for ; Sat, 24 Jul 2010 23:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=k2HgQ4y+Lov6a7nuhmjBN6imbT+TJc+wgNqfd9lxxOw=; b=r9N4GYl0/gnzbDyEe2uIXoeLOY3LddHxhaqoIxx4QWdsOIZERrTg5h/MKl6P0szMi5 WENtxFKAyaqERWXDjpPeUfuxrosro8QWT3PsgfrFpjMA1WHIjEFHVmArfa5U5WL2iQwt ycMpn4BhrxM1fJ2vamG0/XCRG29eUmXaIv9WI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=DztICicHCYJRmha73kzxB9II6HgpT9AEpaOJFH/M2FqJY0QwLt/r18rWtVrXTHpjDO 3p6VeDeMF4lpVF59DksWLLTxLaQajrvtEjqjoDIplJmqy/gCkwVZs7LXoVCl0TqvlfoJ atjR3G0Ua3Z2vrM0DNTqqivKqo5el6DYNctlQ= MIME-Version: 1.0 Received: by 10.224.54.140 with SMTP id q12mr4653607qag.319.1280039243121; Sat, 24 Jul 2010 23:27:23 -0700 (PDT) Received: by 10.229.81.132 with HTTP; Sat, 24 Jul 2010 23:27:23 -0700 (PDT) In-Reply-To: References: <5A4D71ACC2708E4BB1BD7B6F87E51C6B02B6D058@sccorpmail01.mygazoo.com> <5A4D71ACC2708E4BB1BD7B6F87E51C6B08428437@sccorpmail01.mygazoo.com> <5A4D71ACC2708E4BB1BD7B6F87E51C6B0842846C@sccorpmail01.mygazoo.com> <5A4D71ACC2708E4BB1BD7B6F87E51C6B08428470@sccorpmail01.mygazoo.com> <5A4D71ACC2708E4BB1BD7B6F87E51C6B02B6D059@sccorpmail01.mygazoo.com> Date: Sun, 25 Jul 2010 01:27:23 -0500 Message-ID: Subject: Re: CRUD test From: Jonathan Shook To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org That's a question that many Java developers would like the answer to. Unfortunately, anything better than milliseconds requires JNI, since the current JVM doesn't officially support anything higher. There are solutions to this particular problem, but for most people, milliseconds are sufficient outside of testing. This is because the likelihood of making two conflicting changes to the same row/column in the same "session" within the same millisecond is pretty low for actual users and real scenarios. Tests tend to be a little unrealistic in the sense that they happen quickly within a short amount of time and aren't dependent on the timing of people or other systems. If you are using a "remove and replace" scheme, it could still be a problem. The way I get around it for now is to use the microsecond unit of time with a millisecond source (getCurrentMillis()), and increment it artificially when it would return the same value twice in a row. It's a hack, but it works for my purposes. On Sun, Jul 25, 2010 at 12:54 AM, Oleg Tsvinev wro= te: > Thank you guys for your help! > Yes, I am using=A0System.currentTimeMillis() in my CRUD test. Even though= I'm > still using it my tests now run as expected. I do not use cassandra-cli > anymore. > @Ran great job on Hector, I wish there was more documentation but I manag= ed. > @Jonathan, what is the recommended time source? I use batch_mutation to > insert and update multiple columns atomically. Do I have to use > the=A0batch_mutation for deletion, too? > On Sat, Jul 24, 2010 at 2:36 PM, Jonathan Shook wrote: >> >> Just to clarify, microseconds may be used, but they provide the same >> behavior as milliseconds if they aren't using a higher time resolution >> underneath. In some cases, the microseconds are generated simply as >> milliseconds * 1000, which doesn't actually fix any sequencing bugs. >> >> On Sat, Jul 24, 2010 at 3:46 PM, Ran Tavory wrote: >> > Hi Oleg, I didn't follow up the entire thread, but just to let you kno= w >> > that >> > the 0.6.* version of the CLI uses microsec as the time unit for >> > timestamps. >> > Hector also uses micros to match that, however, previous versions of >> > hector >> > (as well as the CLI) used milliseconds, not micro. >> > So if you're using hector version=A00.6.0-11 or earlier, or by any cha= nce >> > in >> > some other ways are mixing milisec in your app (are you using >> > System.currentTimeMili() somewhere?) then the behavior you're seeing i= s >> > expected. >> > >> > On Sat, Jul 24, 2010 at 1:06 AM, Jonathan Shook >> > wrote: >> >> >> >> I think you are getting it. >> >> >> >> As far as what means what at which level, it's really about using the= m >> >> consistently in every case. The [row] key (or [row] key range) is a >> >> top-level argument for all of the operations, since it is the "key" t= o >> >> mapping the set of responsible nodes. The key is the part of the name >> >> of any column which most affects how the load is apportioned in the >> >> cluster, so it is used very early in request processing. >> >> >> >> >> >> On Fri, Jul 23, 2010 at 4:22 PM, Peter Minearo >> >> wrote: >> >> > Consequentially the remove should look like: >> >> > >> >> > >> >> > ColumnPath cp1 =3D new ColumnPath("Super2"); >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp1.setSuper_column("Best Western".g= etBytes()); >> >> > >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.remove(KEYSPACE, >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= "hotel", >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= cp1, >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= System.currentTimeMillis(), >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= ConsistencyLevel.ONE); >> >> > >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp2 =3D new ColumnPath("S= uper2"); >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp2.setSuper_column("Econolodge".get= Bytes()); >> >> > >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.remove(KEYSPACE, >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= "hotel", >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= cp2, >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= System.currentTimeMillis(), >> >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= ConsistencyLevel.ONE); >> >> > >> >> > >> >> > -----Original Message----- >> >> > From: Peter Minearo [mailto:Peter.Minearo@Reardencommerce.com] >> >> > Sent: Fri 7/23/2010 2:17 PM >> >> > To: user@cassandra.apache.org >> >> > Subject: RE: CRUD test >> >> > >> >> > CORRECTION: >> >> > >> >> > ColumnPath cp1 =3D new ColumnPath("Super2"); >> >> > cp1.setSuper_column("Best Western".getBytes()); >> >> > cp1.setColumn("name".getBytes()); >> >> > client.insert(KEYSPACE, "hotel", cp1, "Best Western of >> >> > SF".getBytes(), >> >> > System.currentTimeMillis(), ConsistencyLevel.ALL); >> >> > >> >> > >> >> > -----Original Message----- >> >> > From: Peter Minearo [mailto:Peter.Minearo@Reardencommerce.com] >> >> > Sent: Friday, July 23, 2010 2:14 PM >> >> > To: user@cassandra.apache.org >> >> > Subject: RE: CRUD test >> >> > >> >> > Interesting!! Let me rephrase to make sure I understood what is goi= ng >> >> > on: >> >> > >> >> > When Inserting data via the "insert" function/method: >> >> > >> >> > void insert(string keyspace, string key, ColumnPath column_path, >> >> > binary >> >> > value, i64 timestamp, ConsistencyLevel consistency_level) >> >> > >> >> > The "key" parameter is the actual Key to the "Row", which contains >> >> > SuperColumns. =A0The 'ColumnPath' gives the path within the Key. >> >> > >> >> > >> >> > >> >> > INCORRECT: >> >> > ColumnPath cp1 =3D new ColumnPath("Super2"); >> >> > cp1.setSuper_column("hotel".getBytes()); >> >> > cp1.setColumn("Best Western".getBytes()); client.insert(KEYSPACE, >> >> > "name", cp1, "Best Western of SF".getBytes(), >> >> > System.currentTimeMillis(), >> >> > ConsistencyLevel.ALL); >> >> > >> >> > >> >> > CORRECT: >> >> > ColumnPath cp1 =3D new ColumnPath("Super2"); >> >> > cp1.setSuper_column("name".getBytes()); >> >> > cp1.setColumn("Best Western".getBytes()); client.insert(KEYSPACE, >> >> > "hotel", cp1, "Best Western of SF".getBytes(), >> >> > System.currentTimeMillis(), >> >> > ConsistencyLevel.ALL); >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > -----Original Message----- >> >> > From: Jonathan Shook [mailto:jshook@gmail.com] >> >> > Sent: Friday, July 23, 2010 1:49 PM >> >> > To: user@cassandra.apache.org >> >> > Subject: Re: CRUD test >> >> > >> >> > Correct. >> >> > >> >> > After the initial insert, >> >> > >> >> > cassandra> get Keyspace1.Super2['name'] >> >> > =3D> (super_column=3Dhotel, >> >> > =A0 =A0 (column=3DBest Western, value=3DBest Western of SF, >> >> > timestamp=3D1279916772571) >> >> > =A0 =A0 (column=3DEconolodge, value=3DEconolodge of SF, >> >> > timestamp=3D1279916772573)) Returned 1 results. >> >> > >> >> > ... and ... >> >> > >> >> > cassandra> get Keyspace1.Super2['hotel'] >> >> > Returned 0 results. >> >> > >> >> > >> >> > >> >> > On Fri, Jul 23, 2010 at 3:41 PM, Peter Minearo >> >> > wrote: >> >> >> The Model Should look like: >> >> >> >> >> >> >> >> >> Super2 =3D { >> >> >> =A0 =A0 =A0 =A0hotel: { >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Best Western: {name= : "Best Western of SF"} >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Econolodge: {name: = "Econolodge of SF"} >> >> >> =A0 =A0 =A0 =A0} >> >> >> } >> >> >> >> >> >> Are the CRUD Operations not referencing this correctly? >> >> >> >> >> >> >> >> >> >> >> >> -----Original Message----- >> >> >> From: Jonathan Shook [mailto:jshook@gmail.com] >> >> >> Sent: Friday, July 23, 2010 1:34 PM >> >> >> To: user@cassandra.apache.org >> >> >> Subject: Re: CRUD test >> >> >> >> >> >> There seem to be data consistency bugs in the test. =A0Are "name" = and >> >> >> "hotel" being used in a pair-wise way? >> >> >> Specifically, the first test is using creating one and checking fo= r >> >> >> the >> >> >> other. >> >> >> >> >> >> On Fri, Jul 23, 2010 at 2:46 PM, Oleg Tsvinev >> >> >> >> >> >> wrote: >> >> >>> Johathan, >> >> >>> I followed your suggestion. Unfortunately, CRUD test still does n= ot >> >> >>> work for me. Can you provide a simplest CRUD test possible that >> >> >>> works? >> >> >>> On Fri, Jul 23, 2010 at 10:59 AM, Jonathan Shook >> >> >>> wrote: >> >> >>>> >> >> >>>> I suspect that it is still your timestamps. >> >> >>>> You can verify this with a fake timestamp generator that is simp= ly >> >> >>>> incremented on each getTimestamp(). >> >> >>>> >> >> >>>> 1 millisecond is a long time for code that is wrapped tightly in= a >> >> >>>> test. You are likely using the same logical time stamp for >> >> >>>> multiple >> >> >>>> operations. >> >> >>>> >> >> >>>> >> >> >>>> On Thu, Jul 22, 2010 at 6:29 PM, Peter Minearo >> >> >>>> wrote: >> >> >>>> > I am able to reproduce his problem. If you take the default >> >> >>>> > storage-conf.xml file and utilize the "Super2" ColumnFamily wi= th >> >> >>>> > the code below. =A0You will see that the data is not getting >> >> >>>> > created >> >> >>>> > once you run the delete. =A0It seems to not allow you to creat= e >> >> >>>> > data >> >> >>>> > via Thrift. =A0HOWEVER, data can be created via the command li= ne >> >> >>>> > tool. >> >> >>>> > >> >> >>>> > import java.io.UnsupportedEncodingException; >> >> >>>> > import java.util.List; >> >> >>>> > >> >> >>>> > import org.apache.cassandra.thrift.Cassandra; >> >> >>>> > import org.apache.cassandra.thrift.Column; >> >> >>>> > import org.apache.cassandra.thrift.ColumnOrSuperColumn; >> >> >>>> > import org.apache.cassandra.thrift.ColumnParent; >> >> >>>> > import org.apache.cassandra.thrift.ColumnPath; >> >> >>>> > import org.apache.cassandra.thrift.ConsistencyLevel; >> >> >>>> > import org.apache.cassandra.thrift.InvalidRequestException; >> >> >>>> > import org.apache.cassandra.thrift.NotFoundException; >> >> >>>> > import org.apache.cassandra.thrift.SlicePredicate; >> >> >>>> > import org.apache.cassandra.thrift.SliceRange; >> >> >>>> > import org.apache.cassandra.thrift.SuperColumn; >> >> >>>> > import org.apache.cassandra.thrift.TimedOutException; >> >> >>>> > import org.apache.cassandra.thrift.UnavailableException; >> >> >>>> > import org.apache.thrift.TException; import >> >> >>>> > org.apache.thrift.protocol.TBinaryProtocol; >> >> >>>> > import org.apache.thrift.protocol.TProtocol; >> >> >>>> > import org.apache.thrift.transport.TSocket; >> >> >>>> > import org.apache.thrift.transport.TTransport; >> >> >>>> > >> >> >>>> > >> >> >>>> > public class CrudTest { >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private static final String KEYSPACE =3D "Keysp= ace1"; >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0public static void main(String[] args) { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CrudTest client =3D new CrudTes= t(); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0try { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.run(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} catch (Exception e) { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0e.printStackTra= ce(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0public void run() throws TException, >> >> >>>> > InvalidRequestException, UnavailableException, >> >> >>>> > UnsupportedEncodingException, NotFoundException, >> >> >>>> > TimedOutException >> >> >>>> > { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0TTransport tr =3D new TSocket("= localhost", 9160); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0TProtocol proto =3D new TBinary= Protocol(tr); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Cassandra.Client client =3D new >> >> >>>> > Cassandra.Client(proto); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tr.open(); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("******** CR= EATING DATA >> >> >>>> > *********"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0createData(client); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0getData(client); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("******** DE= LETING DATA >> >> >>>> > *********"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0deleteData(client); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0getData(client); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("******** CR= EATING DATA >> >> >>>> > *********"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0createData(client); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0getData(client); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tr.close(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private void createData(Cassandra.Client client= ) throws >> >> >>>> > InvalidRequestException, UnavailableException, >> >> >>>> > TimedOutException, >> >> >>>> > TException { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp1 =3D new ColumnPa= th("Super2"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp1.setSuper_column("hotel".get= Bytes()); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp1.setColumn("Best Western".ge= tBytes()); >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.insert(KEYSPACE, >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"name", >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp1, >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Best Weste= rn of SF".getBytes(), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.curr= entTimeMillis(), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Consistency= Level.ALL); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp2 =3D new ColumnPa= th("Super2"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp2.setSuper_column("hotel".get= Bytes()); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp2.setColumn("Econolodge".getB= ytes()); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.insert(KEYSPACE, >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0"name", >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0cp2, >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0"Econolodge of SF".getBytes(), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0System.currentTimeMillis(), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0ConsistencyLevel.ALL); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private void deleteData(Cassandra.Client client= ) throws >> >> >>>> > InvalidRequestException, UnavailableException, >> >> >>>> > TimedOutException, >> >> >>>> > TException { >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0client.remove(KEYSPACE, >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0"hotel", >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0new ColumnPath("Super2"), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0System.currentTimeMillis(), >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0ConsistencyLevel.ONE); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private void getData(Cassandra.Client client) t= hrows >> >> >>>> > InvalidRequestException, UnavailableException, >> >> >>>> > TimedOutException, >> >> >>>> > TException { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SliceRange sliceRange =3D new S= liceRange(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sliceRange.setStart(new byte[] = {}); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sliceRange.setFinish(new byte[]= {}); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SlicePredicate slicePredicate = =3D new >> >> >>>> > SlicePredicate(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0slicePredicate.setSlice_range(s= liceRange); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0getData(client, slicePredicate)= ; >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private void getData(Cassandra.Client client, >> >> >>>> > SlicePredicate >> >> >>>> > slicePredicate) throws InvalidRequestException, >> >> >>>> > UnavailableException, TimedOutException, TException { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0List coscL= ist =3D >> >> >>>> > client.get_slice(KEYSPACE, "hotel", new ColumnParent("Super2")= , >> >> >>>> > slicePredicate, ConsistencyLevel.ALL); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (coscList.isEmpty()) { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.prin= tln("Column Or Super >> >> >>>> > Column >> >> >>>> > is EMPTY"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (ColumnOrSuperColumn cosc: = coscList) { >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (cosc =3D=3D= null) { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0System.out.println("NULL RETURN >> >> >>>> > VALUE"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SuperColumn sup= erColumn =3D >> >> >>>> > cosc.getSuper_column(); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (superColumn= =3D=3D null) { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0System.out.println("Super Column >> >> >>>> > is >> >> >>>> > NULL"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0showSuperColumnInfo(superColumn); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0private void showSuperColumnInfo(SuperColumn su= perColumn) >> >> >>>> > { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("######## Su= per Columns >> >> >>>> > ###########"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Super Colum= n Name =3D " + new >> >> >>>> > String(superColumn.getName())); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0List columnList =3D >> >> >>>> > superColumn.getColumns(); >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("--------- S= tart Columns >> >> >>>> > -----------"); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (Column column: columnList)= { >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.prin= tln("Column Name =3D " + new >> >> >>>> > String(column.getName())); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.prin= tln("Column Value =3D " + >> >> >>>> > new >> >> >>>> > String(column.getValue())); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("--------- E= nd Columns >> >> >>>> > -----------"); >> >> >>>> > >> >> >>>> > System.out.println("##################################"); >> >> >>>> > =A0 =A0 =A0 =A0} >> >> >>>> > >> >> >>>> > >> >> >>>> > } >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> >>>> > -----Original Message----- >> >> >>>> > From: Oleg Tsvinev [mailto:oleg.tsvinev@gmail.com] >> >> >>>> > Sent: Thu 7/22/2010 1:56 PM >> >> >>>> > To: user@cassandra.apache.org >> >> >>>> > Subject: Re: CRUD test >> >> >>>> > >> >> >>>> > Yes, and that was the issue. But now after I delete a row from >> >> >>>> > cassandra-cli, I cannot insert anything back with my code. >> >> >>>> > Insert >> >> >>>> > code works does not throw any exceptions but when I read just >> >> >>>> > inserted columns I get NotFoundException at the last line: >> >> >>>> > >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0client =3D borrowClient(); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0Keyspace keyspace =3D client.getKeyspac= e(KEYSPACE, >> >> >>>> > CONSISTENCY_LEVEL); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp =3D new ColumnPath(applic= ation); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0cp.setSuper_column(uuid.getBytes()); >> >> >>>> > =A0 =A0 =A0 =A0 =A0 =A0SuperColumn sc =3D keyspace.getSuperCol= umn(category, >> >> >>>> > cp); >> >> >>>> > >> >> >>>> > It makes me think that once I remove supercolumn it cannot be >> >> >>>> > created again. >> >> >>>> > >> >> >>>> > >> >> >>>> > On Jul 22, 2010 1:13 AM, "Colin Vipurs" >> >> >>>> > wrote: >> >> >>>> > >> >> >>>> > Have you checked the timestamp you're using for the subsequent >> >> >>>> > inserts is higher than that used in the delete? >> >> >>>> > >> >> >>>> > >> >> >>>> > On Thu, Jul 22, 2010 at 2:29 AM, Oleg Tsvinev >> >> >>>> > >> >> >>>> > wrote: >> >> >>>> >> Hi there, >> >> >>>> >> I'm try... >> >> >>>> > -- >> >> >>>> > Maybe she awoke to see the roommate's boyfriend swinging from >> >> >>>> > the >> >> >>>> > chandelier wearing a boar's head. >> >> >>>> > >> >> >>>> > Something which you, I, and everyone else would call "Tuesday"= , >> >> >>>> > of >> >> >>>> > course. >> >> >>>> > >> >> >>>> > >> >> >>> >> >> >>> >> >> >> >> >> > >> >> > >> > >> > > >