You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2010/01/14 12:53:54 UTC

[jira] Created: (CASSANDRA-699) Add (optional) expiration time for column

Add (optional) expiration time for column 
------------------------------------------

                 Key: CASSANDRA-699
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
             Project: Cassandra
          Issue Type: New Feature
          Components: Core
            Reporter: Sylvain Lebresne


Allow to attach an expiration time to a column. 
An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802060#action_12802060 ] 

Jonathan Ellis commented on CASSANDRA-699:
------------------------------------------

reviewing

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802155#action_12802155 ] 

Sylvain Lebresne commented on CASSANDRA-699:
--------------------------------------------

Yes I agree that having type test all over the place is a bad thing. I'm not
sure it's really the fault of the addition of a new class though (especially
considering it's actually a subtype). It is more a sign that, as you say, the
code for Column exposes too much internals. 
There is two places where 'instanceof ExpiringColumn' is used: 
 1) In ColumnSerializer. We could consider that it's not really client code of
    Column. We also could add a serialize() method to Column directly if we
    really don't like instanceof. Btw, ColumnSerializer.serialize() assumes
    silently that its IColumn argument is actually a Column. Maybe we could
    add a comment at least ?
 2) In CassandraServer, when we convert a Column to a Thrift Column. It
    could make sense to add a toThriftColumn() method to Column (but it would
    create a dependency from Column to the thrift generated Column class).

My point being that the burden on client code that the ExpiringColumn of this
patch add is light and easily removable.  

That being said, if the timestamp refactoring you propose is done, I'm sure we
could use such design to include the TTL. 

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846939#action_12846939 ] 

Jonathan Ellis commented on CASSANDRA-699:
------------------------------------------

Would your use case be covered by adding a TTL to CF?  Because that seems like the natural level of granularity for this to me.

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch, add_expiring_column_0.6beta2.diff, modify_test_0.6beta2.diff, thrift_API_change_0.6beta2.diff
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Kelvin Kakugawa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800340#action_12800340 ] 

Kelvin Kakugawa commented on CASSANDRA-699:
-------------------------------------------

I think an interesting place to start would be to look at these interfaces:
IColumn
IColumnContainer

and, specifically, this method:
getMarkedForDeleteAt()

The implementing classes are:
Column
SuperColumn
ColumnFamily

as a start.

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801772#action_12801772 ] 

Sylvain Lebresne commented on CASSANDRA-699:
--------------------------------------------

Right now, if someone provide a ttl <=0, the code just do as if they had provided no ttl.
Not sure it's smart. Maybe it would be better to either
  * not check the ttl and let people deal with what happens
  * throw an InvalideRequestException

Any preferences ? 

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne reassigned CASSANDRA-699:
------------------------------------------

    Assignee: Sylvain Lebresne

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-699:
---------------------------------------

    Attachment:     (was: 0001-Add-new-ExpiringColumn-class.patch)

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847021#action_12847021 ] 

Sylvain Lebresne edited comment on CASSANDRA-699 at 3/18/10 5:46 PM:
---------------------------------------------------------------------

Well, I have one use case for which it would be hard to go without TTL. For
this one, I could almost go with a TTL to CF. It would be less convenient
tough, as I would need a few CF (not all the TTL for this use case are the
them) and thus would need to know the kind of TTL when I request which would
be a big complicated. So that would be better than nothing but not ideal.

Apart from that, I have multiple small places where I'm using or plan to use
TTL (all of this is still under development). For those, I again thinks that
to have TTL to column is more useful. An example I may use is the creation of 
temporary user account that will be deleted after a few day if not validated.
I'm sure there is other way to do it than TTL but it is convenient with it
(you read everything and write it back without TTL upon validation) and if you
have 2 CFs, one for your temporary user (not yet validated) and one for the
validated ones, it's a bit annoying for the requests again since you don't
know a priori which CF to query. More generally, I have informations (log of 
user activities, connection logs, ...), some of which I need to keep for some time 
for legal reason, that are just not useful anymore after 6 month, or after a year, 
2 years, .... Having a column family for each one of those infos is just not 
convenient.

So I guess my answer to your question is no, it would be covered, at least not
as naturally. And truthfully, it seems to me that expiring column is really
easy and efficient to do with Cassandra and virtually free for people that 
doesn't use them. That doesn't mean that having whole CF with a TTL would be 
a bad idea per se. 
But anyway I'm open to discussion and always curious of the opinion of others. 

      was (Author: slebresne):
    Would your use case be covered by adding a TTL to CF? Because that seems like
the natural level of granularity for this to me

Well, I have one use case for which it would be hard to go without TTL. For
this one, I could almost go with a TTL to CF. It would be less convenient
tough, as I would need a few CF (not all the TTL for this use case are the
them) and thus would need to know the kind of TTL when I request which would
be a big complicated. So that would be better than nothing but not ideal.

Apart from that, I have multiple small places where I'm using or plan to use
TTL (all of this is still under development). For those, I again thinks that
to have TTL to column is more useful. An example I may use is the creation of 
temporary user account that will be deleted after a few day if not validated.
I'm sure there is other way to do it than TTL but it is convenient with it
(you read everything and write it back without TTL upon validation) and if you
have 2 CFs, one for your temporary user (not yet validated) and one for the
validated ones, it's a bit annoying for the requests again since you don't
know a priori which CF to query. More generally, I have informations (log of 
user activities, connection logs, ...), some of which I need to keep for some time 
for legal reason, that are just not useful anymore after 6 month, or after a year, 
2 years, .... Having a column family for each one of those infos is just not 
convenient.

So I guess my answer to your question is no, it would be covered, at least not
as naturally. And truthfully, it seems to me that expiring column is really
easy and efficient to do with Cassandra and virtually free for people that 
doesn't use them. That doesn't mean that having whole CF with a TTL would be 
a bad idea per se. 
But anyway I'm open to discussion and always curious of the opinion of others. 
  
> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch, add_expiring_column_0.6beta2.diff, modify_test_0.6beta2.diff, thrift_API_change_0.6beta2.diff
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Kelvin Kakugawa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802464#action_12802464 ] 

Kelvin Kakugawa commented on CASSANDRA-699:
-------------------------------------------

Jaakko and I are working through a couple strategies, right now.  Sub-classing vs. a new Clock class to encapsulate "priority".

At the moment, we have a working (but, not completely tested) patch that sub-classes Column/SuperColumn.  However, timestamp/version really just encompasses one concept: priority.  So, we're trying to see if we can come up w/ a more concise patch that just abstracts out timestamp.

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-699:
-------------------------------------

    Fix Version/s: 0.7

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-699:
---------------------------------------

    Attachment: 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch
                0002-Add-TTL-support-to-cassandra.thrift.patch
                0001-Add-new-ExpiringColumn-class.patch

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Jaakko Laine (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802294#action_12802294 ] 

Jaakko Laine commented on CASSANDRA-699:
----------------------------------------

Sorry I was a bit careless with my wording. I was not blaming this patch in any way, just thinking perhaps now would be right time to consider timestamp refactoring to make it easier to add these new variants.


> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-699:
---------------------------------------

    Attachment: 0001-Add-new-ExpiringColumn-class-v2.patch

Just realize there was a bug in the previous patch introducting ExpiringColumn. 
This new patch just change a intSize -> boolSize in the serialiazed size of 
an ExpiringColumn. 

Jaako and Kelvin: if you come up with a patch that abstract the timestamp, 
I'll be happy to have a look and try to fit this patch into it.

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-699:
---------------------------------------

    Attachment: thrift_API_change_0.6beta2.diff
                modify_test_0.6beta2.diff
                add_expiring_column_0.6beta2.diff

I attach the same patch updated to work against 0.6beta2 for people that 
would want to test it (actually the current svn revision at the time of this 
message, which almost is 0.6beta3).

There is no avro support at all though (and it may very well break it actually). 

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch, add_expiring_column_0.6beta2.diff, modify_test_0.6beta2.diff, thrift_API_change_0.6beta2.diff
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847021#action_12847021 ] 

Sylvain Lebresne commented on CASSANDRA-699:
--------------------------------------------

Would your use case be covered by adding a TTL to CF? Because that seems like
the natural level of granularity for this to me

Well, I have one use case for which it would be hard to go without TTL. For
this one, I could almost go with a TTL to CF. It would be less convenient
tough, as I would need a few CF (not all the TTL for this use case are the
them) and thus would need to know the kind of TTL when I request which would
be a big complicated. So that would be better than nothing but not ideal.

Apart from that, I have multiple small places where I'm using or plan to use
TTL (all of this is still under development). For those, I again thinks that
to have TTL to column is more useful. An example I may use is the creation of 
temporary user account that will be deleted after a few day if not validated.
I'm sure there is other way to do it than TTL but it is convenient with it
(you read everything and write it back without TTL upon validation) and if you
have 2 CFs, one for your temporary user (not yet validated) and one for the
validated ones, it's a bit annoying for the requests again since you don't
know a priori which CF to query. More generally, I have informations (log of 
user activities, connection logs, ...), some of which I need to keep for some time 
for legal reason, that are just not useful anymore after 6 month, or after a year, 
2 years, .... Having a column family for each one of those infos is just not 
convenient.

So I guess my answer to your question is no, it would be covered, at least not
as naturally. And truthfully, it seems to me that expiring column is really
easy and efficient to do with Cassandra and virtually free for people that 
doesn't use them. That doesn't mean that having whole CF with a TTL would be 
a bad idea per se. 
But anyway I'm open to discussion and always curious of the opinion of others. 

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class-v2.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch, add_expiring_column_0.6beta2.diff, modify_test_0.6beta2.diff, thrift_API_change_0.6beta2.diff
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-699:
---------------------------------------

    Attachment: 0004-Update-test_server-for-insert-changes-and-add-simple.patch

I attach a bunch of patches. The first one, add a new ExpiringColumn class.
This new class extends Column and thus make use of the recent #706.  (It could
also be done without subclassing by adding a new interface (say ISimpleColumn)
that extends IColumn and be implemented by Column and ExpiringColumn. I've
ruled for subclassing for now to avoid code duplication but I had implemented
the interface solution at first, so I could go both ways).

Then there's the question of the API. I attach as a second patch what seems a
good option to me. Basically, it adds an optional ttl to Column and changes
insert() to take a ColumnParent and a Column. Just adding a new argument to
insert() doesn't work well as it cannot be made optional. That is, I believe
that if we want to just add a new argument to insert, the ttl field in Column
need to be required.

Third patch plugs the changes in thrift to the ExpiringColumn class. 
Fourth patch changes test_server.py to accommodate the change in insert(). I
also add a few (very) basic test for column with ttl. 

This obviously needs more testing but any comments/suggestions appreciated.

PS: The attached patches do not update the thrift generated code.

> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-699) Add (optional) expiration time for column

Posted by "Jaakko Laine (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802081#action_12802081 ] 

Jaakko Laine commented on CASSANDRA-699:
----------------------------------------

personally I'm not a big fan of adding another class for this purpose. If we add new types for all new features in this compartment, we'll very soon end up having our code littered with "if (foo instanceof This) do this, else if (foo instanceof That) do that, else if ..."

Current vector clock work (#580, full patch not yet in jira) includes two more column classes, which would mean the total amount of column types would be five. That will be a mess. With Kelvin we've recently talked about the possibility of refactoring timestamp "out of the view". That is, instead of exposing Column internals (timestamp), the API should have relevant methods the clients need (timestamp is mostly about priority, conflict resolution etc anyway), and then internally do-the-right-thing based on if the column is standard, expiring, vector, super or whatever.

Obviously this is a big refactoring as timestamp is so far spread and used, but having new type for every new need is going to get us into trouble sooner or later. Don't know if this would work, though, have not yet actually tried the refactoring.


> Add (optional) expiration time for column 
> ------------------------------------------
>
>                 Key: CASSANDRA-699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-699
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.7
>
>         Attachments: 0001-Add-new-ExpiringColumn-class.patch, 0002-Add-TTL-support-to-cassandra.thrift.patch, 0003-Plug-thrift-TTL-addition-to-ExpiringColumn.patch, 0004-Update-test_server-for-insert-changes-and-add-simple.patch
>
>
> Allow to attach an expiration time to a column. 
> An expired column would act much like a 'markedForDelete' one. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.