You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ajay <aj...@gmail.com> on 2014/12/26 10:05:57 UTC

Counter Column

Hi,

If the nodes of Cassandra ring are in different timezone, could it affect
the counter column as it depends on the timestamp?

Thanks
Ajay

Re: Counter Column

Posted by Eric Stevens <mi...@gmail.com>.
Having the client pass the timestamp is optional, if you do not provide one
from the client, then it will use the server's timestamp.

On Sat, Dec 27, 2014, 6:25 AM Phil Yang <ud...@gmail.com> wrote:

> sorry for typo.. timestamp which Cassandra uses is independent on the
> timezone.
>
> Usually, it is recommended to use NTP to reduce the difference of
> timestamps in each nodes
>
> 2014-12-27 21:20 GMT+08:00 Phil Yang <ud...@gmail.com>:
>
>> In java,
>> http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
>> return "the difference, measured in milliseconds, between the current time
>> and midnight, January 1, 1970 UTC." It means the timestamp which Cassandra
>> uses is not independent on the timezone.
>>
>> 2014-12-27 21:08 GMT+08:00 Ajay <aj...@gmail.com>:
>>
>>> Thanks.
>>>
>>> I went through some articles which mentioned that the client to pass the
>>> timestamp for insert and update. Is that anyway we can avoid it and
>>> Cassandra assume the current time of the server?
>>>
>>> Thanks
>>> Ajay
>>> On Dec 26, 2014 10:50 PM, "Eric Stevens" <mi...@gmail.com> wrote:
>>>
>>>> Timestamps are timezone independent.  This is a property of timestamps,
>>>> not a property of Cassandra. A given moment is the same timestamp
>>>> everywhere in the world.  To display this in a human readable form, you
>>>> then need to know what timezone you're attempting to represent the
>>>> timestamp as, this is the information necessary to convert it to local time.
>>>>
>>>> On Fri, Dec 26, 2014 at 2:05 AM, Ajay <aj...@gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> If the nodes of Cassandra ring are in different timezone, could it
>>>>> affect the counter column as it depends on the timestamp?
>>>>>
>>>>> Thanks
>>>>> Ajay
>>>>>
>>>>
>>
>>
>> --
>> Thanks,
>> Phil Yang
>>
>>
>
>
> --
> Thanks,
> Phil Yang
>
>

Re: Counter Column

Posted by Phil Yang <ud...@gmail.com>.
sorry for typo.. timestamp which Cassandra uses is independent on the
timezone.

Usually, it is recommended to use NTP to reduce the difference of
timestamps in each nodes

2014-12-27 21:20 GMT+08:00 Phil Yang <ud...@gmail.com>:

> In java,
> http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
> return "the difference, measured in milliseconds, between the current time
> and midnight, January 1, 1970 UTC." It means the timestamp which Cassandra
> uses is not independent on the timezone.
>
> 2014-12-27 21:08 GMT+08:00 Ajay <aj...@gmail.com>:
>
>> Thanks.
>>
>> I went through some articles which mentioned that the client to pass the
>> timestamp for insert and update. Is that anyway we can avoid it and
>> Cassandra assume the current time of the server?
>>
>> Thanks
>> Ajay
>> On Dec 26, 2014 10:50 PM, "Eric Stevens" <mi...@gmail.com> wrote:
>>
>>> Timestamps are timezone independent.  This is a property of timestamps,
>>> not a property of Cassandra. A given moment is the same timestamp
>>> everywhere in the world.  To display this in a human readable form, you
>>> then need to know what timezone you're attempting to represent the
>>> timestamp as, this is the information necessary to convert it to local time.
>>>
>>> On Fri, Dec 26, 2014 at 2:05 AM, Ajay <aj...@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> If the nodes of Cassandra ring are in different timezone, could it
>>>> affect the counter column as it depends on the timestamp?
>>>>
>>>> Thanks
>>>> Ajay
>>>>
>>>
>
>
> --
> Thanks,
> Phil Yang
>
>


-- 
Thanks,
Phil Yang

Re: Counter Column

Posted by Phil Yang <ud...@gmail.com>.
In java,
http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
return "the difference, measured in milliseconds, between the current time
and midnight, January 1, 1970 UTC." It means the timestamp which Cassandra
uses is not independent on the timezone.

2014-12-27 21:08 GMT+08:00 Ajay <aj...@gmail.com>:

> Thanks.
>
> I went through some articles which mentioned that the client to pass the
> timestamp for insert and update. Is that anyway we can avoid it and
> Cassandra assume the current time of the server?
>
> Thanks
> Ajay
> On Dec 26, 2014 10:50 PM, "Eric Stevens" <mi...@gmail.com> wrote:
>
>> Timestamps are timezone independent.  This is a property of timestamps,
>> not a property of Cassandra. A given moment is the same timestamp
>> everywhere in the world.  To display this in a human readable form, you
>> then need to know what timezone you're attempting to represent the
>> timestamp as, this is the information necessary to convert it to local time.
>>
>> On Fri, Dec 26, 2014 at 2:05 AM, Ajay <aj...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> If the nodes of Cassandra ring are in different timezone, could it
>>> affect the counter column as it depends on the timestamp?
>>>
>>> Thanks
>>> Ajay
>>>
>>


-- 
Thanks,
Phil Yang

Re: Counter Column

Posted by Ajay <aj...@gmail.com>.
Thanks.

I went through some articles which mentioned that the client to pass the
timestamp for insert and update. Is that anyway we can avoid it and
Cassandra assume the current time of the server?

Thanks
Ajay
On Dec 26, 2014 10:50 PM, "Eric Stevens" <mi...@gmail.com> wrote:

> Timestamps are timezone independent.  This is a property of timestamps,
> not a property of Cassandra. A given moment is the same timestamp
> everywhere in the world.  To display this in a human readable form, you
> then need to know what timezone you're attempting to represent the
> timestamp as, this is the information necessary to convert it to local time.
>
> On Fri, Dec 26, 2014 at 2:05 AM, Ajay <aj...@gmail.com> wrote:
>>
>> Hi,
>>
>> If the nodes of Cassandra ring are in different timezone, could it affect
>> the counter column as it depends on the timestamp?
>>
>> Thanks
>> Ajay
>>
>

Re: Counter Column

Posted by Eric Stevens <mi...@gmail.com>.
Timestamps are timezone independent.  This is a property of timestamps, not
a property of Cassandra. A given moment is the same timestamp everywhere in
the world.  To display this in a human readable form, you then need to know
what timezone you're attempting to represent the timestamp as, this is the
information necessary to convert it to local time.

On Fri, Dec 26, 2014 at 2:05 AM, Ajay <aj...@gmail.com> wrote:
>
> Hi,
>
> If the nodes of Cassandra ring are in different timezone, could it affect
> the counter column as it depends on the timestamp?
>
> Thanks
> Ajay
>