Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Analia Lorenzatto
Yes Robert, I already cleared the snapshots.  After that, the used disk
space is:

10.x.x.b@$ df -h /mnt/cassandra
Filesystem  Size  Used Avail Use% Mounted on
/dev/xvdb1  745G  174G  572G  24% /mnt/cassandra

But, the cluster shows me a different thing:

$ nodetool status
Datacenter: us-east
===
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address Load   Tokens  Owns (effective)  Host ID
Rack
UN  10.x.x.a  420.74 GB  256 66.7%
eed9e9f5-f279-4b2f-b521-c056cbf65b52  1c
UN  10.x.x.b  416.42 GB  256 68.3%
19492c26-4458-4a0b-af04-72e0aab6598e  1c
UN  10.x.x.c  165.15 GB  256 64.9%
b8da952c-24b3-444a-a34e-7a1804eee6e6  1c

I do not understand why the cluster still sees even more data before adding
the third node.

Thanks a lot!!


On Fri, May 15, 2015 at 6:27 PM, Robert Wille  wrote:

>  Have you cleared snapshots?
>
>  On May 15, 2015, at 2:24 PM, Analia Lorenzatto <
> analialorenza...@gmail.com> wrote:
>
>  The Replication Factor = 2.  The RP is the default, but not sure how to
> check it.
> I am attaching the output of: nodetool ring
>
>  Thanks a lot!
>
> On Fri, May 15, 2015 at 4:17 PM, Kiran mk  wrote:
>
>> run cleanup on all the nodes and wait till it completes.
>> On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
>> wrote:
>>
>>> Hello guys,
>>>
>>>  I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
>>> successfully added the third node last week.  After that, I ran nodetool
>>> cleanup on one of the other two nodes, and it finished well but it
>>> increased the used disk space.
>>> Before running the clean up the node was 197 GB of used space, and after
>>> that it is 329GB used.  It is my understanding that the clean up frees up
>>> some space, but in this case it was highly increased.
>>>
>>>  I am running out of space, that's why I added a third node.  Do you
>>> have any clue on how to proceed with that situation?
>>>
>>>  Thanks in advance!!
>>>
>>>  --
>>>  Saludos / Regards.
>>>
>>>  Analía Lorenzatto.
>>>
>>> “It's possible to commit no errors and still lose. That is not
>>> weakness.  That is life".  By Captain Jean-Luc Picard.
>>>
>>
>
>
>  --
>  Saludos / Regards.
>
>  Analía Lorenzatto.
>
> “It's possible to commit no errors and still lose. That is not weakness.
> That is life".  By Captain Jean-Luc Picard.
>   
>
>
>


-- 
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.
That is life".  By Captain Jean-Luc Picard.


Re: Leap sec

2015-05-15 Thread Jim Witschey
> In addition, do I also have to upgrade to Java 7u60+ on C* servers as well.

Yes -- we observed C* nodes locking up when running under older
versions of the JDK.

Jim Witschey

Software Engineer in Test | jim.witsc...@datastax.com


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Robert Wille
Have you cleared snapshots?

On May 15, 2015, at 2:24 PM, Analia Lorenzatto 
mailto:analialorenza...@gmail.com>> wrote:

The Replication Factor = 2.  The RP is the default, but not sure how to check 
it.
I am attaching the output of: nodetool ring

Thanks a lot!

On Fri, May 15, 2015 at 4:17 PM, Kiran mk 
mailto:coolkiran2...@gmail.com>> wrote:

run cleanup on all the nodes and wait till it completes.

On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
mailto:analialorenza...@gmail.com>> wrote:
Hello guys,

I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I successfully 
added the third node last week.  After that, I ran nodetool cleanup on one of 
the other two nodes, and it finished well but it increased the used disk space.
Before running the clean up the node was 197 GB of used space, and after that 
it is 329GB used.  It is my understanding that the clean up frees up some 
space, but in this case it was highly increased.

I am running out of space, that's why I added a third node.  Do you have any 
clue on how to proceed with that situation?

Thanks in advance!!

--
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.  That 
is life".  By Captain Jean-Luc Picard.



--
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.  That 
is life".  By Captain Jean-Luc Picard.




Re: Leap sec

2015-05-15 Thread cass savy
Are you suggesting the JDK 7 for client/driver and c* side as well. We use
Java driver 2.1.4 and plan to goto JDK7u80 on application end. In addition,
do I also have to upgrade to Java 7u60+ on C* servers as well.

On Fri, May 15, 2015 at 1:06 PM, Jim Witschey 
wrote:

> > This post has some good advice for preparing for the leap second:
> > http://www.datastax.com/dev/blog/preparing-for-the-leap-second
>
> Post author here. Let me know if you have any questions about it.
>
> > What are the workaorund other than upgrading kernel to 3.4+?
>
> A couple NTP-based workarounds are described here, in the "Preventing
> Issues and Workarounds" section:
>
> https://access.redhat.com/articles/199563
>
> The goal of those workarounds is to prevent the leap second from being
> applied all at once. I make no guarantees about them, just pointing
> them out in case you wanted to investigate them yourself.
>
> As noted in my post and the Red Hat article, it's probably best to
> just upgrade your kernel/OS if you can.
>
> > Are you upgrading clusters to Java 7 or higher on client and C* servers?
>
> Just to be clear, JDK 7 had its own timer problems until 7u60, so you
> should upgrade to or past that version.
>
> Jim Witschey
>
> Software Engineer in Test | jim.witsc...@datastax.com
>


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Analia Lorenzatto
The Replication Factor = 2.  The RP is the default, but not sure how to
check it.
I am attaching the output of: nodetool ring

Thanks a lot!

On Fri, May 15, 2015 at 4:17 PM, Kiran mk  wrote:

> run cleanup on all the nodes and wait till it completes.
> On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
> wrote:
>
>> Hello guys,
>>
>> I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
>> successfully added the third node last week.  After that, I ran nodetool
>> cleanup on one of the other two nodes, and it finished well but it
>> increased the used disk space.
>> Before running the clean up the node was 197 GB of used space, and after
>> that it is 329GB used.  It is my understanding that the clean up frees up
>> some space, but in this case it was highly increased.
>>
>> I am running out of space, that's why I added a third node.  Do you have
>> any clue on how to proceed with that situation?
>>
>> Thanks in advance!!
>>
>> --
>> Saludos / Regards.
>>
>> Analía Lorenzatto.
>>
>> “It's possible to commit no errors and still lose. That is not weakness.
>> That is life".  By Captain Jean-Luc Picard.
>>
>


-- 
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.
That is life".  By Captain Jean-Luc Picard.


list
Description: Binary data


Re: Leap sec

2015-05-15 Thread Jim Witschey
> This post has some good advice for preparing for the leap second:
> http://www.datastax.com/dev/blog/preparing-for-the-leap-second

Post author here. Let me know if you have any questions about it.

> What are the workaorund other than upgrading kernel to 3.4+?

A couple NTP-based workarounds are described here, in the "Preventing
Issues and Workarounds" section:

https://access.redhat.com/articles/199563

The goal of those workarounds is to prevent the leap second from being
applied all at once. I make no guarantees about them, just pointing
them out in case you wanted to investigate them yourself.

As noted in my post and the Red Hat article, it's probably best to
just upgrade your kernel/OS if you can.

> Are you upgrading clusters to Java 7 or higher on client and C* servers?

Just to be clear, JDK 7 had its own timer problems until 7u60, so you
should upgrade to or past that version.

Jim Witschey

Software Engineer in Test | jim.witsc...@datastax.com


Re: Out of memory on wide row read

2015-05-15 Thread Alprema
I William file a jira for that, thanks
On May 12, 2015 10:15 PM, "Jack Krupansky"  wrote:

> Sounds like it's worth a Jira - Cassandra should protect itself from
> innocent mistakes or excessive requests from clients. Maybe there should be
> a timeout or result size (bytes in addition to count) limit. Something.
> Anything. But OOM seems a tad unfriendly for an innocent mistake. In this
> particular case, maybe Cassandra could detect the total row size/slice
> being read and error out on a configurable limiit.
>
> -- Jack Krupansky
>
> On Tue, May 12, 2015 at 1:57 PM, Robert Coli  wrote:
>
>> On Tue, May 12, 2015 at 8:43 AM, Kévin LOVATO 
>> wrote:
>>
>>> My question is the following: Is it possible to prevent Cassandra from
>>> OOM'ing when a client does this kind of requests? I'd rather have an error
>>> thrown to the client than a multi-server crash.
>>>
>>
>> You can provide a default LIMIT clause, but this is based on number of
>> results and not size.
>>
>> Other than that, there are not really great options.
>>
>> =Rob
>>
>>
>
>


Re: Leap sec

2015-05-15 Thread Tyler Hobbs
This post has some good advice for preparing for the leap second:
http://www.datastax.com/dev/blog/preparing-for-the-leap-second

On Fri, May 15, 2015 at 12:25 PM, cass savy  wrote:

> Just curious to know on how you are preparing Prod C* clusters for leap
> sec.
>
> What are the workaorund other than upgrading kernel to 3.4+?
> Are you upgrading clusters to Java 7 or higher on client and C* servers?
>
>



-- 
Tyler Hobbs
DataStax 


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Kiran mk
run cleanup on all the nodes and wait till it completes.
On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
wrote:

> Hello guys,
>
> I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I successfully
> added the third node last week.  After that, I ran nodetool cleanup on one
> of the other two nodes, and it finished well but it increased the used disk
> space.
> Before running the clean up the node was 197 GB of used space, and after
> that it is 329GB used.  It is my understanding that the clean up frees up
> some space, but in this case it was highly increased.
>
> I am running out of space, that's why I added a third node.  Do you have
> any clue on how to proceed with that situation?
>
> Thanks in advance!!
>
> --
> Saludos / Regards.
>
> Analía Lorenzatto.
>
> “It's possible to commit no errors and still lose. That is not weakness.
> That is life".  By Captain Jean-Luc Picard.
>


Re: Caching the PreparedStatement (Java driver)

2015-05-15 Thread Tyler Hobbs
On Fri, May 15, 2015 at 12:02 PM, Ajay  wrote:

>
> But I am also not sure of what happens when a cached prepared statement is
> executed after cassandra nodes restart. Does the server prepared statements
> cache is persisted or in memory?.


For now, it's just in memory, so they are lost when the node is restarted.


> If it is in memory, how do we handle stale prepared statement in the cache?


If a prepared statement ID is used that Cassandra doesn't recognize (e.g.
after a node restart), it responds with a specific error to the driver.
When the driver sees this error, it automatically re-prepares the statement
against that node using the statement info from its own cache.  After the
statement has been re-prepared, it attempts to execute the query again.
This all happens transparently, so your application will not even be aware
of it (aside from an increase in latency).

There are plans to persist prepared statements in a system table:
https://issues.apache.org/jira/browse/CASSANDRA-8831


-- 
Tyler Hobbs
DataStax 


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Analia Lorenzatto
The cluster is comprised of 3 nodes, with a RP=2:

# nodetool status Datacenter: us-east
===
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address Load   Tokens  Owns (effective)  Host ID
Rack
UN  10.x.x.a  420.05 GB  256 66.7%
eed9e9f5-f279-4b2f-b521-c056cbf65b52  1c
UN  10.x.x.b  415.68 GB  256 68.3%
19492c26-4458-4a0b-af04-72e0aab6598e  1c
UN  10.x.x.c  164.45 GB  256 64.9%
b8da952c-24b3-444a-a34e-7a1804eee6e6  1c

10.x.x.c is the last node added.

Thanks!

On Fri, May 15, 2015 at 4:02 PM, Kiran mk  wrote:

> What is the data distribution status across nodes ? What is the RP ?
> On May 16, 2015 12:30 AM, "Analia Lorenzatto" 
> wrote:
>
>> Thanks Kiran for answering!
>>
>> I already ran cleanup on just one node.  At this moment, I am running on
>> the second one, but it did not finish there.
>>
>>
>> On Fri, May 15, 2015 at 3:37 PM, Kiran mk 
>> wrote:
>>
>>> Did you try running nodetool cleanup on all the nodes ?
>>> On May 15, 2015 10:47 PM, "Analia Lorenzatto" <
>>> analialorenza...@gmail.com> wrote:
>>>
 Hello guys,

 I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
 successfully added the third node last week.  After that, I ran nodetool
 cleanup on one of the other two nodes, and it finished well but it
 increased the used disk space.
 Before running the clean up the node was 197 GB of used space, and
 after that it is 329GB used.  It is my understanding that the clean up
 frees up some space, but in this case it was highly increased.

 I am running out of space, that's why I added a third node.  Do you
 have any clue on how to proceed with that situation?

 Thanks in advance!!

 --
 Saludos / Regards.

 Analía Lorenzatto.

 “It's possible to commit no errors and still lose. That is not
 weakness.  That is life".  By Captain Jean-Luc Picard.

>>>
>>
>>
>> --
>> Saludos / Regards.
>>
>> Analía Lorenzatto.
>>
>> “It's possible to commit no errors and still lose. That is not weakness.
>> That is life".  By Captain Jean-Luc Picard.
>>
>


-- 
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.
That is life".  By Captain Jean-Luc Picard.


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Kiran mk
What is the Replication Factor ?  What does ring status saying ?
On May 16, 2015 12:32 AM, "Kiran mk"  wrote:

> What is the data distribution status across nodes ? What is the RP ?
> On May 16, 2015 12:30 AM, "Analia Lorenzatto" 
> wrote:
>
>> Thanks Kiran for answering!
>>
>> I already ran cleanup on just one node.  At this moment, I am running on
>> the second one, but it did not finish there.
>>
>>
>> On Fri, May 15, 2015 at 3:37 PM, Kiran mk 
>> wrote:
>>
>>> Did you try running nodetool cleanup on all the nodes ?
>>> On May 15, 2015 10:47 PM, "Analia Lorenzatto" <
>>> analialorenza...@gmail.com> wrote:
>>>
 Hello guys,

 I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
 successfully added the third node last week.  After that, I ran nodetool
 cleanup on one of the other two nodes, and it finished well but it
 increased the used disk space.
 Before running the clean up the node was 197 GB of used space, and
 after that it is 329GB used.  It is my understanding that the clean up
 frees up some space, but in this case it was highly increased.

 I am running out of space, that's why I added a third node.  Do you
 have any clue on how to proceed with that situation?

 Thanks in advance!!

 --
 Saludos / Regards.

 Analía Lorenzatto.

 “It's possible to commit no errors and still lose. That is not
 weakness.  That is life".  By Captain Jean-Luc Picard.

>>>
>>
>>
>> --
>> Saludos / Regards.
>>
>> Analía Lorenzatto.
>>
>> “It's possible to commit no errors and still lose. That is not weakness.
>> That is life".  By Captain Jean-Luc Picard.
>>
>


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Kiran mk
What is the data distribution status across nodes ? What is the RP ?
On May 16, 2015 12:30 AM, "Analia Lorenzatto" 
wrote:

> Thanks Kiran for answering!
>
> I already ran cleanup on just one node.  At this moment, I am running on
> the second one, but it did not finish there.
>
>
> On Fri, May 15, 2015 at 3:37 PM, Kiran mk  wrote:
>
>> Did you try running nodetool cleanup on all the nodes ?
>> On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
>> wrote:
>>
>>> Hello guys,
>>>
>>> I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
>>> successfully added the third node last week.  After that, I ran nodetool
>>> cleanup on one of the other two nodes, and it finished well but it
>>> increased the used disk space.
>>> Before running the clean up the node was 197 GB of used space, and after
>>> that it is 329GB used.  It is my understanding that the clean up frees up
>>> some space, but in this case it was highly increased.
>>>
>>> I am running out of space, that's why I added a third node.  Do you have
>>> any clue on how to proceed with that situation?
>>>
>>> Thanks in advance!!
>>>
>>> --
>>> Saludos / Regards.
>>>
>>> Analía Lorenzatto.
>>>
>>> “It's possible to commit no errors and still lose. That is not
>>> weakness.  That is life".  By Captain Jean-Luc Picard.
>>>
>>
>
>
> --
> Saludos / Regards.
>
> Analía Lorenzatto.
>
> “It's possible to commit no errors and still lose. That is not weakness.
> That is life".  By Captain Jean-Luc Picard.
>


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Analia Lorenzatto
Thanks Kiran for answering!

I already ran cleanup on just one node.  At this moment, I am running on
the second one, but it did not finish there.


On Fri, May 15, 2015 at 3:37 PM, Kiran mk  wrote:

> Did you try running nodetool cleanup on all the nodes ?
> On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
> wrote:
>
>> Hello guys,
>>
>> I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I
>> successfully added the third node last week.  After that, I ran nodetool
>> cleanup on one of the other two nodes, and it finished well but it
>> increased the used disk space.
>> Before running the clean up the node was 197 GB of used space, and after
>> that it is 329GB used.  It is my understanding that the clean up frees up
>> some space, but in this case it was highly increased.
>>
>> I am running out of space, that's why I added a third node.  Do you have
>> any clue on how to proceed with that situation?
>>
>> Thanks in advance!!
>>
>> --
>> Saludos / Regards.
>>
>> Analía Lorenzatto.
>>
>> “It's possible to commit no errors and still lose. That is not weakness.
>> That is life".  By Captain Jean-Luc Picard.
>>
>


-- 
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.
That is life".  By Captain Jean-Luc Picard.


RE: C*1.2 on JVM 1.7

2015-05-15 Thread SEAN_R_DURITY
I have run plenty of 1.2.x Cassandra versions on the Oracle JVM 1.7. I have 
used both 1.7.0_40 and 1.7.0_72 with no issues. Also have 3.2.7 DSE running on 
1.7.0_72 in PR with no issues.


Sean Durity – Cassandra Admin, Big Data Team
To engage the team, create a 
request

From: cass savy [mailto:casss...@gmail.com]
Sent: Friday, May 15, 2015 1:22 PM
To: user@cassandra.apache.org
Subject: C*1.2 on JVM 1.7



Has anybody run DSE 3.2.6(C*1.2.16) on JRE 1.7. I know its recommended that we 
have to get to JVM version 7 to get to C*2.0 and higher.

We are experiencing latency issues during rolling upgrade from 1.2 to 2.0. 
Hence cannot get o C*1.2, but plan to just upgrade JRE from 1.6 to 1.7. I 
wanted to know if anyof you have C*1.2 on JRE 1.7 in PROD and have run into 
issues.



The information in this Internet Email is confidential and may be legally 
privileged. It is intended solely for the addressee. Access to this Email by 
anyone else is unauthorized. If you are not the intended recipient, any 
disclosure, copying, distribution or any action taken or omitted to be taken in 
reliance on it, is prohibited and may be unlawful. When addressed to our 
clients any opinions or advice contained in this Email are subject to the terms 
and conditions expressed in any applicable governing The Home Depot terms of 
business or client engagement letter. The Home Depot disclaims all 
responsibility and liability for the accuracy and content of this attachment 
and for any damages or losses arising from any inaccuracies, errors, viruses, 
e.g., worms, trojan horses, etc., or other items of a destructive nature, which 
may be contained in this attachment and shall not be liable for direct, 
indirect, consequential or special damages in connection with this e-mail 
message or its attachment.


Re: After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Kiran mk
Did you try running nodetool cleanup on all the nodes ?
On May 15, 2015 10:47 PM, "Analia Lorenzatto" 
wrote:

> Hello guys,
>
> I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I successfully
> added the third node last week.  After that, I ran nodetool cleanup on one
> of the other two nodes, and it finished well but it increased the used disk
> space.
> Before running the clean up the node was 197 GB of used space, and after
> that it is 329GB used.  It is my understanding that the clean up frees up
> some space, but in this case it was highly increased.
>
> I am running out of space, that's why I added a third node.  Do you have
> any clue on how to proceed with that situation?
>
> Thanks in advance!!
>
> --
> Saludos / Regards.
>
> Analía Lorenzatto.
>
> “It's possible to commit no errors and still lose. That is not weakness.
> That is life".  By Captain Jean-Luc Picard.
>


Leap sec

2015-05-15 Thread cass savy
Just curious to know on how you are preparing Prod C* clusters for leap sec.

What are the workaorund other than upgrading kernel to 3.4+?
Are you upgrading clusters to Java 7 or higher on client and C* servers?


C*1.2 on JVM 1.7

2015-05-15 Thread cass savy
Has anybody run DSE 3.2.6(C*1.2.16) on JRE 1.7. I know its recommended that
we have to get to JVM version 7 to get to C*2.0 and higher.

We are experiencing latency issues during rolling upgrade from 1.2 to 2.0.
Hence cannot get o C*1.2, but plan to just upgrade JRE from 1.6 to 1.7. I
wanted to know if anyof you have C*1.2 on JRE 1.7 in PROD and have run into
issues.


After running nodetool clean up, the used disk space was increased

2015-05-15 Thread Analia Lorenzatto
Hello guys,

I have a cassandra cluster = 2.1.0-2 comprised of 3 nodes.  I successfully
added the third node last week.  After that, I ran nodetool cleanup on one
of the other two nodes, and it finished well but it increased the used disk
space.
Before running the clean up the node was 197 GB of used space, and after
that it is 329GB used.  It is my understanding that the clean up frees up
some space, but in this case it was highly increased.

I am running out of space, that's why I added a third node.  Do you have
any clue on how to proceed with that situation?

Thanks in advance!!

-- 
Saludos / Regards.

Analía Lorenzatto.

“It's possible to commit no errors and still lose. That is not weakness.
That is life".  By Captain Jean-Luc Picard.


Re: Caching the PreparedStatement (Java driver)

2015-05-15 Thread Ajay
Hi Joseph,

Java driver currently caches the prepared statements but using a weak
reference i.e the cache will hold it as long the client code uses it. So in
turn means that we need to cache the same.

But I am also not sure of what happens when a cached prepared statement is
executed after cassandra nodes restart. Does the server prepared statements
cache is persisted or in memory?. If it is in memory, how do we handle
stale prepared statement in the cache?

Thanks
Ajay


On Fri, May 15, 2015 at 6:28 PM, ja  wrote:

> Hi,
>
> Isn't it a good to have feature for the java driver to maintain a cache of
> PreparedStatements (PS) . Any reason why it's left to the application to do
> the same? . I am currently implementing a cache of PS that is loaded at app
> startup, but how do i ensure this cache is always good to use? . Say,
> there's a restart on the Cassandra server side, this cache would be stale
> and I assume the next use of a PS from cache would fail. Any way to recover
> from this.
>
> Thanks,
> Joseph
>
> On Sunday, March 1, 2015 at 12:46:14 AM UTC+5:30, Vishy Kasar wrote:
>>
>>
>> On Feb 28, 2015, at 4:25 AM, Ajay  wrote:
>>
>> Hi,
>>
>> My earlier question was whether it is safe to cache PreparedStatement
>> (using Java driver) in the client side for which I got it confirmed by
>> Olivier.
>>
>> Now the question is do we really need to cache the PreparedStatement in
>> the client side?.
>>
>> Lets take a scenario as below:
>>
>> 1) Client fires a REST query "SELECT * from Test where Pk = val1";
>> 2) REST service prepares a statement "SELECT * from Test where Pk = ?"
>> 3) Executes the PreparedStatement by setting the values.
>> 4) Assume we don't cache the PreparedStatement
>> 5) Client fires another REST query "SELECT * from Test where Pk = val2";
>> 6) REST service prepares a statement "SELECT * from Test where Pk = ?"
>> 7) Executes the PreparedStatement by setting the values.
>>
>>
>> You should avoid re-preparing the statement (step 6 above). When you
>> create a prepared statement, a round trip to server is involved. So you
>> should create it once and reuse it. You can bind it with different values
>> and execute the bound statement each time.
>>
>> In this case, is there any benefit of using the PreparedStatement?
>>
>> From the Java driver code, the Session.prepare(query) doesn't check
>> whether a similar query was prepared earlier or not. It directly call the
>> server passing the query. The return from the server is a PreparedId. Do
>> the server maintains a cache of Prepared queries or it still perform the
>> all the steps to prepare a query if the client calls to prepare the same
>> query more than once (using the same Session and Cluster instance which I
>> think doesn't matter)?.
>>
>> Thanks
>> Ajay
>>
>>
>> On Sat, Feb 28, 2015 at 9:17 AM, Ajay  wrote:
>>
>>> Thanks Olivier.
>>>
>>> Most of the REST query calls would come from other applications to
>>> write/read to/from Cassandra which means most queries from an application
>>> would be same (same column families but different  values).
>>>
>>> Thanks
>>> Ajay
>>> On 28-Feb-2015 6:05 am, "Olivier Michallat" 
>>> wrote:
>>>
 Hi Ajay,

 Yes, it is safe to hold a reference to PreparedStatement instances in
 your client code. If you always run the same pre-defined statements, you
 can store them as fields in your resource classes.

 If your statements are dynamically generated (for example, inserting
 different subsets of the columns depending on what was provided in the REST
 payload), your caching approach is valid. When you evict a
 PreparedStatement from your cache, the driver will also remove the
 corresponding id from its internal cache. If you re-prepare it later it
 might still be in the Cassandra-side cache, but that is not a problem.

 One caveat: you should be reasonably confident that your prepared
 statements will be reused. If your query strings are always different,
 preparing will bring no advantage.

 --
 Olivier Michallat
 Driver & tools engineer, DataStax

 On Fri, Feb 27, 2015 at 7:04 PM, Ajay  wrote:

> Hi,
>
> We are building REST APIs for Cassandra using the Cassandra Java
> Driver.
>
> So as per the below guidlines from the documentation, we are caching
> the Cluster instance (per cluster) and the Session instance (per keyspace)
> as they are multi thread safe.
>
> http://www.datastax.com/documentation/developer/java-driver/2.0/java-driver/fourSimpleRules.html
>
> As the Cluster and Session instance(s) are cached in the application
> already and also as the PreparedStatement provide better performance, we
> thought to build the PreparedStatement for REST query implicitly (as REST
> calls are stateless) and cache the PreparedStatemen. Whenever a REST query
> is invoked, we look for a PreparedStatement in the cache and create and 
> put
> it in 

Re: Clarification of property: storage_port

2015-05-15 Thread Nate McCall
On Fri, May 15, 2015 at 4:17 AM, Magnus Vojbacke <
magnus.vojba...@digitalroute.com> wrote:

>
> Why would I want to configure different storage_ports? Function test
> environment with multiple nodes on the same hostname.
>
>
You can still do this via multiple loopback addresses. If you have access
to python in the build environment, I would recommend delegating this this
the ccm utility:
https://github.com/pcmanus/ccm/

The Java Driver has an excellent example of this in the context of maven
integration testing:
https://github.com/datastax/java-driver/blob/2.1/driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

Readme with some details on such:
https://github.com/datastax/java-driver/tree/2.1/testing



-- 
-
Nate McCall
Austin, TX
@zznate

Co-Founder & Sr. Technical Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com


Re: Clarification of property: storage_port

2015-05-15 Thread Tyler Hobbs
On Fri, May 15, 2015 at 4:17 AM, Magnus Vojbacke <
magnus.vojba...@digitalroute.com> wrote:

>
> Function: What protocols and functions is storage_port used for? Am I
> right to believe that it is used for Gossip?
>

It's used for all internode communication (gossip, requests, etc).


>
> And more importantly: It seems to me that storage_port MUST be configured
> to be the same port for _all_ nodes in a cluster, is this correct?


That's correct.

-- 
Tyler Hobbs
DataStax 


ODBC connector, UDTs and Tableau

2015-05-15 Thread Ashic Mahtab
Hello,I'm playing with DataStax's ODBC connector for Cassandra and have noticed 
something...well...broken.
If I have a keyspace with tables that don't have a UDT column (even though the 
UDT is created), things work fine. However, the moment I add a table that has a 
UDT column, nothing works. I'm using Cassandra 2.1.5 with the latest version of 
Tableau. 
Has anybody else come across this issue? Is there a workaround?
Regards,Ashic.

Re: Java Client Driver for Cassandra 2.0.14

2015-05-15 Thread Artur Kronenberg
I started using the datastax driver (coming from astynax driver) 
recently. It is awesome! Use it :D


https://github.com/datastax/java-driver

Cheers,

artur

On 15/05/15 10:32, Rohit Naik wrote:

DISCLAIMER == This e-mail may contain privileged an




Java Client Driver for Cassandra 2.0.14

2015-05-15 Thread Rohit Naik
Apart from datastax java client driver, does Apache Cassandra provide its own 
java client driver? Or should be using the datastax one?
If yes, then could anyone give me the link?

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.



Clarification of property: storage_port

2015-05-15 Thread Magnus Vojbacke
I have questions regarding function and limitations of configurability of the 
property storage_port.

Function: What protocols and functions is storage_port used for? Am I right to 
believe that it is used for Gossip?

And more importantly: It seems to me that storage_port MUST be configured to be 
the same port for _all_ nodes in a cluster, is this correct? If not, can I 
configure it some how? I.e. can I configure node A to expect node B to use a 
specific storage_port? Or is this information propagated via Gossip? (Assuming 
that storage_port is not the gossip port itself)


Why would I want to configure different storage_ports? Function test 
environment with multiple nodes on the same hostname.

BR
/Magnus



Performance penalty of multiple UPDATEs of non-pk columns

2015-05-15 Thread Artur Siekielski
I've seen some discussions about the topic on the list recently, but I 
would like to get more clear answers.


Given the table:

CREATE TABLE t1 (
f1 text,
f2 text,
f3 text,
PRIMARY KEY(f1, f2)
);

and assuming I will execute UPDATE of f3 multiple times (say, 1000) for 
the same key values k1, k2 and different values of 'newval':


UPDATE t1 SET f3=newval WHERE f1=k1 AND f2=k2;

How will the performance of selecting the current 'f3' value be affected?:

SELECT f3 FROM t1 WHERE f1=k2 AND f2=k2;

It looks like all the previous values are preserved until compaction, 
but does executing the SELECT reads all the values (O(n), n - number of 
updates) or only the current one (O(1)) ?



How the situation looks for Counter types?