You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ali Akhtar <al...@gmail.com> on 2016/12/22 01:10:28 UTC

Not timing out some queries (Java driver)

I have some queries which need to be processed in a consistent manner. I'm
setting the consistently level = ALL option on these queries.

However, I've noticed that sometimes these queries fail because of a
timeout (2 seconds).

In my use case, for certain queries, I want them to never time out and
block until they have been acknowledged by all nodes.

Is that possible thru the Datastax Java driver, or another way?

Re: Not timing out some queries (Java driver)

Posted by Ali Akhtar <al...@gmail.com>.
The replication factor is the default - I haven't changed it. Would
tweaking it help?

On Thu, Dec 22, 2016 at 8:41 PM, Ali Akhtar <al...@gmail.com> wrote:

> Vladimir,
>
> I'm receiving a batch of messages which are out of order, and I need to
> process those messages in order.
>
> My solution is to write them to a cassandra table first, where they'll be
> ordered by their timestamp.
>
> Then read them back from that table, knowing that they'll be ordered.
>
> But for this to work, I need the data to be available immediately after I
> write it. For this, I think I need consistency = ALL.
>
> On Thu, Dec 22, 2016 at 8:29 PM, Vladimir Yudovin <vl...@winguzone.com>
> wrote:
>
>> What is replication factor? Why not use CONSISTENCY QUORUM? It's faster
>> and safe enough.
>>
>> Best regards, Vladimir Yudovin,
>> *Winguzone <https://winguzone.com?from=list> - Cloud Cassandra Hosting*
>>
>>
>> ---- On Thu, 22 Dec 2016 10:14:14 -0500 *Ali Akhtar
>> <ali.rac200@gmail.com <al...@gmail.com>>* wrote ----
>>
>> Is it possible to provide these options per query rather than set them
>> globally?
>>
>> On Thu, Dec 22, 2016 at 7:15 AM, Voytek Jarnot <vo...@gmail.com>
>> wrote:
>>
>> cassandra.yaml has various timeouts such as read_request_timeout,
>> range_request_timeout, write_request_timeout, etc.  The driver does as well
>> (via Cluster -> Configuration -> SocketOptions -> setReadTimeoutMillis).
>>
>> Not sure if you can (or would want to) set them to "forever", but it's a
>> starting point.
>>
>> On Wed, Dec 21, 2016 at 7:10 PM, Ali Akhtar <al...@gmail.com> wrote:
>>
>> I have some queries which need to be processed in a consistent manner.
>> I'm setting the consistently level = ALL option on these queries.
>>
>> However, I've noticed that sometimes these queries fail because of a
>> timeout (2 seconds).
>>
>> In my use case, for certain queries, I want them to never time out and
>> block until they have been acknowledged by all nodes.
>>
>> Is that possible thru the Datastax Java driver, or another way?
>>
>>
>>
>

Re: Not timing out some queries (Java driver)

Posted by Ali Akhtar <al...@gmail.com>.
Vladimir,

I'm receiving a batch of messages which are out of order, and I need to
process those messages in order.

My solution is to write them to a cassandra table first, where they'll be
ordered by their timestamp.

Then read them back from that table, knowing that they'll be ordered.

But for this to work, I need the data to be available immediately after I
write it. For this, I think I need consistency = ALL.

On Thu, Dec 22, 2016 at 8:29 PM, Vladimir Yudovin <vl...@winguzone.com>
wrote:

> What is replication factor? Why not use CONSISTENCY QUORUM? It's faster
> and safe enough.
>
> Best regards, Vladimir Yudovin,
> *Winguzone <https://winguzone.com?from=list> - Cloud Cassandra Hosting*
>
>
> ---- On Thu, 22 Dec 2016 10:14:14 -0500 *Ali Akhtar <ali.rac200@gmail.com
> <al...@gmail.com>>* wrote ----
>
> Is it possible to provide these options per query rather than set them
> globally?
>
> On Thu, Dec 22, 2016 at 7:15 AM, Voytek Jarnot <vo...@gmail.com>
> wrote:
>
> cassandra.yaml has various timeouts such as read_request_timeout,
> range_request_timeout, write_request_timeout, etc.  The driver does as well
> (via Cluster -> Configuration -> SocketOptions -> setReadTimeoutMillis).
>
> Not sure if you can (or would want to) set them to "forever", but it's a
> starting point.
>
> On Wed, Dec 21, 2016 at 7:10 PM, Ali Akhtar <al...@gmail.com> wrote:
>
> I have some queries which need to be processed in a consistent manner. I'm
> setting the consistently level = ALL option on these queries.
>
> However, I've noticed that sometimes these queries fail because of a
> timeout (2 seconds).
>
> In my use case, for certain queries, I want them to never time out and
> block until they have been acknowledged by all nodes.
>
> Is that possible thru the Datastax Java driver, or another way?
>
>
>

Re: Not timing out some queries (Java driver)

Posted by Vladimir Yudovin <vl...@winguzone.com>.
What is replication factor? Why not use CONSISTENCY QUORUM? It's faster and safe enough.



Best regards, Vladimir Yudovin, 

Winguzone - Cloud Cassandra Hosting






---- On Thu, 22 Dec 2016 10:14:14 -0500 Ali Akhtar &lt;ali.rac200@gmail.com&gt; wrote ----




Is it possible to provide these options per query rather than set them globally?



On Thu, Dec 22, 2016 at 7:15 AM, Voytek Jarnot &lt;voytek.jarnot@gmail.com&gt; wrote:

cassandra.yaml has various timeouts such as read_request_timeout, range_request_timeout, write_request_timeout, etc.  The driver does as well (via Cluster -&gt; Configuration -&gt; SocketOptions -&gt; setReadTimeoutMillis).



Not sure if you can (or would want to) set them to "forever", but it's a starting point.




On Wed, Dec 21, 2016 at 7:10 PM, Ali Akhtar &lt;ali.rac200@gmail.com&gt; wrote:

I have some queries which need to be processed in a consistent manner. I'm setting the consistently level = ALL option on these queries.



However, I've noticed that sometimes these queries fail because of a timeout (2 seconds).



In my use case, for certain queries, I want them to never time out and block until they have been acknowledged by all nodes.



Is that possible thru the Datastax Java driver, or another way?














Re: Not timing out some queries (Java driver)

Posted by Ali Akhtar <al...@gmail.com>.
Is it possible to provide these options per query rather than set them
globally?

On Thu, Dec 22, 2016 at 7:15 AM, Voytek Jarnot <vo...@gmail.com>
wrote:

> cassandra.yaml has various timeouts such as read_request_timeout,
> range_request_timeout, write_request_timeout, etc.  The driver does as well
> (via Cluster -> Configuration -> SocketOptions -> setReadTimeoutMillis).
>
> Not sure if you can (or would want to) set them to "forever", but it's a
> starting point.
>
> On Wed, Dec 21, 2016 at 7:10 PM, Ali Akhtar <al...@gmail.com> wrote:
>
>> I have some queries which need to be processed in a consistent manner.
>> I'm setting the consistently level = ALL option on these queries.
>>
>> However, I've noticed that sometimes these queries fail because of a
>> timeout (2 seconds).
>>
>> In my use case, for certain queries, I want them to never time out and
>> block until they have been acknowledged by all nodes.
>>
>> Is that possible thru the Datastax Java driver, or another way?
>>
>
>

Re: Not timing out some queries (Java driver)

Posted by Voytek Jarnot <vo...@gmail.com>.
cassandra.yaml has various timeouts such as read_request_timeout,
range_request_timeout, write_request_timeout, etc.  The driver does as well
(via Cluster -> Configuration -> SocketOptions -> setReadTimeoutMillis).

Not sure if you can (or would want to) set them to "forever", but it's a
starting point.

On Wed, Dec 21, 2016 at 7:10 PM, Ali Akhtar <al...@gmail.com> wrote:

> I have some queries which need to be processed in a consistent manner. I'm
> setting the consistently level = ALL option on these queries.
>
> However, I've noticed that sometimes these queries fail because of a
> timeout (2 seconds).
>
> In my use case, for certain queries, I want them to never time out and
> block until they have been acknowledged by all nodes.
>
> Is that possible thru the Datastax Java driver, or another way?
>