Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E1CB10F0E for ; Fri, 27 Sep 2013 04:13:07 +0000 (UTC) Received: (qmail 48763 invoked by uid 500); 27 Sep 2013 04:13:03 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 47967 invoked by uid 500); 27 Sep 2013 04:13:00 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 47956 invoked by uid 99); 27 Sep 2013 04:12:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 04:12:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jdisalive@gmail.com designates 209.85.216.179 as permitted sender) Received: from [209.85.216.179] (HELO mail-qc0-f179.google.com) (209.85.216.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 04:12:51 +0000 Received: by mail-qc0-f179.google.com with SMTP id l4so1390105qcv.24 for ; Thu, 26 Sep 2013 21:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Pj1xMNFeDKUU6TJE6xTK3lOOmwSX+2BLzKXi3GwZdDY=; b=nTdzCNwFQBJWJyD3FYADF6KeiY9Ytdgu4nfRTyUx3FhbpG2FlQrAWsq//gcEHYh/IG IRh9c2rzwmSV7FxJSqaH/sYQ281zyjo6kzU8ae0F1ToXvwRveQyzNTHaTqTLbn0htvya VpRuJk3YNiEs9yq0egI5ilu4umjbXOjyBaQagk3Y1ynwQpP1aR1DJ8uIRkZKuAiX0tRK pKRPtfA0LneLOaiYkyqUVwz6YlcU1ShPLP4u0PxdDXEmEsfpO4oRubRAkhWtc+k7SH5A eL/l1Q+pSI0pM1Ntd+NnOMtJ/r64PFsJwNTAv2ABtCPXir93bGuM5L4/y4uv9wWOMUDH CAjg== MIME-Version: 1.0 X-Received: by 10.224.166.208 with SMTP id n16mr3883qay.112.1380255151222; Thu, 26 Sep 2013 21:12:31 -0700 (PDT) Received: by 10.140.41.179 with HTTP; Thu, 26 Sep 2013 21:12:31 -0700 (PDT) Received: by 10.140.41.179 with HTTP; Thu, 26 Sep 2013 21:12:31 -0700 (PDT) In-Reply-To: References: Date: Fri, 27 Sep 2013 00:12:31 -0400 Message-ID: Subject: Re: Query about class org.apache.cassandra.io.sstable.SSTableSimpleWriter From: Jayadev Jayaraman To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0129461cfcf82804e755b1bb X-Virus-Checked: Checked by ClamAV on apache.org --089e0129461cfcf82804e755b1bb Content-Type: text/plain; charset=ISO-8859-1 Thanks for the reply. Isn't the addColumn(IColumn col) method in the writer private though? I know what to do now in order to construct a column with a TTL now. Thanks. On Sep 26, 2013 9:00 PM, "Aaron Morton" wrote: > > org.apache.cassandra.thrift.Column column; // initialize this with name, > value, timestamp, TTL > This is the wrong object to use. > > one overload of addColumn() accepts IColumn which is from > org.apache.cassanda.db . The thrift classes are only use for the thrift API. > > > What is the difference between calling writer.addColumn() on the > column's name, value and timestamp, and writer.addExpiringColumn() on the > column's name, value, TTL, timestamp and expiration timestamp ? > They both add an column to the row. addExpiringColumn() adds an expiring > column, and addColumn adds a normal one. > > only addExpiringColumn accepts a TTL (in seconds) for the column. > > > > Does the former result in the column expiring still , in cassandra 1.2.x > (i.e. does setting the TTL on a Column object change the name or value in a > way so as to ensure the column will expire as required) ? > No. > An expiring column must be an ExpiringColumn column instance. > The base IColumn interface does not have a TTL, only expiring columns do. > > > If not , what is the TTL attribute used for in the Column object ? > The org.apache.cassandra.db.Column class does not have a TTL. > > Cheers > > > ----------------- > Aaron Morton > New Zealand > @aaronmorton > > Co-Founder & Principal Consultant > Apache Cassandra Consulting > http://www.thelastpickle.com > > On 26/09/2013, at 12:44 AM, Jayadev Jayaraman wrote: > > > Can someone answer this doubt reg. SSTableSimpleWriter ? I'd asked about > this earlier but it probably missed. Apologies for repeating the question > (with minor additions) : > > > > """ > > Let's say I've initialized a SSTableSimpleWriter instance and a new > column with TTL set : > > > > org.apache.cassandra.io.sstable.SSTableSimpleWriter writer = new > SSTableSimpleWriter( ... /* params here */); > > org.apache.cassandra.thrift.Column column; // initialize this with name, > value, timestamp, TTL > > > > What is the difference between calling writer.addColumn() on the > column's name, value and timestamp, and writer.addExpiringColumn() on the > column's name, value, TTL, timestamp and expiration timestamp ? Does the > former result in the column expiring still , in cassandra 1.2.x (i.e. does > setting the TTL on a Column object change the name or value in a way so as > to ensure the column will expire as required) ? If not , what is the TTL > attribute used for in the Column object ? > > """ > > > > Thanks, > > Jayadev > > > > > > On Tue, Sep 24, 2013 at 2:48 PM, Jayadev Jayaraman > wrote: > > Let's say I've initialized a SSTableSimpleWriter instance and a new > column with TTL set : > > > > SSTableSimpleWriter writer = new SSTableSimpleWriter( ... /* params here > */); > > Column column; > > > > What is the difference between calling writer.addColumn() on the > column's name and value, and writer.addExpiringColumn() on the column and > its TTL ? Does the former result in the column expiring still , in > cassandra 1.2.x ? Or does it not ? > > > > > > > > --089e0129461cfcf82804e755b1bb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Thanks for the reply. Isn't the addColumn(IColumn col) m= ethod in the writer private though? I know what to do now in order to const= ruct a column with a TTL now. Thanks.

On Sep 26, 2013 9:00 PM, "Aaron Morton"= ; <aaron@thelastpickle.com> wrote:
> org.apache.cassandra.thrift.Column column; // initialize this with nam= e, value, timestamp, TTL
This is the wrong object to use.

one overload of addColumn() accepts IColumn which is from org.apache.cassan= da.db . The thrift classes are only use for the thrift API.

> What is the difference between calling writer.addColumn() on the colum= n's name, value and timestamp, and writer.addExpiringColumn() on the co= lumn's name, value, TTL, timestamp and expiration timestamp ?
They both add an column to the row. addExpiringColumn() adds an expiring co= lumn, and addColumn adds a normal one.

only addExpiringColumn accepts a TTL (in seconds) for the column.


> Does the former result in the column expiring still , in cassandra 1.2= .x (i.e. does setting the TTL on a Column object change the name or value i= n a way so as to ensure the column will expire as required) ?
No.
An expiring column must be an ExpiringColumn column instance.
The base IColumn interface does not have a TTL, only expiring columns do.
> =A0If not , what is the TTL attribute used for in the Column object ?<= br> The org.apache.cassandra.db.Column class does not have a TTL.

Cheers


-----------------
Aaron Morton
New Zealand
@aaronmorton

Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thela= stpickle.com

On 26/09/2013, at 12:44 AM, Jayadev Jayaraman <jdisalive@gmail.com> wrote:

> Can someone answer this doubt reg. SSTableSimpleWriter ? I'd asked= about this earlier but it probably missed. Apologies for repeating the que= stion (with minor additions) =A0:
>
> """
> Let's say I've initialized a SSTableSimpleWriter instance and = a new column with TTL set :
>
> org.apache.cassandra.io.sstable.SSTableSimpleWriter writer =3D new SST= ableSimpleWriter( ... /* params here */);
> org.apache.cassandra.thrift.Column column; // initialize this with nam= e, value, timestamp, TTL
>
> What is the difference between calling writer.addColumn() on the colum= n's name, value and timestamp, and writer.addExpiringColumn() on the co= lumn's name, value, TTL, timestamp and expiration timestamp ? Does the = former result in the column expiring still , in cassandra 1.2.x (i.e. does = setting the TTL on a Column object change the name or value in a way so as = to ensure the column will expire as required) ? If not , what is the TTL at= tribute used for in the Column object ?
> """
>
> Thanks,
> Jayadev
>
>
> On Tue, Sep 24, 2013 at 2:48 PM, Jayadev Jayaraman <jdisalive@gmail.com> wrote:
> Let's say I've initialized a SSTableSimpleWriter instance and = a new column with TTL set :
>
> SSTableSimpleWriter writer =3D new SSTableSimpleWriter( ... /* params = here */);
> Column column;
>
> What is the difference between calling writer.addColumn() on the colum= n's name and value, and writer.addExpiringColumn() on the column and it= s TTL ? Does the former result in the column expiring still , in cassandra = 1.2.x ? Or does it not ?
>
>
>

--089e0129461cfcf82804e755b1bb--