[ 
https://issues.apache.org/jira/browse/CASSANDRA-2620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030861#comment-13030861
 ] 

Stu Hood commented on CASSANDRA-2620:
-------------------------------------

bq. Right now, if you need to know when a column c will expire, you'll compute 
c.timestamp + c.ttl. That code will break if you change the meaning of the ttl 
field.
Correct, but there is a _super_ easy alternative... if we return the delta TTL 
to the user instead, they can figure out when something will expire by adding 
the delta TTL to their local time. N seconds passed on the server, and most 
likely something around N seconds passed on the client.

IMO the implementation is wasteful, and the client API behavior isn't worth 
preserving.

> Don't persist TTL for expiring columns
> --------------------------------------
>
>                 Key: CASSANDRA-2620
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2620
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Stu Hood
>            Priority: Minor
>
> We persist both the TTL (5 seconds from now) and the localExpirationTime (the 
> local time at +5 seconds) for expiring columns, but the TTL is never used 
> again, except when we return expiring columns to clients.
> Rather than storing the TTL to return to clients, we could calculate a delta 
> TTL value by subtracting the current time from the localExpirationTime, and 
> save 4 bytes on disk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to