Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 24041 invoked from network); 23 Jul 2010 20:42:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Jul 2010 20:42:20 -0000 Received: (qmail 73083 invoked by uid 500); 23 Jul 2010 20:42:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 73009 invoked by uid 500); 23 Jul 2010 20:42:18 -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 73001 invoked by uid 99); 23 Jul 2010 20:42:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 20:42:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Peter.Minearo@reardencommerce.com designates 64.41.141.19 as permitted sender) Received: from [64.41.141.19] (HELO barracuda.mygazoo.com) (64.41.141.19) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 20:42:11 +0000 X-ASG-Debug-ID: 1279917709-53c3c2f50001-f7dORa Received: from sccorpmail01.mygazoo.com ([10.38.20.8]) by barracuda.mygazoo.com with ESMTP id FBgiaL75nVym696c for ; Fri, 23 Jul 2010 13:41:49 -0700 (PDT) X-Barracuda-Envelope-From: Peter.Minearo@Reardencommerce.com X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-ASG-Orig-Subj: RE: CRUD test Subject: RE: CRUD test Date: Fri, 23 Jul 2010 13:41:48 -0700 Message-ID: <5A4D71ACC2708E4BB1BD7B6F87E51C6B08428437@sccorpmail01.mygazoo.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CRUD test Thread-Index: Acsqpm45d3K2BtkoRCGy7fTenfai8QAAKUUg References: <5A4D71ACC2708E4BB1BD7B6F87E51C6B02B6D058@sccorpmail01.mygazoo.com> From: "Peter Minearo" To: X-Barracuda-Connect: UNKNOWN[10.38.20.8] X-Barracuda-Start-Time: 1279917709 X-Barracuda-URL: http://10.38.16.13:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at mygazoo.com X-Virus-Checked: Checked by ClamAV on apache.org The Model Should look like: Super2 =3D { hotel: { Best Western: {name: "Best Western of SF"} Econolodge: {name: "Econolodge of SF"} } } Are the CRUD Operations not referencing this correctly? -----Original Message----- From: Jonathan Shook [mailto:jshook@gmail.com]=20 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. Are "name" and = "hotel" being used in a pair-wise way? Specifically, the first test is using creating one and checking for the = other. On Fri, Jul 23, 2010 at 2:46 PM, Oleg Tsvinev = wrote: > Johathan, > I followed your suggestion. Unfortunately, CRUD test still does not=20 > 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 simply=20 >> incremented on each getTimestamp(). >> >> 1 millisecond is a long time for code that is wrapped tightly in a=20 >> test. You are likely using the same logical time stamp for multiple=20 >> operations. >> >> >> On Thu, Jul 22, 2010 at 6:29 PM, Peter Minearo=20 >> wrote: >> > I am able to reproduce his problem. If you take the default=20 >> > storage-conf.xml file and utilize the "Super2" ColumnFamily with=20 >> > the code below. =A0You will see that the data is not getting = created=20 >> > once you run the delete. =A0It seems to not allow you to create = data=20 >> > via Thrift. =A0HOWEVER, data can be created via the command line = 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=20 >> > 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 = "Keyspace1"; >> > >> > >> > =A0 =A0 =A0 =A0public static void main(String[] args) { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CrudTest client =3D new CrudTest(); >> > >> > =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.printStackTrace(); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> > >> > =A0 =A0 =A0 =A0} >> > >> > >> > =A0 =A0 =A0 =A0public void run() throws TException,=20 >> > InvalidRequestException, UnavailableException,=20 >> > UnsupportedEncodingException, NotFoundException, TimedOutException=20 >> > { >> > =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 = TBinaryProtocol(tr); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Cassandra.Client client =3D new=20 >> > Cassandra.Client(proto); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tr.open(); >> > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("******** = CREATING DATA=20 >> > *********"); >> > =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("******** = DELETING DATA=20 >> > *********"); >> > =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("******** = CREATING DATA=20 >> > *********"); >> > =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=20 >> > InvalidRequestException, UnavailableException, TimedOutException,=20 >> > TException { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp1 =3D new = ColumnPath("Super2"); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0cp1.setSuper_column("hotel".getBytes()); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cp1.setColumn("Best = Western".getBytes()); >> > >> > >> > =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 Western of = SF".getBytes(), >> > =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 = =A0ConsistencyLevel.ALL); >> > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp2 =3D new = ColumnPath("Super2"); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0cp2.setSuper_column("hotel".getBytes()); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0cp2.setColumn("Econolodge".getBytes()); >> > >> > =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=20 >> > InvalidRequestException, UnavailableException, TimedOutException,=20 >> > 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) throws = >> > InvalidRequestException, UnavailableException, TimedOutException,=20 >> > TException { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SliceRange sliceRange =3D new = SliceRange(); >> > =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=20 >> > SlicePredicate(); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0slicePredicate.setSlice_range(sliceRange); >> > >> > =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,=20 >> > UnavailableException, TimedOutException, TException { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0List coscList = =3D=20 >> > client.get_slice(KEYSPACE, "hotel", new ColumnParent("Super2"),=20 >> > 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.println("Column Or Super Column=20 >> > 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=20 >> > 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 = superColumn =3D=20 >> > 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=20 >> > 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 = superColumn) { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("######## Super = Columns=20 >> > ###########"); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("Super Column = Name =3D " + new=20 >> > 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("--------- Start = Columns=20 >> > -----------"); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (Column column: columnList) { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0System.out.println("Column Name =3D " + new=20 >> > String(column.getName())); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0System.out.println("Column Value =3D " + new=20 >> > String(column.getValue())); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println("--------- End = Columns=20 >> > -----------"); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> > 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=20 >> > cassandra-cli, I cannot insert anything back with my code. Insert=20 >> > code works does not throw any exceptions but when I read just=20 >> > 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.getKeyspace(KEYSPACE,=20 >> > CONSISTENCY_LEVEL); >> > =A0 =A0 =A0 =A0 =A0 =A0ColumnPath cp =3D new = ColumnPath(application); >> > =A0 =A0 =A0 =A0 =A0 =A0cp.setSuper_column(uuid.getBytes()); >> > =A0 =A0 =A0 =A0 =A0 =A0SuperColumn sc =3D = keyspace.getSuperColumn(category, cp); >> > >> > It makes me think that once I remove supercolumn it cannot be=20 >> > created again. >> > >> > >> > On Jul 22, 2010 1:13 AM, "Colin Vipurs" = wrote: >> > >> > Have you checked the timestamp you're using for the subsequent=20 >> > inserts is higher than that used in the delete? >> > >> > >> > On Thu, Jul 22, 2010 at 2:29 AM, Oleg Tsvinev=20 >> > >> > wrote: >> >> Hi there, >> >> I'm try... >> > -- >> > Maybe she awoke to see the roommate's boyfriend swinging from the=20 >> > chandelier wearing a boar's head. >> > >> > Something which you, I, and everyone else would call "Tuesday", of=20 >> > course. >> > >> > > >