Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 98998 invoked from network); 23 Jul 2010 19:47:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Jul 2010 19:47:17 -0000 Received: (qmail 94437 invoked by uid 500); 23 Jul 2010 19:47:15 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 94198 invoked by uid 500); 23 Jul 2010 19:47:14 -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 94186 invoked by uid 99); 23 Jul 2010 19:47:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 19:47:14 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of oleg.tsvinev@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 19:47:09 +0000 Received: by gwaa18 with SMTP id a18so943056gwa.31 for ; Fri, 23 Jul 2010 12:46:48 -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; bh=A8s1vHHDprKJf3/RrRfqLDF38E+9wShh/JUm1TIvKY4=; b=Z76YCW4V1UzfieeR8Jh+olC0bPG3D9NZyEPtQ0yBFW2roDUu1NBHndezzh9thqIjgd AMUVyI/LjhtXwIoyTUvAHLfZDIFccuUjZKfuFyv6yrM8rO8bj4hMzm4+IrueAsQ9zwq9 wYDmFgGY3yF8EirWElciycb9j7+NcWQ3BozuQ= 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; b=OW7YseeH42ECEZruOZrp2YC1gljGNMrkLqzZeHZhOJc5pnIewRseCAFWCpQAAmhUO8 QVCgl53IhZ9thHQmAGWa6aezQg75iFhhpzyC3PyLMARUEgMzC4YJarEe/V0ITzSl3Lfh VBKlXXg1EIs2fuVtz5LWdi2LyEoCEe7WlRNlc= MIME-Version: 1.0 Received: by 10.90.93.15 with SMTP id q15mr1511793agb.144.1279914400551; Fri, 23 Jul 2010 12:46:40 -0700 (PDT) Received: by 10.90.174.2 with HTTP; Fri, 23 Jul 2010 12:46:40 -0700 (PDT) In-Reply-To: References: <5A4D71ACC2708E4BB1BD7B6F87E51C6B02B6D058@sccorpmail01.mygazoo.com> Date: Fri, 23 Jul 2010 12:46:40 -0700 Message-ID: Subject: Re: CRUD test From: Oleg Tsvinev To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00163630f627301350048c134b4d --00163630f627301350048c134b4d Content-Type: text/plain; charset=UTF-8 Johathan, I followed your suggestion. Unfortunately, CRUD test still does not 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 > 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 with the code > below. You will see that the data is not getting created once you run the > delete. It seems to not allow you to create data via Thrift. HOWEVER, 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 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 { > > > > > > private static final String KEYSPACE = "Keyspace1"; > > > > > > public static void main(String[] args) { > > CrudTest client = new CrudTest(); > > > > try { > > client.run(); > > } catch (Exception e) { > > e.printStackTrace(); > > } > > > > } > > > > > > public void run() throws TException, InvalidRequestException, > UnavailableException, UnsupportedEncodingException, NotFoundException, > TimedOutException { > > TTransport tr = new TSocket("localhost", 9160); > > TProtocol proto = new TBinaryProtocol(tr); > > Cassandra.Client client = new Cassandra.Client(proto); > > tr.open(); > > > > System.out.println("******** CREATING DATA *********"); > > createData(client); > > getData(client); > > System.out.println(); > > System.out.println("******** DELETING DATA *********"); > > deleteData(client); > > getData(client); > > System.out.println(); > > System.out.println("******** CREATING DATA *********"); > > createData(client); > > getData(client); > > > > tr.close(); > > } > > > > > > private void createData(Cassandra.Client client) throws > InvalidRequestException, UnavailableException, TimedOutException, TException > { > > ColumnPath cp1 = 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); > > > > ColumnPath cp2 = new ColumnPath("Super2"); > > cp2.setSuper_column("hotel".getBytes()); > > cp2.setColumn("Econolodge".getBytes()); > > > > client.insert(KEYSPACE, > > "name", > > cp2, > > "Econolodge of SF".getBytes(), > > System.currentTimeMillis(), > > ConsistencyLevel.ALL); > > > > } > > > > > > private void deleteData(Cassandra.Client client) throws > InvalidRequestException, UnavailableException, TimedOutException, TException > { > > > > client.remove(KEYSPACE, > > "hotel", > > new ColumnPath("Super2"), > > System.currentTimeMillis(), > > ConsistencyLevel.ONE); > > > > } > > > > > > private void getData(Cassandra.Client client) throws > InvalidRequestException, UnavailableException, TimedOutException, TException > { > > SliceRange sliceRange = new SliceRange(); > > sliceRange.setStart(new byte[] {}); > > sliceRange.setFinish(new byte[] {}); > > > > SlicePredicate slicePredicate = new SlicePredicate(); > > slicePredicate.setSlice_range(sliceRange); > > > > getData(client, slicePredicate); > > } > > > > > > private void getData(Cassandra.Client client, SlicePredicate > slicePredicate) throws InvalidRequestException, UnavailableException, > TimedOutException, TException { > > List coscList = > client.get_slice(KEYSPACE, "hotel", new ColumnParent("Super2"), > slicePredicate, ConsistencyLevel.ALL); > > > > if (coscList.isEmpty()) { > > System.out.println("Column Or Super Column is > EMPTY"); > > } > > > > for (ColumnOrSuperColumn cosc: coscList) { > > > > if (cosc == null) { > > System.out.println("NULL RETURN VALUE"); > > } > > > > SuperColumn superColumn = cosc.getSuper_column(); > > > > if (superColumn == null) { > > System.out.println("Super Column is > NULL"); > > } > > else { > > showSuperColumnInfo(superColumn); > > } > > > > } > > > > } > > > > > > private void showSuperColumnInfo(SuperColumn superColumn) { > > System.out.println("######## Super Columns ###########"); > > System.out.println("Super Column Name = " + new > String(superColumn.getName())); > > List columnList = superColumn.getColumns(); > > > > System.out.println("--------- Start Columns -----------"); > > for (Column column: columnList) { > > System.out.println("Column Name = " + new > String(column.getName())); > > System.out.println("Column Value = " + new > String(column.getValue())); > > } > > System.out.println("--------- End Columns -----------"); > > System.out.println("##################################"); > > } > > > > > > } > > > > > > > > > > -----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: > > > > client = borrowClient(); > > Keyspace keyspace = client.getKeyspace(KEYSPACE, > > CONSISTENCY_LEVEL); > > ColumnPath cp = new ColumnPath(application); > > cp.setSuper_column(uuid.getBytes()); > > SuperColumn sc = keyspace.getSuperColumn(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. > > > > > --00163630f627301350048c134b4d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Johathan,

I followed your suggestion. Unfortunately, CRU= D test still does not work for me. Can you provide a simplest CRUD test pos= sible that works?

On Fr= i, Jul 23, 2010 at 10:59 AM, Jonathan Shook <jshook@gmail.com> wrote:
I suspect that it is still your timestamps.=
You can verify this with a fake timestamp generator that is simply
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
<Peter.Minearo@rear= dencommerce.com> wrote:
> I am able to reproduce his problem. If you take the default storage-co= nf.xml file and utilize the "Super2" ColumnFamily with the code b= elow. =C2=A0You will see that the data is not getting created once you run = the delete. =C2=A0It seems to not allow you to create data via Thrift. =C2= =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 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 {
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private static final String KEYSPACE =3D &q= uot;Keyspace1";
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0public static void main(String[] args) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CrudTest client= =3D new CrudTest();
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0try {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0client.run();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} catch (Except= ion e) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0e.printStackTrace();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0public void run() throws TException, Invali= dRequestException, UnavailableException, UnsupportedEncodingException, NotF= oundException, TimedOutException {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TTransport tr = =3D new TSocket("localhost", 9160);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TProtocol proto= =3D new TBinaryProtocol(tr);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Cassandra.Clien= t client =3D new Cassandra.Client(proto);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tr.open();
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("******** CREATING DATA *********");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0createData(clie= nt);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0getData(client)= ;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("******** DELETING DATA *********");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0deleteData(clie= nt);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0getData(client)= ;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("******** CREATING DATA *********");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0createData(clie= nt);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0getData(client)= ;
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tr.close();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private void createData(Cassandra.Client cl= ient) throws InvalidRequestException, UnavailableException, TimedOutExcepti= on, TException {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ColumnPath cp1 = =3D new ColumnPath("Super2");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp1.setSuper_co= lumn("hotel".getBytes());
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp1.setColumn(&= quot;Best Western".getBytes());
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0client.insert(K= EYSPACE,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0"name",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0cp1,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0"Best Western of SF".getBytes(),
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0System.currentTimeMillis(),
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0ConsistencyLevel.ALL);
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ColumnPath cp2 = =3D new ColumnPath("Super2");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp2.setSuper_co= lumn("hotel".getBytes());
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp2.setColumn(&= quot;Econolodge".getBytes());
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0client.insert(K= EYSPACE,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"name",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp2,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"Econolodge of SF"= ;.getBytes(),
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.currentTimeMillis(),=
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ConsistencyLevel.ALL);
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private void deleteData(Cassandra.Client cl= ient) throws InvalidRequestException, UnavailableException, TimedOutExcepti= on, TException {
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0client.remove(K= EYSPACE,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"hotel",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new ColumnPath("Super2= "),
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.currentTimeMillis(),=
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ConsistencyLevel.ONE);
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private void getData(Cassandra.Client clien= t) throws InvalidRequestException, UnavailableException, TimedOutException,= TException {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SliceRange slic= eRange =3D new SliceRange();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sliceRange.setS= tart(new byte[] {});
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sliceRange.setF= inish(new byte[] {});
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SlicePredicate = slicePredicate =3D new SlicePredicate();
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0slicePredicate.= setSlice_range(sliceRange);
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0getData(client,= slicePredicate);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private void getData(Cassandra.Client clien= t, SlicePredicate slicePredicate) throws InvalidRequestException, Unavailab= leException, TimedOutException, TException {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<ColumnO= rSuperColumn> coscList =3D client.get_slice(KEYSPACE, "hotel",= new ColumnParent("Super2"), slicePredicate, ConsistencyLevel.ALL= );
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (coscList.is= Empty()) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0System.out.println("Column Or Super Column is EMPTY"= );
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (ColumnOrSu= perColumn cosc: coscList) {
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0if (cosc =3D=3D null) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.println("NULL RETU= RN VALUE");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0SuperColumn superColumn =3D cosc.getSuper_column();
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0if (superColumn =3D=3D null) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.println("Super Col= umn is NULL");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0}
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0else {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0showSuperColumnInfo(superColumn);<= br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0private void showSuperColumnInfo(SuperColum= n superColumn) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("######## Super Columns ###########");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("Super Column Name =3D " + new String(superColumn.getName()))= ;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<Column&= gt; columnList =3D superColumn.getColumns();
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("--------- Start Columns -----------");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (Column col= umn: columnList) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0System.out.println("Column Name =3D " + new String(c= olumn.getName()));
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0System.out.println("Column Value =3D " + new String(= column.getValue()));
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("--------- End Columns -----------");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln("##################################");
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>
> }
>
>
>
>
> -----Original Message-----
> From: Oleg Tsvinev [mailto:o= leg.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:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0client =3D borrowClient(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Keyspace keyspace =3D client.= getKeyspace(KEYSPACE,
> CONSISTENCY_LEVEL);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ColumnPath cp =3D new ColumnP= ath(application);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp.setSuper_column(uuid.getBy= tes());
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SuperColumn sc =3D keyspace.g= etSuperColumn(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" <zodiaczx6@gmail.com> wrote:
>
> Have you checked the timestamp you're using for the subsequent ins= erts
> is higher than that used in the delete?
>
>
> On Thu, Jul 22, 2010 at 2:29 AM, Oleg Tsvinev <oleg.tsvinev@gmail.com>
> wrote:
>> Hi there,
>> I'm try...
> --
> Maybe she awoke to see the roommate's boyfriend swinging from the<= br> > chandelier wearing a boar's head.
>
> Something which you, I, and everyone else would call "Tuesday&quo= t;, of course.
>
>

--00163630f627301350048c134b4d--