You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by mcasandra <mo...@gmail.com> on 2011/02/19 02:02:39 UTC

Timeout

I have this below code and what I see is that when I run this below code
there is a timeout that occurs when I try to insert a column. But when I
comment out first 4 lines (drop to display) then it works without any
issues. I am trying to understand why. If required I can sleep and then
insert. Is it because it's getting insert too fast before Cassandra is able
to persist keyspace info accross nodes?




   	hUtil.dropKeyspace(c, KEYSPACE); //drop on the server
             hUtil.createKeyspace(c, KEYSPACE, CF_NAME); //Create on the
server
	hUtil.addColumn(c, KEYSPACE, CF_NAME); // Add on the server
	hUtil.display(c, KEYSPACE); //Display keyspace info

	ExampleDaoV2 ed = new ExampleDaoV2(createKeyspace(KEYSPACE, c));
	ed.insert("key1", "value2", StringSerializer.get());
	System.out.println(ed.get("key1", StringSerializer.get()));


Caused by: TimedOutException()
	at
org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:16493)
	at
org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:916)
	at
org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:890)
	at
me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:93)
	... 14 more

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Timeout-tp6042052p6042052.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Timeout

Posted by Aaron Morton <aa...@thelastpickle.com>.
Some of the schema operations wait to check agreement between the nodes before proceeding.

Are there any messages in your server side logs.

Aaron

On 19/02/2011, at 2:47 PM, mcasandra <mo...@gmail.com> wrote:

> 
> Forgot to mention replication factor is 1 and I am running Cassandra 0.7.0.
> It's using SimpleStrategy
> -- 
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Timeout-tp6042052p6042150.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Timeout

Posted by mcasandra <mo...@gmail.com>.
Forgot to mention replication factor is 1 and I am running Cassandra 0.7.0.
It's using SimpleStrategy
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Timeout-tp6042052p6042150.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Timeout

Posted by mcasandra <mo...@gmail.com>.
This is a test cluster of 3 nodes.

This is a test code that does the following:

1) First 4 lines physically drop, create keyspace and then creates CF and
column definition on the server
2) Right after from 5th line onwards it then gets the reference to keyspace
and tries to insert a row and columns.

First 4 lines are similiar to creating keyspace, CF definitions etc. on the
cassandra-cli.
Rest of the code is similar to setting/inserting values in column in
cassandra-cli.
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Timeout-tp6042052p6042147.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Timeout

Posted by Javier Canillas <ja...@gmail.com>.
Why don't you post some details about your Cassandra Cluster, version,
information about the keyspace you are creating (for example which is the
replication factor within)? It might be of help.

Besides, I don't fully understand your code. First you drop KEYSPACE, then
create it again with a column Family CF_NAME, then you add a Column to
CF_NAME's column definitions (Am I right?) and finally you display
KEYSPACE's information.

After that, you create your own structure by passing again another object.
What does actually do that method "createKeyspace()"?

If you can add more details, it might be of help.

On Fri, Feb 18, 2011 at 10:02 PM, mcasandra <mo...@gmail.com> wrote:

>
> I have this below code and what I see is that when I run this below code
> there is a timeout that occurs when I try to insert a column. But when I
> comment out first 4 lines (drop to display) then it works without any
> issues. I am trying to understand why. If required I can sleep and then
> insert. Is it because it's getting insert too fast before Cassandra is able
> to persist keyspace info accross nodes?
>
>
>
>
>        hUtil.dropKeyspace(c, KEYSPACE); //drop on the server
>             hUtil.createKeyspace(c, KEYSPACE, CF_NAME); //Create on the
> server
>        hUtil.addColumn(c, KEYSPACE, CF_NAME); // Add on the server
>        hUtil.display(c, KEYSPACE); //Display keyspace info
>
>        ExampleDaoV2 ed = new ExampleDaoV2(createKeyspace(KEYSPACE, c));
>        ed.insert("key1", "value2", StringSerializer.get());
>        System.out.println(ed.get("key1", StringSerializer.get()));
>
>
> Caused by: TimedOutException()
>        at
>
> org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:16493)
>        at
>
> org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:916)
>        at
>
> org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:890)
>        at
>
> me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:93)
>        ... 14 more
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Timeout-tp6042052p6042052.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
> Nabble.com.
>