Thanks Jonathan, it issue was due to some connectivity issues. Its working fine now.
I had one more question. Can we insert byte arrays as values for the columns ?. I am trying to store JPEG images. Thanks On Thu, Apr 9, 2009 at 2:38 PM, Jonathan Ellis <[email protected]> wrote: > So content:xml is your ColumnFamily:column tuple. That looks right. > > That exception is from the client side, right? That 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 <[email protected]> wrote: > > No, its not a supercolumn, how do I retrieve it if its not a supercolumn > ?. > > > > <Table Name = "xmls"> > > <ColumnFamily ColumnSort="Name" Name="content"/> > > </Table> > > > > I didn't notice it earlier, but yes, I am seeing the following exception > in > > the log > > > > Exception in thread "main" > > com.facebook.thrift.transport.TTransportException: Cannot write to null > > outputStream > > at com.facebook.thrift.transport.TIOStreamTransport.write(Unknown > > Source) > > at com.facebook.thrift.protocol.TBinaryProtocol.writeI32(Unknown > Source) > > > > Thanks > > > > On Thu, Apr 9, 2009 at 2:24 PM, Jonathan Ellis <[email protected]> > wrote: > >> > >> is content a supercolumn? otherwise specifying a subcolumn isn't going > to > >> work. > >> > >> did you check your log file for exceptions? > >> > >> On Thu, Apr 9, 2009 at 4:19 PM, Sam D <[email protected]> wrote: > >> > 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. > >> > > >> > socket = new TSocket(machine,port); > >> > TProtocol tp = new TBinaryProtocol(socket); > >> > cl = new Cassandra.Client(tp); > >> > socket.open(); > >> > column_t u1 = cl.get_column("xmls","x1","content:xml"); > >> > System.out.println("xml : " + u1.value); > >> > > >> > Sam. > >> > > >> > On Thu, Apr 9, 2009 at 2:07 PM, Jonathan Ellis <[email protected]> > >> > wrote: > >> >> > >> >> That looks reasonable. How are you reading the data back out? The > >> >> 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 <[email protected]> > 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. > >> >> > > >> >> > socket = new TSocket(machine,port); > >> >> > TProtocol tp = new TBinaryProtocol(socket); > >> >> > cl = new Cassandra.Client(tp); > >> >> > socket.open(); > >> >> > 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. > >> >> > > >> > > >> > > > > > >
