From cassandra-user-return-26-apmail-incubator-cassandra-user-archive=incubator.apache.org@incubator.apache.org Fri Apr 10 01:26:17 2009 Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 47417 invoked from network); 10 Apr 2009 01:26:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Apr 2009 01:26:17 -0000 Received: (qmail 54668 invoked by uid 500); 10 Apr 2009 01:26:17 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 54630 invoked by uid 500); 10 Apr 2009 01:26:16 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 54621 invoked by uid 99); 10 Apr 2009 01:26:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2009 01:26:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.221.108 as permitted sender) Received: from [209.85.221.108] (HELO mail-qy0-f108.google.com) (209.85.221.108) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2009 01:26:10 +0000 Received: by qyk6 with SMTP id 6so1539952qyk.32 for ; Thu, 09 Apr 2009 18:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=janxW/9XuivIoruLDYWl1kwJs1Doo/79bJ9b6sumfeM=; b=p7ntFB+0jf4c2lpODqaXACkDzLh3t+F4h5D2611X+hKmO9sd4ECJT6GJxWJNy5fXeR PEnHtCOnch9RSCBtnSxQa7Fv7U/DC3jl7Z/qdMp3lSrSdtknbX9ilSHuPHaVOdwg0u7d DE/4NlQOCfDGxu5ymiqQJYpWar3JeclmIeomc= 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=Kzbv1hijEtNKtAoAz8V+MqCQyxcYz1l/L4Gzj3y7/AbnrGvmV7vQcSKAAMg90XfbIK LM+baG1UIET+qW5Gn5+G5OxbXWt0QMvNOpYfGD7Ev5pT82xyUGiuBtVwxI21B6Iy5aKE CtnMCTXBTZeikDNxRajsH34wwzHPA6SgorJkY= MIME-Version: 1.0 Received: by 10.229.89.146 with SMTP id e18mr1071743qcm.23.1239326749067; Thu, 09 Apr 2009 18:25:49 -0700 (PDT) In-Reply-To: <3317711b0904091740w8f61aaeif7320e8fc85cfe16@mail.gmail.com> References: <3317711b0904091402l6c5e998wf310cd3934982074@mail.gmail.com> <3317711b0904091419r37f83ad7y9f62f171ea3a5a9e@mail.gmail.com> <3317711b0904091431i2bedd99elab7039794fa70b46@mail.gmail.com> <3317711b0904091740w8f61aaeif7320e8fc85cfe16@mail.gmail.com> Date: Thu, 9 Apr 2009 20:25:49 -0500 Message-ID: Subject: Re: Sample Client Code From: Jonathan Ellis To: cassandra-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org For now you'll have to encode it somehow. We have a ticket (https://issues.apache.org/jira/browse/CASSANDRA-29) to switch to binary data as column values and that's high on my list to get done. -Jonathan On Thu, Apr 9, 2009 at 7:40 PM, Sam D wrote: > Thanks Jonathan, it issue was due to some connectivity issues.=A0 Its wor= king > fine now. > > I had one more question. > > Can we insert byte arrays as values for the columns ?. I am trying to sto= re > JPEG images. > > Thanks > > On Thu, Apr 9, 2009 at 2:38 PM, Jonathan Ellis wrote: >> >> So content:xml is your ColumnFamily:column tuple. =A0That looks right. >> >> That exception is from the client side, right? =A0That looks to me like >> it can't connect to the server. >> >> Your connection code looks okay... port should be the thrift port, >> 9160 if you haven't changed it. >> >> On Thu, Apr 9, 2009 at 4:31 PM, Sam D wrote: >> > No, its not a supercolumn, how do I retrieve it if its not a supercolu= mn >> > ?. >> > >> > =A0=A0=A0=A0 >> > =A0=A0=A0=A0=A0=A0 >> > =A0=A0=A0=A0
>> > >> > I didn't notice it earlier, but yes, I am seeing the following excepti= on >> > in >> > the log >> > >> > Exception in thread "main" >> > com.facebook.thrift.transport.TTransportException: Cannot write to nul= l >> > outputStream >> > =A0=A0=A0 at com.facebook.thrift.transport.TIOStreamTransport.write(Un= known >> > Source) >> > =A0=A0=A0 at com.facebook.thrift.protocol.TBinaryProtocol.writeI32(Unk= nown >> > Source) >> > >> > Thanks >> > >> > On Thu, Apr 9, 2009 at 2:24 PM, Jonathan Ellis >> > wrote: >> >> >> >> is content a supercolumn? =A0otherwise specifying a subcolumn isn't g= oing >> >> to >> >> work. >> >> >> >> did you check your log file for exceptions? >> >> >> >> On Thu, Apr 9, 2009 at 4:19 PM, Sam D wrot= e: >> >> > Thanks for the quick response, >> >> > >> >> > I have only one node. So the web client also should see the data, >> >> > right >> >> > ?. >> >> > Below is the code which I am using to read. >> >> > >> >> > =A0=A0 =A0=A0=A0 socket =3D new TSocket(machine,port); >> >> > =A0=A0=A0 =A0=A0=A0 TProtocol tp =3D new TBinaryProtocol(socket); >> >> > =A0=A0=A0 =A0=A0=A0 cl =3D new Cassandra.Client(tp); >> >> > =A0=A0=A0 =A0=A0=A0 socket.open(); >> >> > =A0=A0=A0=A0 =A0=A0 column_t u1 =3D cl.get_column("xmls","x1","cont= ent:xml"); >> >> > =A0=A0=A0 =A0=A0=A0 System.out.println("xml : " + u1.value); >> >> > >> >> > Sam. >> >> > >> >> > On Thu, Apr 9, 2009 at 2:07 PM, Jonathan Ellis >> >> > wrote: >> >> >> >> >> >> That looks reasonable. =A0How are you reading the data back out? = =A0The >> >> >> web interface only hits the local machine so it is not very useful >> >> >> in >> >> >> a clustered situation. >> >> >> >> >> >> -Jonathan >> >> >> >> >> >> On Thu, Apr 9, 2009 at 4:02 PM, Sam D >> >> >> wrote: >> >> >> > Hi, >> >> >> > >> >> >> > I am new to Cassandra, just installed the latest version on my >> >> >> > machine. >> >> >> > I >> >> >> > am able to insert rows using the web (@7002), but I am not able = to >> >> >> > get a >> >> >> > java client to insert rows into a table. Below the piece of code= I >> >> >> > am >> >> >> > using, >> >> >> > the insert call goes through fine without any exceptions, but I = am >> >> >> > not >> >> >> > able >> >> >> > to see the row in the table, so I assume its not being inserted >> >> >> > properly. >> >> >> > >> >> >> > =A0=A0=A0 =A0=A0=A0 socket =3D new TSocket(machine,port); >> >> >> > =A0=A0=A0 =A0=A0=A0 TProtocol tp =3D new TBinaryProtocol(socket)= ; >> >> >> > =A0=A0=A0 =A0=A0=A0 cl =3D new Cassandra.Client(tp); >> >> >> > =A0=A0=A0 =A0=A0=A0 socket.open(); >> >> >> > =A0=A0=A0 =A0=A0=A0 cl.insert("xmls", "x1", "content:xml", "xyz"= , 0); >> >> >> > >> >> >> > Can you please point me to any sample code available which I can >> >> >> > refer >> >> >> > to ?. >> >> >> > >> >> >> > Thanks >> >> >> > Sam. >> >> >> > >> >> > >> >> > >> > >> > > >