Oleg Tsvinev | 24 Apr 22:37 2011
Picon

Expiring Columns - how to set TTL?

It's been a while since 0.7 was announced that introduced expiring columns.
I can't find a Hector API to set the TTL value. I know there's a
Thrift way but using Thrift directly from Hector is discouraged.
Does anyone has experience setting the TTL?

Oleg Tsvinev | 24 Apr 22:56 2011
Picon

Re: Expiring Columns - how to set TTL?

Looks like I need to use HColumn.setTtl directly as there's no factory method that would take TTL.

On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev <oleg.tsvinev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
It's been a while since 0.7 was announced that introduced expiring columns.
I can't find a Hector API to set the TTL value. I know there's a
Thrift way but using Thrift directly from Hector is discouraged.
Does anyone has experience setting the TTL?

soumik | 25 Apr 13:57 2011
Picon

Re: Expiring Columns - how to set TTL?

Yes, TTL as the factory method param would've been nicer.

So, does calling the setTtl() method translate into the client making
an extra Cassandra "update" operation for the column in question?

There seems to be a method - HColumn<N, V> apply(V value, long clock,
int ttl). Not sure if we end up calling this method(or its overloaded
form) before the actual Column creation using Thrift.

On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...@...> wrote:
> Looks like I need to use HColumn.setTtl directly as there's no factory
> method that would take TTL.
>
> On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev <oleg.tsvi...@...>wrote:
>
>
>
>
>
>
>
> > It's been a while since 0.7 was announced that introduced expiring columns.
> > I can't find a Hector API to set the TTL value. I know there's a
> > Thrift way but using Thrift directly from Hector is discouraged.
> > Does anyone has experience setting the TTL?

Oleg Tsvinev | 25 Apr 19:29 2011
Picon

Re: Expiring Columns - how to set TTL?

Nope, it does not:


   <at> Override
  public HColumn<N, V> apply(V value, long clock, int ttl) {
    setValue(value);
    column.setTimestamp(clock);
    column.setTtl(ttl);
    return this;
  }


On Mon, Apr 25, 2011 at 4:57 AM, soumik <soumikb <at> gmail.com> wrote:
Yes, TTL as the factory method param would've been nicer.

So, does calling the setTtl() method translate into the client making
an extra Cassandra "update" operation for the column in question?

There seems to be a method - HColumn<N, V> apply(V value, long clock,
int ttl). Not sure if we end up calling this method(or its overloaded
form) before the actual Column creation using Thrift.


On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Looks like I need to use HColumn.setTtl directly as there's no factory
> method that would take TTL.
>
> On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:
>
>
>
>
>
>
>
> > It's been a while since 0.7 was announced that introduced expiring columns.
> > I can't find a Hector API to set the TTL value. I know there's a
> > Thrift way but using Thrift directly from Hector is discouraged.
> > Does anyone has experience setting the TTL?

soumik | 25 Apr 19:54 2011
Picon

Re: Expiring Columns - how to set TTL?

So in that case, setTtl() is another update on the column and not an
initial setting?

On Apr 25, 10:29 pm, Oleg Tsvinev <oleg.tsvi...@...> wrote:
> Nope, it does not:
>
>    <at> Override
>   public HColumn<N, V> apply(V value, long clock, int ttl) {
>     setValue(value);
>     column.setTimestamp(clock);
>     column.setTtl(ttl);
>     return this;
>   }
>
>
>
>
>
>
>
> On Mon, Apr 25, 2011 at 4:57 AM, soumik <soum...@...> wrote:
> > Yes, TTL as the factory method param would've been nicer.
>
> > So, does calling the setTtl() method translate into the client making
> > an extra Cassandra "update" operation for the column in question?
>
> > There seems to be a method - HColumn<N, V> apply(V value, long clock,
> > int ttl). Not sure if we end up calling this method(or its overloaded
> > form) before the actual Column creation using Thrift.
>
> > On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...@...> wrote:
> > > Looks like I need to use HColumn.setTtl directly as there's no factory
> > > method that would take TTL.
>
> > > On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev <oleg.tsvi...@...
> > >wrote:
>
> > > > It's been a while since 0.7 was announced that introduced expiring
> > columns.
> > > > I can't find a Hector API to set the TTL value. I know there's a
> > > > Thrift way but using Thrift directly from Hector is discouraged.
> > > > Does anyone has experience setting the TTL?

Oleg Tsvinev | 25 Apr 20:16 2011
Picon

Re: Expiring Columns - how to set TTL?

HColumn.setTtl looks like just a setter for the TTL  property. 

HColumnImpl is a wrapper for Thrift Column type.
HFactory, which one uses to create a HColumn, does not have any createColumn methods that would take TTL as a parameter. So there's no initial setting. It has to be added, because I believe there is a demand for it :)

On Mon, Apr 25, 2011 at 10:54 AM, soumik <soumikb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
So in that case, setTtl() is another update on the column and not an
initial setting?

On Apr 25, 10:29 pm, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Nope, it does not:
>
>   <at> Override
>   public HColumn<N, V> apply(V value, long clock, int ttl) {
>     setValue(value);
>     column.setTimestamp(clock);
>     column.setTtl(ttl);
>     return this;
>   }
>
>
>
>
>
>
>
> On Mon, Apr 25, 2011 at 4:57 AM, soumik <soum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Yes, TTL as the factory method param would've been nicer.
>
> > So, does calling the setTtl() method translate into the client making
> > an extra Cassandra "update" operation for the column in question?
>
> > There seems to be a method - HColumn<N, V> apply(V value, long clock,
> > int ttl). Not sure if we end up calling this method(or its overloaded
> > form) before the actual Column creation using Thrift.
>
> > On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > > Looks like I need to use HColumn.setTtl directly as there's no factory
> > > method that would take TTL.
>
> > > On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > >wrote:
>
> > > > It's been a while since 0.7 was announced that introduced expiring
> > columns.
> > > > I can't find a Hector API to set the TTL value. I know there's a
> > > > Thrift way but using Thrift directly from Hector is discouraged.
> > > > Does anyone has experience setting the TTL?

Nate McCall | 25 Apr 20:47 2011

Re: Expiring Columns - how to set TTL?

HColumnImpl#apply is to facilitate re-use of HColumn.

Fair enough on the overloaded versions. We like patches :-)

On Mon, Apr 25, 2011 at 1:16 PM, Oleg Tsvinev <oleg.tsvinev@...> wrote:
> HColumn.setTtl looks like just a setter for the TTL  property.
> HColumnImpl is a wrapper for Thrift Column type.
> HFactory, which one uses to create a HColumn, does not have any createColumn
> methods that would take TTL as a parameter. So there's no initial setting.
> It has to be added, because I believe there is a demand for it :)
> On Mon, Apr 25, 2011 at 10:54 AM, soumik <soumikb@...> wrote:
>>
>> So in that case, setTtl() is another update on the column and not an
>> initial setting?
>>
>> On Apr 25, 10:29 pm, Oleg Tsvinev <oleg.tsvi...@...> wrote:
>> > Nope, it does not:
>> >
>> >    <at> Override
>> >   public HColumn<N, V> apply(V value, long clock, int ttl) {
>> >     setValue(value);
>> >     column.setTimestamp(clock);
>> >     column.setTtl(ttl);
>> >     return this;
>> >   }
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Apr 25, 2011 at 4:57 AM, soumik <soum...@...> wrote:
>> > > Yes, TTL as the factory method param would've been nicer.
>> >
>> > > So, does calling the setTtl() method translate into the client making
>> > > an extra Cassandra "update" operation for the column in question?
>> >
>> > > There seems to be a method - HColumn<N, V> apply(V value, long clock,
>> > > int ttl). Not sure if we end up calling this method(or its overloaded
>> > > form) before the actual Column creation using Thrift.
>> >
>> > > On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...@...> wrote:
>> > > > Looks like I need to use HColumn.setTtl directly as there's no
>> > > > factory
>> > > > method that would take TTL.
>> >
>> > > > On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev
>> > > > <oleg.tsvi...@...
>> > > >wrote:
>> >
>> > > > > It's been a while since 0.7 was announced that introduced expiring
>> > > columns.
>> > > > > I can't find a Hector API to set the TTL value. I know there's a
>> > > > > Thrift way but using Thrift directly from Hector is discouraged.
>> > > > > Does anyone has experience setting the TTL?
>

Oleg Tsvinev | 28 Apr 22:20 2011
Picon

Re: Expiring Columns - how to set TTL?

Just submitted a pull request.

On Mon, Apr 25, 2011 at 11:47 AM, Nate McCall <nate-RPDHmC83BodWk0Htik3J/w@public.gmane.org> wrote:
HColumnImpl#apply is to facilitate re-use of HColumn.

Fair enough on the overloaded versions. We like patches :-)

On Mon, Apr 25, 2011 at 1:16 PM, Oleg Tsvinev <oleg.tsvinev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> HColumn.setTtl looks like just a setter for the TTL  property.
> HColumnImpl is a wrapper for Thrift Column type.
> HFactory, which one uses to create a HColumn, does not have any createColumn
> methods that would take TTL as a parameter. So there's no initial setting.
> It has to be added, because I believe there is a demand for it :)
> On Mon, Apr 25, 2011 at 10:54 AM, soumik <soumikb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> So in that case, setTtl() is another update on the column and not an
>> initial setting?
>>
>> On Apr 25, 10:29 pm, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > Nope, it does not:
>> >
>> >   <at> Override
>> >   public HColumn<N, V> apply(V value, long clock, int ttl) {
>> >     setValue(value);
>> >     column.setTimestamp(clock);
>> >     column.setTtl(ttl);
>> >     return this;
>> >   }
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Apr 25, 2011 at 4:57 AM, soumik <soum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > > Yes, TTL as the factory method param would've been nicer.
>> >
>> > > So, does calling the setTtl() method translate into the client making
>> > > an extra Cassandra "update" operation for the column in question?
>> >
>> > > There seems to be a method - HColumn<N, V> apply(V value, long clock,
>> > > int ttl). Not sure if we end up calling this method(or its overloaded
>> > > form) before the actual Column creation using Thrift.
>> >
>> > > On Apr 25, 1:56 am, Oleg Tsvinev <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > > > Looks like I need to use HColumn.setTtl directly as there's no
>> > > > factory
>> > > > method that would take TTL.
>> >
>> > > > On Sun, Apr 24, 2011 at 1:37 PM, Oleg Tsvinev
>> > > > <oleg.tsvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> > > >wrote:
>> >
>> > > > > It's been a while since 0.7 was announced that introduced expiring
>> > > columns.
>> > > > > I can't find a Hector API to set the TTL value. I know there's a
>> > > > > Thrift way but using Thrift directly from Hector is discouraged.
>> > > > > Does anyone has experience setting the TTL?
>


Gmane