Ankit Shah | 27 Jul 00:47 2011
Picon

Setting up TTL with 10 seconds and the data is not expiring..

Hi All,

I am setting the TTL to be 10 seconds, but after 10 seconds that value is not being wiped out ??


I am setting TTL using hector API on the java side with the following code:

    /**
     * Insert a new value keyed by key
     *
     * <at> param key Key for the value
     * <at> param value the String value to insert
     */
    public void insertStringWithTTL(final String key, final String columnName, final String value, final int ttl) {
        createMutator(this.keyspace, this.serializer).insert(key, this.columnFamilyName, createColumn(columnName, value, this.serializer, this.serializer).setTtl(ttl));

    }


Here is my keyspace config file...


create keyspace DLService
    with replication_factor = 1
    and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';

use DLService;

create column family ThawteSeal
    with comparator = UTF8Type
    and default_validation_class = UTF8Type
    and column_metadata = [
    {column_name : type,validation_class : UTF8Type},
    {column_name : sealTimeStamp,validation_class : UTF8Type}
    ];


Thanks,
Ankit.

--
Thanks,
Ankit Shah
Cell: 559-307-8715

Patricio Echagüe | 27 Jul 18:07 2011
Picon

Re: Setting up TTL with 10 seconds and the data is not expiring..

do you read the value and it is still there?

how do you read it back?

hector version?

Sent from my Android

On Jul 26, 2011 3:47 PM, "Ankit Shah" <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi All,
>
> I am setting the TTL to be 10 seconds, but after 10 seconds that value is
> not being wiped out ??
>
>
> *I am setting TTL using hector API on the java side with the following code:
> *
>
> /**
> * Insert a new value keyed by key
> *
> * <at> param key Key for the value
> * <at> param value the String value to insert
> */
> public void insertStringWithTTL(final String key, final String
> columnName, final String value, final int ttl) {
> createMutator(this.keyspace, this.serializer).insert(key,
> this.columnFamilyName, createColumn(columnName, value, this.serializer,
> this.serializer).setTtl(ttl));
>
> }
>
> *
> Here is my keyspace config file...*
>
>
> create keyspace DLService
> with replication_factor = 1
> and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>
> use DLService;
>
> create column family ThawteSeal
> with comparator = UTF8Type
> and default_validation_class = UTF8Type
> and column_metadata = [
> {column_name : type,validation_class : UTF8Type},
> {column_name : sealTimeStamp,validation_class : UTF8Type}
> ];
>
>
> Thanks,
> Ankit.
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715
Ankit Shah | 27 Jul 19:21 2011
Picon

Re: Setting up TTL with 10 seconds and the data is not expiring..

Hi Patricio,

Thanks for your response, I made a stupid mistake in my spring bean ..

its all good now..

The only thing i wanted to ask is, since the TTL is for the column, i still see the rowkey with no columns ..

i did some reading and it says, the key will be gone after the tombstone ..is there any way to make GC happen more frequently and force the tombstone..

Thanks,

Ankit.

2011/7/27 Patricio Echagüe <patricioe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

do you read the value and it is still there?

how do you read it back?

hector version?

Sent from my Android

On Jul 26, 2011 3:47 PM, "Ankit Shah" <shahankit <at> gmail.com> wrote:
> Hi All,
>
> I am setting the TTL to be 10 seconds, but after 10 seconds that value is
> not being wiped out ??
>
>
> *I am setting TTL using hector API on the java side with the following code:
> *
>
> /**
> * Insert a new value keyed by key
> *
> * <at> param key Key for the value
> * <at> param value the String value to insert
> */
> public void insertStringWithTTL(final String key, final String
> columnName, final String value, final int ttl) {
> createMutator(this.keyspace, this.serializer).insert(key,
> this.columnFamilyName, createColumn(columnName, value, this.serializer,
> this.serializer).setTtl(ttl));
>
> }
>
> *
> Here is my keyspace config file...*
>
>
> create keyspace DLService
> with replication_factor = 1
> and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>
> use DLService;
>
> create column family ThawteSeal
> with comparator = UTF8Type
> and default_validation_class = UTF8Type
> and column_metadata = [
> {column_name : type,validation_class : UTF8Type},
> {column_name : sealTimeStamp,validation_class : UTF8Type}
> ];
>
>
> Thanks,
> Ankit.
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715



--
Thanks,
Ankit Shah
Cell: 559-307-8715
Patricio Echagüe | 27 Jul 19:45 2011
Picon

Re: Setting up TTL with 10 seconds and the data is not expiring..

a row with no columns is a tombstone. during compaction it will get wiped out.

Sent from my Android

On Jul 27, 2011 10:21 AM, "Ankit Shah" <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Patricio,
>
> Thanks for your response, I made a stupid mistake in my spring bean ..
>
> its all good now..
>
> The only thing i wanted to ask is, since the TTL is for the column, i still
> see the rowkey with no columns ..
>
> i did some reading and it says, the key will be gone after the tombstone
> ..is there any way to make GC happen more frequently and force the
> tombstone..
>
> Thanks,
>
> Ankit.
>
> 2011/7/27 Patricio Echagüe <patricioe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
>> do you read the value and it is still there?
>>
>> how do you read it back?
>>
>> hector version?
>>
>> Sent from my Android
>> On Jul 26, 2011 3:47 PM, "Ankit Shah" <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > Hi All,
>> >
>> > I am setting the TTL to be 10 seconds, but after 10 seconds that value is
>> > not being wiped out ??
>> >
>> >
>> > *I am setting TTL using hector API on the java side with the following
>> code:
>> > *
>> >
>> > /**
>> > * Insert a new value keyed by key
>> > *
>> > * <at> param key Key for the value
>> > * <at> param value the String value to insert
>> > */
>> > public void insertStringWithTTL(final String key, final String
>> > columnName, final String value, final int ttl) {
>> > createMutator(this.keyspace, this.serializer).insert(key,
>> > this.columnFamilyName, createColumn(columnName, value, this.serializer,
>> > this.serializer).setTtl(ttl));
>> >
>> > }
>> >
>> > *
>> > Here is my keyspace config file...*
>> >
>> >
>> > create keyspace DLService
>> > with replication_factor = 1
>> > and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>> >
>> > use DLService;
>> >
>> > create column family ThawteSeal
>> > with comparator = UTF8Type
>> > and default_validation_class = UTF8Type
>> > and column_metadata = [
>> > {column_name : type,validation_class : UTF8Type},
>> > {column_name : sealTimeStamp,validation_class : UTF8Type}
>> > ];
>> >
>> >
>> > Thanks,
>> > Ankit.
>> >
>> > --
>> > Thanks,
>> > Ankit Shah
>> > Cell: 559-307-8715
>>
>
>
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715
Ankit Shah | 29 Jul 03:30 2011
Picon

Re: Setting up TTL with 10 seconds and the data is not expiring..

Thanks Patricio..

2011/7/27 Patricio Echagüe <patricioe <at> gmail.com>

a row with no columns is a tombstone. during compaction it will get wiped out.

Sent from my Android

On Jul 27, 2011 10:21 AM, "Ankit Shah" <shahankit <at> gmail.com> wrote:
> Hi Patricio,
>
> Thanks for your response, I made a stupid mistake in my spring bean ..
>
> its all good now..
>
> The only thing i wanted to ask is, since the TTL is for the column, i still
> see the rowkey with no columns ..
>
> i did some reading and it says, the key will be gone after the tombstone
> ..is there any way to make GC happen more frequently and force the
> tombstone..
>
> Thanks,
>
> Ankit.
>
> 2011/7/27 Patricio Echagüe <patricioe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
>> do you read the value and it is still there?
>>
>> how do you read it back?
>>
>> hector version?
>>
>> Sent from my Android
>> On Jul 26, 2011 3:47 PM, "Ankit Shah" <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > Hi All,
>> >
>> > I am setting the TTL to be 10 seconds, but after 10 seconds that value is
>> > not being wiped out ??
>> >
>> >
>> > *I am setting TTL using hector API on the java side with the following
>> code:
>> > *
>> >
>> > /**
>> > * Insert a new value keyed by key
>> > *
>> > * <at> param key Key for the value
>> > * <at> param value the String value to insert
>> > */
>> > public void insertStringWithTTL(final String key, final String
>> > columnName, final String value, final int ttl) {
>> > createMutator(this.keyspace, this.serializer).insert(key,
>> > this.columnFamilyName, createColumn(columnName, value, this.serializer,
>> > this.serializer).setTtl(ttl));
>> >
>> > }
>> >
>> > *
>> > Here is my keyspace config file...*
>> >
>> >
>> > create keyspace DLService
>> > with replication_factor = 1
>> > and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>> >
>> > use DLService;
>> >
>> > create column family ThawteSeal
>> > with comparator = UTF8Type
>> > and default_validation_class = UTF8Type
>> > and column_metadata = [
>> > {column_name : type,validation_class : UTF8Type},
>> > {column_name : sealTimeStamp,validation_class : UTF8Type}
>> > ];
>> >
>> >
>> > Thanks,
>> > Ankit.
>> >
>> > --
>> > Thanks,
>> > Ankit Shah
>> > Cell: 559-307-8715
>>
>
>
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715



--
Thanks,
Ankit Shah
Cell: 559-307-8715

Gmane