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

Kirk True commented on CASSANDRA-3974:
--------------------------------------

My understanding is that in order to reduce potential user confusion when 
updating the column family's default TTL, we need to keep the column family's 
default TTL value separate. That is, we probably *don't* want to make 
{{ExpiringColumn}}s for a column family that has a default TTL (using {{min(CF 
TTL, column TTL)}} as the TTL value). Instead, we keep the logic as is and keep 
the column family's default TTL value in {{CFMetaData}}.

That's all fine and good, but looking at the code I'm not quite sure as to when 
we'd check the column family default TTL. It would seem that we need to pass a 
{{CFMetaData}} instance in to {{Column}}'s {{isMarkedForDelete}} so that it can 
perform logic such as:

{noformat}
    public boolean isMarkedForDelete(CFMetaData metadata)
    {
        if (metadata.getDefaultTimeToLive() > 0)
        {
            // Check if we're using a CF-based TTL.
            return System.currentTimeMillis() >= (timestamp + 
(metadata.getDefaultTimeToLive() * 1000));
        }
        else
        {
            return (int) (System.currentTimeMillis() / 1000) >= 
getLocalDeletionTime();
        }
    }
{noformat}

Is this the correct line of thought? If so, that changes a couple of dozen call 
sites which makes me wonder if I'm doing something wrong :)
                
> Per-CF TTL
> ----------
>
>                 Key: CASSANDRA-3974
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3974
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Jonathan Ellis
>            Assignee: Kirk True
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: trunk-3974.txt
>
>
> Per-CF TTL would allow compaction optimizations ("drop an entire sstable's 
> worth of expired data") that we can't do with per-column.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to