[
https://issues.apache.org/jira/browse/CASSANDRA-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jignesh Dhruv updated CASSANDRA-1109:
-------------------------------------
Description:
Hello,
I downloaded latest cassandra source code from svn trunk. I wanted to test
expire data functionality. Using Thrift API, I set timeToLive parameter for
each fieldValue, however cassandra ignored it and did not expire any data.
I debugged cassandra's source code and found a bug in
src/java/org/apache/cassandra/db/RowMutation.java.
In RowMutation.addColumnOrSuperColumnToRowMutation() method, QueryPath was not
setting timeToLive argument. I updated RowMutation.java locally and tested it
and then my data expired after 'n' number of seconds.
I wanted to have this fix in the trunk also.
Index: src/java/org/apache/cassandra/db/RowMutation.java
===================================================================
--- src/java/org/apache/cassandra/db/RowMutation.java (revision 946222)
+++ src/java/org/apache/cassandra/db/RowMutation.java (working copy)
@@ -295,12 +295,12 @@
{
for (org.apache.cassandra.thrift.Column column :
cosc.super_column.columns)
{
- rm.add(new QueryPath(cfName, cosc.super_column.name,
column.name), column.value, column.timestamp);
+ rm.add(new QueryPath(cfName, cosc.super_column.name,
column.name), column.value, column.timestamp, column.ttl);
}
}
else
{
- rm.add(new QueryPath(cfName, null, cosc.column.name),
cosc.column.value, cosc.column.timestamp);
+ rm.add(new QueryPath(cfName, null, cosc.column.name),
cosc.column.value, cosc.column.timestamp, cosc.column.ttl);
}
}
Thanks,
Jignesh
was:
Hello,
I downloaded the latest cassandra code from svn trunk. I wanted to test the
expire data functionality. Using Thrift API, I set the timeToLive parameter for
each value, however cassandra ignored it and did not expire any data.
I debugged the source code and found a bug in
src/java/org/apache/cassandra/db/RowMutation.java.
In RowMutation.addColumnOrSuperColumnToRowMutation() method, QueryPath was not
setting the timeToLive argument. I updated the code locally and tested it and
then my data expired after 'n' number of seconds.
I wanted to have this fix in the trunk also.
Index: src/java/org/apache/cassandra/db/RowMutation.java
===================================================================
--- src/java/org/apache/cassandra/db/RowMutation.java (revision 946222)
+++ src/java/org/apache/cassandra/db/RowMutation.java (working copy)
@@ -295,12 +295,12 @@
{
for (org.apache.cassandra.thrift.Column column :
cosc.super_column.columns)
{
- rm.add(new QueryPath(cfName, cosc.super_column.name,
column.name), column.value, column.timestamp);
+ rm.add(new QueryPath(cfName, cosc.super_column.name,
column.name), column.value, column.timestamp, column.ttl);
}
}
else
{
- rm.add(new QueryPath(cfName, null, cosc.column.name),
cosc.column.value, cosc.column.timestamp);
+ rm.add(new QueryPath(cfName, null, cosc.column.name),
cosc.column.value, cosc.column.timestamp, cosc.column.ttl);
}
}
Thanks,
Jignesh
> Cassandra does not expire data after setting timeToLive argument for each
> value
> -------------------------------------------------------------------------------
>
> Key: CASSANDRA-1109
> URL: https://issues.apache.org/jira/browse/CASSANDRA-1109
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.6.1
> Reporter: Jignesh Dhruv
> Attachments: CASSANDRA-1109.patch
>
>
> Hello,
> I downloaded latest cassandra source code from svn trunk. I wanted to test
> expire data functionality. Using Thrift API, I set timeToLive parameter for
> each fieldValue, however cassandra ignored it and did not expire any data.
> I debugged cassandra's source code and found a bug in
> src/java/org/apache/cassandra/db/RowMutation.java.
> In RowMutation.addColumnOrSuperColumnToRowMutation() method, QueryPath was
> not setting timeToLive argument. I updated RowMutation.java locally and
> tested it and then my data expired after 'n' number of seconds.
> I wanted to have this fix in the trunk also.
> Index: src/java/org/apache/cassandra/db/RowMutation.java
> ===================================================================
> --- src/java/org/apache/cassandra/db/RowMutation.java (revision 946222)
> +++ src/java/org/apache/cassandra/db/RowMutation.java (working copy)
> @@ -295,12 +295,12 @@
> {
> for (org.apache.cassandra.thrift.Column column :
> cosc.super_column.columns)
> {
> - rm.add(new QueryPath(cfName, cosc.super_column.name,
> column.name), column.value, column.timestamp);
> + rm.add(new QueryPath(cfName, cosc.super_column.name,
> column.name), column.value, column.timestamp, column.ttl);
> }
> }
> else
> {
> - rm.add(new QueryPath(cfName, null, cosc.column.name),
> cosc.column.value, cosc.column.timestamp);
> + rm.add(new QueryPath(cfName, null, cosc.column.name),
> cosc.column.value, cosc.column.timestamp, cosc.column.ttl);
> }
> }
> Thanks,
> Jignesh
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.