You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by DuyHai Doan <do...@gmail.com> on 2014/06/17 14:10:06 UTC

Questions about timestamp set at writetime

Hello all

 I know that at write time a timestamp is automatically generated by the
server and assigned to each column.

 My questions are:

1) Who is responsible for this micro-second timestamp ? The coordinator
which receives the insert request or each replica which actually do persist
the data ?

2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift API),
if no user defined timestamp is set, neither on the batch statement nor on
each individual statement, will C* generate a SAME timestamp for each
individual statement in the batch or will there distinct timestamps ?

Regards


 Duy Hai DOAN

Re: Questions about timestamp set at writetime

Posted by tommaso barbugli <tb...@gmail.com>.
thats going to be the timestamp for the data affected.
what I meant is that you cant have different timestamps (insert x timestamp
y; insert x' timestamp y')


2014-06-17 14:27 GMT+02:00 DuyHai Doan <do...@gmail.com>:

> "that is not possible to define different timestamps within a batch" -->
> It is possible :
> http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/batch_r.html
>
>
> On Tue, Jun 17, 2014 at 2:17 PM, tommaso barbugli <tb...@gmail.com>
> wrote:
>
>> when inserting with a batch every row have the same timestamp; I also
>> think (not 100%) that is not possible to define different timestamps within
>> a batch.
>>
>> Tommaso
>>
>>
>> 2014-06-17 14:10 GMT+02:00 DuyHai Doan <do...@gmail.com>:
>>
>> Hello all
>>>
>>>  I know that at write time a timestamp is automatically generated by the
>>> server and assigned to each column.
>>>
>>>  My questions are:
>>>
>>> 1) Who is responsible for this micro-second timestamp ? The coordinator
>>> which receives the insert request or each replica which actually do persist
>>> the data ?
>>>
>>> 2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift
>>> API), if no user defined timestamp is set, neither on the batch statement
>>> nor on each individual statement, will C* generate a SAME timestamp for
>>> each individual statement in the batch or will there distinct timestamps ?
>>>
>>> Regards
>>>
>>>
>>>  Duy Hai DOAN
>>>
>>
>>
>

Re: Questions about timestamp set at writetime

Posted by DuyHai Doan <do...@gmail.com>.
"that is not possible to define different timestamps within a batch" --> It
is possible :
http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/batch_r.html


On Tue, Jun 17, 2014 at 2:17 PM, tommaso barbugli <tb...@gmail.com>
wrote:

> when inserting with a batch every row have the same timestamp; I also
> think (not 100%) that is not possible to define different timestamps within
> a batch.
>
> Tommaso
>
>
> 2014-06-17 14:10 GMT+02:00 DuyHai Doan <do...@gmail.com>:
>
> Hello all
>>
>>  I know that at write time a timestamp is automatically generated by the
>> server and assigned to each column.
>>
>>  My questions are:
>>
>> 1) Who is responsible for this micro-second timestamp ? The coordinator
>> which receives the insert request or each replica which actually do persist
>> the data ?
>>
>> 2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift
>> API), if no user defined timestamp is set, neither on the batch statement
>> nor on each individual statement, will C* generate a SAME timestamp for
>> each individual statement in the batch or will there distinct timestamps ?
>>
>> Regards
>>
>>
>>  Duy Hai DOAN
>>
>
>

Re: Questions about timestamp set at writetime

Posted by tommaso barbugli <tb...@gmail.com>.
when inserting with a batch every row have the same timestamp; I also think
(not 100%) that is not possible to define different timestamps within a
batch.

Tommaso


2014-06-17 14:10 GMT+02:00 DuyHai Doan <do...@gmail.com>:

> Hello all
>
>  I know that at write time a timestamp is automatically generated by the
> server and assigned to each column.
>
>  My questions are:
>
> 1) Who is responsible for this micro-second timestamp ? The coordinator
> which receives the insert request or each replica which actually do persist
> the data ?
>
> 2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift
> API), if no user defined timestamp is set, neither on the batch statement
> nor on each individual statement, will C* generate a SAME timestamp for
> each individual statement in the batch or will there distinct timestamps ?
>
> Regards
>
>
>  Duy Hai DOAN
>

Re: Questions about timestamp set at writetime

Posted by DuyHai Doan <do...@gmail.com>.
Thank you Sylvain for the very clear explanations




On Tue, Jun 17, 2014 at 2:44 PM, Sylvain Lebresne <sy...@datastax.com>
wrote:

>
>
>> 1) Who is responsible for this micro-second timestamp ? The coordinator
>> which receives the insert request or each replica which actually do persist
>> the data ?
>>
>
> The coordinator.
>
>
>>
>> 2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift
>> API), if no user defined timestamp is set, neither on the batch statement
>> nor on each individual statement, will C* generate a SAME timestamp for
>> each individual statement in the batch or will there distinct timestamps ?
>>
>
> All the sub-statements will have the same timestamp.
>
> --
> Sylvain
>

Re: Questions about timestamp set at writetime

Posted by Sylvain Lebresne <sy...@datastax.com>.
>
> 1) Who is responsible for this micro-second timestamp ? The coordinator
> which receives the insert request or each replica which actually do persist
> the data ?
>

The coordinator.


>
> 2) In a case of a batch insert (CQL3 batch, not batch mutation Thrift
> API), if no user defined timestamp is set, neither on the batch statement
> nor on each individual statement, will C* generate a SAME timestamp for
> each individual statement in the batch or will there distinct timestamps ?
>

All the sub-statements will have the same timestamp.

--
Sylvain