You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mubarak Seyed <mu...@gmail.com> on 2010/07/18 05:00:25 UTC

StorageProxy.mutate

I am trying to load data using contrib/client_only/ClientOnlyExample.java to
write mutations using
StorageProxy.mutate().

When i run the ClientOnlyExample.class with write option against single node
server, it prints as if key has written, and shutting down the message
service, i had to kill the JVM (as documented)

When i try to read data using same key values, i am getting

19:54:01,618 DEBUG DatabaseDescriptor:213 - Syncing log with a period of
10000
19:54:01,624  INFO DatabaseDescriptor:229 - Auto DiskAccessMode determined
to be mmap
19:54:01,772 DEBUG DatabaseDescriptor:401 - setting autoBootstrap to false
19:54:02,292 DEBUG StorageProxy:347 - weakreadremote reading
SliceByNamesReadCommand(table='Keyspace1', key='key0',
columnParent='QueryPath(columnFamilyName='Standard1',
superColumnName='null', columnName='null')', columns=[636f6c62,])
Exception in thread "main" java.lang.RuntimeException:
UnavailableException()
at ClientOnlyExample.testReading(ClientOnlyExample.java:118)
at ClientOnlyExample.main(ClientOnlyExample.java:156)
Caused by: UnavailableException()
at
org.apache.cassandra.service.StorageService.findSuitableEndPoint(StorageService.java:1203)
at
org.apache.cassandra.service.StorageProxy.weakReadRemote(StorageProxy.java:354)
at
org.apache.cassandra.service.StorageProxy.readProtocol(StorageProxy.java:409)
at ClientOnlyExample.testReading(ClientOnlyExample.java:102)
... 1 more

How can i make sure that StorageProxy.mutate(List<RowMutation>) works fine?

-- 
Thanks,
Mubarak Seyed.

Re: StorageProxy.mutate

Posted by Jonathan Ellis <jb...@gmail.com>.
On Sun, Jul 18, 2010 at 11:29 AM, Mubarak Seyed <mu...@gmail.com> wrote:
> Looks like ClientOnlyExample starts itself up as Read-Only node and hence
> can't write, is it true?

Yes, as the name implies.

> I tried starting node from
> bin/cassandra (it did with bind to Thrift Address 127.0.0.2:9160) but
> ClientOnlyExample errors out as
> BindException as port already in use.

Start them on different IPs.

> The README of word_count says about how-to create lo2 (127.0.0.2) with the
> ListenAddress and ThriftAddress.

Right.  Like that.

ClientOnlyExample is an example of using a fairly complex API that
ties into Cassandra internals very tightly.  It isn't as foolproof as
the Thrift API, and isn't intended to be.

This is why I tell most people who are struggling with binarymemtable,
"you should probably just be using Thrift."

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: StorageProxy.mutate

Posted by Mubarak Seyed <mu...@gmail.com>.
I was using single node and was running ClientOnlyExample from the same
machines, heard from word_count README that
i can use its storage-conf.xml to alias localhost to 127.0.0.2 and
ListenAddress can be 127.0.0.2 and seed can be 127.0.0.1.

Looks like ClientOnlyExample starts itself up as Read-Only node and hence
can't write, is it true? I tried starting node from
bin/cassandra (it did with bind to Thrift Address 127.0.0.2:9160) but
ClientOnlyExample errors out as

BindException as port already in use. Is there any documented procedure to
start the ClientOnlyExample as Read-Only node and write/read the data.
The README of word_count says about how-to create lo2 (127.0.0.2) with the
ListenAddress and ThriftAddress.

I tried with contrib/word_count/storage-conf.xml but no luck.

Can someone please help me running the ClientOnlyExample using ReadOnlyNode
and 127.0.0.2 alias?

Thanks,
Mubarak

On Sun, Jul 18, 2010 at 5:42 AM, Jonathan Ellis <jb...@gmail.com> wrote:

> UnavailableException means the node(s) with the requested data are
> down.  A sub-case of this is when no nodes at all are known, which may
> be what you are seeing.
>
> On Sat, Jul 17, 2010 at 10:00 PM, Mubarak Seyed <mu...@gmail.com>
> wrote:
> > I am trying to load data using contrib/client_only/ClientOnlyExample.java
> to
> > write mutations using
> > StorageProxy.mutate().
> > When i run the ClientOnlyExample.class with write option against single
> node
> > server, it prints as if key has written, and shutting down the message
> > service, i had to kill the JVM (as documented)
> > When i try to read data using same key values, i am getting
> > 19:54:01,618 DEBUG DatabaseDescriptor:213 - Syncing log with a period of
> > 10000
> > 19:54:01,624  INFO DatabaseDescriptor:229 - Auto DiskAccessMode
> determined
> > to be mmap
> > 19:54:01,772 DEBUG DatabaseDescriptor:401 - setting autoBootstrap to
> false
> > 19:54:02,292 DEBUG StorageProxy:347 - weakreadremote reading
> > SliceByNamesReadCommand(table='Keyspace1', key='key0',
> > columnParent='QueryPath(columnFamilyName='Standard1',
> > superColumnName='null', columnName='null')', columns=[636f6c62,])
> > Exception in thread "main" java.lang.RuntimeException:
> > UnavailableException()
> > at ClientOnlyExample.testReading(ClientOnlyExample.java:118)
> > at ClientOnlyExample.main(ClientOnlyExample.java:156)
> > Caused by: UnavailableException()
> > at
> >
> org.apache.cassandra.service.StorageService.findSuitableEndPoint(StorageService.java:1203)
> > at
> >
> org.apache.cassandra.service.StorageProxy.weakReadRemote(StorageProxy.java:354)
> > at
> >
> org.apache.cassandra.service.StorageProxy.readProtocol(StorageProxy.java:409)
> > at ClientOnlyExample.testReading(ClientOnlyExample.java:102)
> > ... 1 more
> > How can i make sure that StorageProxy.mutate(List<RowMutation>) works
> fine?
> > --
> > Thanks,
> > Mubarak Seyed.
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>



-- 
Thanks,
Mubarak Seyed.

Re: StorageProxy.mutate

Posted by Jonathan Ellis <jb...@gmail.com>.
UnavailableException means the node(s) with the requested data are
down.  A sub-case of this is when no nodes at all are known, which may
be what you are seeing.

On Sat, Jul 17, 2010 at 10:00 PM, Mubarak Seyed <mu...@gmail.com> wrote:
> I am trying to load data using contrib/client_only/ClientOnlyExample.java to
> write mutations using
> StorageProxy.mutate().
> When i run the ClientOnlyExample.class with write option against single node
> server, it prints as if key has written, and shutting down the message
> service, i had to kill the JVM (as documented)
> When i try to read data using same key values, i am getting
> 19:54:01,618 DEBUG DatabaseDescriptor:213 - Syncing log with a period of
> 10000
> 19:54:01,624  INFO DatabaseDescriptor:229 - Auto DiskAccessMode determined
> to be mmap
> 19:54:01,772 DEBUG DatabaseDescriptor:401 - setting autoBootstrap to false
> 19:54:02,292 DEBUG StorageProxy:347 - weakreadremote reading
> SliceByNamesReadCommand(table='Keyspace1', key='key0',
> columnParent='QueryPath(columnFamilyName='Standard1',
> superColumnName='null', columnName='null')', columns=[636f6c62,])
> Exception in thread "main" java.lang.RuntimeException:
> UnavailableException()
> at ClientOnlyExample.testReading(ClientOnlyExample.java:118)
> at ClientOnlyExample.main(ClientOnlyExample.java:156)
> Caused by: UnavailableException()
> at
> org.apache.cassandra.service.StorageService.findSuitableEndPoint(StorageService.java:1203)
> at
> org.apache.cassandra.service.StorageProxy.weakReadRemote(StorageProxy.java:354)
> at
> org.apache.cassandra.service.StorageProxy.readProtocol(StorageProxy.java:409)
> at ClientOnlyExample.testReading(ClientOnlyExample.java:102)
> ... 1 more
> How can i make sure that StorageProxy.mutate(List<RowMutation>) works fine?
> --
> Thanks,
> Mubarak Seyed.
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com