about insert benchmark

2010-09-02 Thread ChingShen
Hi all,

  I run a benchmark with my own code and found that the 10 inserts
performance is better than others, Why?
 Can anyone explain it?

Thanks.

Partitioner = OPP
CL = ONE
==
1000 records
insert one:201 ms
insert per:0.201 ms
insert thput:4975.1245 ops/sec
==
1 records
insert one:1950 ms
insert per:0.195 ms
insert thput:5128.205 ops/sec
==
10 records
insert one:15576 ms
insert per:0.15576 ms
insert thput:6420.134 ops/sec
==
50 records
insert one:82177 ms
insert per:0.164354 ms
insert thput:6084.4272 ops/sec

Shen


Re: about insert benchmark

2010-09-02 Thread ChingShen
Sorry, my Cassandra version is 0.6.4.


test

2010-08-19 Thread ChingShen
test


Can I retrieve specific key range from a table in RandomPartitioner?

2010-08-12 Thread ChingShen
Hi all,

   Can I retrieve specific key range from a table in RandomPartitioner?
Because I always got below exception:
Exception in thread main InvalidRequestException(why:start key's md5 sorts
after end key's md5.  this is not allowed; you probably should not specify
end key at all, under RandomPartitioner)

Thanks.

Shen


Re: Can I retrieve specific key range from a table in RandomPartitioner?

2010-08-12 Thread ChingShen
I have a key range that between 00 and 001000, and my code as
below:

SlicePredicate predicate = new SlicePredicate();
predicate.setColumn_names(columns);
ColumnParent parent = new ColumnParent(columnFamily);
KeyRange k = new KeyRange(1000);
k.setStart_key(key[0]);
k.setEnd_key(key[1000]);
ListKeySlice results = client.get_range_slices(keyspace, parent,
predicate, k, ConsistencyLevel.ONE);

On Thu, Aug 12, 2010 at 4:44 PM, ChingShen chingshenc...@gmail.com wrote:

 Hi all,

Can I retrieve specific key range from a table in RandomPartitioner?
 Because I always got below exception:
 Exception in thread main InvalidRequestException(why:start key's md5
 sorts after end key's md5.  this is not allowed; you probably should not
 specify end key at all, under RandomPartitioner)

 Thanks.

 Shen



Re: Unreliable transport layer

2010-07-29 Thread ChingShen
Why? What reasons did you choose TCP?

Shen

On Sat, Mar 6, 2010 at 9:15 AM, Jonathan Ellis jbel...@gmail.com wrote:

 In 0.6 gossip is over TCP.

 On Fri, Mar 5, 2010 at 6:54 PM, Ashwin Jayaprakash
 ashwin.jayaprak...@gmail.com wrote:
  Hey guys! I have a simple question. I'm a casual observer, not a real
  Cassandra user yet. So, excuse my ignorance.
 
  I see that the Gossip feature uses UDP. I was curious to know if you guys
  faced issues with unreliable transports in your production clusters? Like
  faulty switches, dropped packets etc during heavy network loads?
 
  If I'm not mistaken are all client reads/writes doing point-to-point over
  TCP?
 
  Thanks,
  Ashwin.
 
 
 



Re: How to get the 'system' keyspace info?

2010-07-20 Thread ChingShen
Thanks Jonathan Ellis,

I got an error message as below:
ERROR [pool-1-thread-1] 2010-07-21 08:51:46,582 Cassandra.java (line 1242)
Internal error processing get_slice
java.lang.RuntimeException:* No replica strategy configured for system*

Because the system keyspace is for Cassandra internals, so does it mean I
can't get the system keyspace info?

Thanks.

Shen


How to get the 'system' keyspace info?

2010-07-19 Thread ChingShen
cassandra get system.LocationInfo['L']
Exception Internal error processing get_slice

What's wrong?

Thanks.

Shen


Question about CL.ZERO

2010-07-11 Thread ChingShen
Hi all,

  Does it mean that the coordinator node always return success to the client
at CL.ZERO? But if the coordinator node sends a request to a given node
B(RF=1), then B is down, what happened? The coordinator node will write the
hint locally?

Thanks.

Shen


Re: UnavailableException on QUORUM write

2010-07-09 Thread ChingShen
Which client library do you use?

Shen

On Fri, Jul 9, 2010 at 4:53 PM, Per Olesen p...@trifork.com wrote:

 Hi,

 I am a bit confused about getting an UnavailableException when doing a
 QUORUM write.

 I have a 3 node cluster, with RF=3. When all 3 nodes are up, the QUORUM
 write succeeds. When 1 of the 3 nodes are down, the QUORUM write fails with
 UnavailableException. Shouldn't it be enough with 2 nodes up for RF=3? Won't
 N/2+1 be 2 in my case?

 /Per


How to add a new Keyspace?

2010-07-08 Thread ChingShen
Hi all,

  If I want to add a new Keyspace, does it mean I have to distribute my
storage-conf.xml to whole nodes? and restart whole nodes?

Shen


Question about hinted handoff

2010-07-08 Thread ChingShen
Hi all,

  Please consider this case: (RF=1, CL=ONE)

  1. I have A, B and C nodes.
  2. A node is a coordinator node, it sends a request to B node to do write
operation.
  3. B node is down during write operation, so return failure message to
client, and write a hint to C node.
  4. B node comes back up, then C node forwards the data to it.
  5. B node own data right now, although the write operation is failure.

  Correctly?

Thanks.

Shen


Gossip round time

2010-07-08 Thread ChingShen
Hi,

  I found the http://www.slideshare.net/adorepump/cassandra-nosql ppt, that
mentioned State disseminated in* O(logN)* rounds where N is the number of
nodes in the cluster.  about gossip on page 11. Is it wrong to draw on page
15? does it need round 4?

Thanks.

Shen


Re: Question about hinted handoff

2010-07-08 Thread ChingShen
So, am I correctly?

Shen

On Thu, Jul 8, 2010 at 5:33 PM, Anty anty@gmail.com wrote:

 Sorry I am wrong .Miss the CF=one.


 On Thu, Jul 8, 2010 at 5:27 PM, Anty anty@gmail.com wrote:



 On Thu, Jul 8, 2010 at 4:11 PM, ChingShen chingshenc...@gmail.comwrote:

 Hi all,

   Please consider this case: (RF=1, CL=ONE)

   1. I have A, B and C nodes.
   2. A node is a coordinator node, it sends a request to B node to do
 write operation.

 No ,will not choose B , write the data locally in Node A.
 if RF=2
 may choose C as hint  and replica node.

   3. B node is down during write operation, so return failure message to
 client, and write a hint to C node.
   4. B node comes back up, then C node forwards the data to it.
   5. B node own data right now, although the write operation is failure.

   Correctly?

 Thanks.

 Shen




 --
 Best Regards
 Anty Rao




 --
 Best Regards
 Anty Rao



Re: Question about hinted handoff

2010-07-08 Thread ChingShen
If so, when does hinted handoff work?

On Thu, Jul 8, 2010 at 9:55 PM, Anty anty@gmail.com wrote:



 On Thu, Jul 8, 2010 at 4:11 PM, ChingShen chingshenc...@gmail.com wrote:

 Hi all,

   Please consider this case: (RF=1, CL=ONE)

   1. I have A, B and C nodes.
   2. A node is a coordinator node, it sends a request to B node to do
 write operation.
   3. B node is down during write operation, so return failure message to
 client, and write a hint to C node.

 I think node A will return failure message to client.
 and will not write a hint to C node.


   4. B node comes back up, then C node forwards the data to it.
   5. B node own data right now, although the write operation is failure.

   Correctly?

 Thanks.

 Shen




 --
 Best Regards
 Anty Rao



Re: Some questions about the write operation and hinted handoff

2010-07-08 Thread ChingShen
Thanks Jonathan Ellis,

  I want to make sure that after A return failure message to client at
CL.ONE, *does A write a hint to C?* If so, although the write operation is
failed, but the data is still stored in C? if B comes back up, then C
forwards to B?

Shen

On Thu, Jul 8, 2010 at 10:08 PM, Jonathan Ellis jbel...@gmail.com wrote:

 On Thu, Jul 8, 2010 at 12:45 AM, ChingShen chingshenc...@gmail.com
 wrote:
  hmm... I'm really confused.
  The http://wiki.apache.org/cassandra/API document mentioned that if
 write
  ConsistencyLevel=ANY that Ensure the write has been written to at least
 1
  node, including hinted recipients., I couldn't imagine this case. :(
 
  If I have A,B,C and D nodes(RF=1), and write ConsistencyLevel=ANY, so A
  coordinator node sends a write request to another node(e.g. B node), but
 B
  node is down during write operation, what happend? return failure message
 to
  client immediately? or write a hint to another node(e.g. C node)

 It will write a hint and report success.

 But if you were writing at CL.ONE it would fail the write because a
 hinted write isn't readable until it can be forwarded to the right
 node (here, B).

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



Why is cassandra named cassandra?

2010-07-08 Thread ChingShen
Hi,

  Why is cassandra named cassandra?

Thanks.

Shen


Re: Some questions about the write operation and hinted handoff

2010-07-08 Thread ChingShen
On Fri, Jul 9, 2010 at 4:32 AM, Jonathan Ellis jbel...@gmail.com wrote:
 If the coordinator knows it can't achieve the requested CL it won't do
 any writes, hinted or otherwise, and will immediately report
 UnavailableException to the client.

 To summarize: hinted writes are only generated when Cassandra (a)
 knows a target is down ahead of time and (b) still has enough UP
 targets to satisfy the requested CL.

Ok, If so, I suppose that A sends requests to B, C and D nodes(RF=3) at *
CL.QUORUM*, but D is down, then return success message to the client, and* A
write a hint to E node*? until D comes back up then E forwards the data to
D?

Thanks.

Shen


Re: Which node is coordinator node?

2010-07-07 Thread ChingShen
Thanks aaron morton,

   I have an another question about replication. if I run a write operation
on A node and how does the replication work?  A node dispatches three
request to B, C and D nodes respectively to do write operation? or A node
dispatches a request to B node, then B node forwards it to C node, finally,
C node forwards it to D node?

Thanks.

Shen

On Tue, Jul 6, 2010 at 8:04 PM, aaron morton aa...@thelastpickle.comwrote:

 Which ever node the client connects to is the coordinator node. It will
 take care of sending the messages to the nodes who will do the actual work.

 If you have multiple nodes try a DNS round robin to distribute client
 connections around.
 Aaron
 On 6 Jul 2010, at 22:10, ChingShen wrote:

  Hi all,
 
I'm newbie in Cassandra, I have a question about which node is
 coordinator node in my cluster.
 
  I have A, B, C, D, E, F and G nodes. if I run a write operation on A
 node, and key range between A and B, so the A node is responsible to write
 the key to B, C and D nodes(RF=3) ? and does it mean A node is coordinator
 node?
 
  Thanks.
 
  Shen




System control messages rely on UDP?

2010-07-07 Thread ChingShen
Hi all,

   I found the Cassandra paper(in 5.7 section) that mentioned all system
control messages rely on UDP, but when I start up my cluster, I haven't see
any informations about UDP. Why?

TCP connections:
port 7000 = Gossip
port 9160 = Thrift service
port 8080 = JMX

Right?

Shen


Re: Some questions about the write operation and hinted handoff

2010-07-07 Thread ChingShen
So, does it mean that only the CL=ZERO and CL=ANY support hinted handoff,
right?

Thanks.

Shen

On Wed, Jul 7, 2010 at 11:28 PM, Jonathan Ellis jbel...@gmail.com wrote:

 does http://wiki.apache.org/cassandra/HintedHandoff help?

 On Wed, Jul 7, 2010 at 10:16 AM, ChingShen chingshenc...@gmail.com
 wrote:
  Thanks Jonathan Ellis,
 
If so, how does the hinted handoff work? I thought the coordinator node
  will write the data to another node(e.g. G node), I'm confused.
 
  Shen
 
 
   Second, if
   B node is down during the write operation, does it return
   failure(CL=ALL) to
   user?
 
  yes
 
  --
  Jonathan Ellis
  Project Chair, Apache Cassandra
  co-founder of Riptano, the source for professional Cassandra support
  http://riptano.com
 
 
 
 



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



Re: Some questions about the write operation and hinted handoff

2010-07-07 Thread ChingShen
hmm... I'm really confused.
The http://wiki.apache.org/cassandra/API document mentioned that if write
ConsistencyLevel=ANY that Ensure the write has been written to at least 1
node, including hinted recipients., I couldn't imagine this case. :(

If I have A,B,C and D nodes(RF=1), and write ConsistencyLevel=ANY, so A
coordinator node sends a write request to another node(e.g. B node), but B
node is down during write operation, what happend? return failure message to
client immediately? or write a hint to another node(e.g. C node) and return
success message to client? or could anyone can give me a real case?

Thanks.

Shen

On Thu, Jul 8, 2010 at 12:48 PM, Jonathan Ellis jbel...@gmail.com wrote:

 No, it means that HH writes don't count towards meeting the requested
 ConsistencyLevel.

 On Wed, Jul 7, 2010 at 9:36 PM, ChingShen chingshenc...@gmail.com wrote:
  So, does it mean that only the CL=ZERO and CL=ANY support hinted handoff,
  right?
 
  Thanks.
 
  Shen
 
  On Wed, Jul 7, 2010 at 11:28 PM, Jonathan Ellis jbel...@gmail.com
 wrote:
 
  does http://wiki.apache.org/cassandra/HintedHandoff help?
 
  On Wed, Jul 7, 2010 at 10:16 AM, ChingShen chingshenc...@gmail.com
  wrote:
   Thanks Jonathan Ellis,
  
 If so, how does the hinted handoff work? I thought the coordinator
   node
   will write the data to another node(e.g. G node), I'm confused.
  
   Shen
  
  
Second, if
B node is down during the write operation, does it return
failure(CL=ALL) to
user?
  
   yes
  
   --
   Jonathan Ellis
   Project Chair, Apache Cassandra
   co-founder of Riptano, the source for professional Cassandra support
   http://riptano.com
  
  
  
  
 
 
 
  --
  Jonathan Ellis
  Project Chair, Apache Cassandra
  co-founder of Riptano, the source for professional Cassandra support
  http://riptano.com
 
 
 



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



Which node is coordinator node?

2010-07-06 Thread ChingShen
Hi all,

  I'm newbie in Cassandra, I have a question about which node is coordinator
node in my cluster.

I have A, B, C, D, E, F and G nodes. if I run a write operation on A node,
and key range between A and B, so the A node is responsible to write the key
to B, C and D nodes(RF=3) ? and does it mean A node is coordinator node?

Thanks.

Shen


Some questions about the write operation and hinted handoff

2010-07-06 Thread ChingShen
Hi all,

  I have A, B, C, D, E, F and G nodes(RF=3), if I run a write
operation(CL=ALL) on A node(coordinator), and the key range between A and
B, therefore, the data will be stored on B, C and D nodes, right? Second, if
B node is down during the write operation, does it return failure(CL=ALL) to
user? or write the data to the another node(e.g. G node) until B comes back
up and G forwards the data to him?

Thanks.

Shen