From user-return-36861-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Mon Sep 30 07:05:22 2013 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 86FFC10921 for ; Mon, 30 Sep 2013 07:05:22 +0000 (UTC) Received: (qmail 14060 invoked by uid 500); 30 Sep 2013 07:02:23 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 14008 invoked by uid 500); 30 Sep 2013 07:02:19 -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 13981 invoked by uid 99); 30 Sep 2013 07:02:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Sep 2013 07:02:15 +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: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.160.54] (HELO mail-pb0-f54.google.com) (209.85.160.54) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Sep 2013 07:02:08 +0000 Received: by mail-pb0-f54.google.com with SMTP id ro12so5175101pbb.13 for ; Mon, 30 Sep 2013 00:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=/HnRV5lSudE1R5FbibUicCirje3U9IxopU51Xpdu26g=; b=MiYOz2SqYJPT8HhP3DZ3h9wk/JPQuJ2UOU9e9tTFbZlFSxy7j60bUaQUrqi86AU/+2 d3nXsdx4D7QNEvTOqRUGXENwPgAUHewnZ9CX0dQTLvBExahq46FbUjlLDj7iOPCE/vK2 VYVebVRMnA7gNpZdpp9Q8tL8NYkeJPQrjl0ab2cJq54eQdtgDnvlM1sCFv1Va303a9LX laEmHcsfsuiwJe8qvUaFxno4UJGKX+MIIQO5hg4+z+rEgZiY0Vu6M8/5a5wMxC4ZkFMU 8DjvQusnaFu3mQbIWWjmLKoSiF1qt68ltFy69NTseVAQjhGyCsOotCyadEmEyfOB6Q4/ FfXw== X-Gm-Message-State: ALoCoQnRx7niNq7udvpCMAmKbxTOAn9T2KxIo0p1nYF354KLjl8HYP5jJ2IXCm35ifonPuzdcDy+ X-Received: by 10.68.101.225 with SMTP id fj1mr22264429pbb.8.1380524507546; Mon, 30 Sep 2013 00:01:47 -0700 (PDT) Received: from [172.16.1.18] ([203.86.207.101]) by mx.google.com with ESMTPSA id kd1sm30938606pab.20.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Sep 2013 00:01:46 -0700 (PDT) From: Aaron Morton Content-Type: multipart/alternative; boundary="Apple-Mail=_BEB95BEA-3C9F-48CA-A6AE-AE2EFB570014" Message-Id: <9DA87577-C70A-4E56-8B04-433233CF24C7@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Query about class org.apache.cassandra.io.sstable.SSTableSimpleWriter Date: Mon, 30 Sep 2013 20:01:43 +1300 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_BEB95BEA-3C9F-48CA-A6AE-AE2EFB570014 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 > Thanks for the reply. Isn't the addColumn(IColumn col) method in the = writer private though? >=20 >=20 Yes but I thought you had it in your examples, was included for = completeness. use the official overloads.=20 Cheers ----------------- Aaron Morton New Zealand @aaronmorton Co-Founder & Principal Consultant Apache Cassandra Consulting http://www.thelastpickle.com On 27/09/2013, at 4:12 PM, Jayadev Jayaraman = wrote: > 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. >=20 > 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. >=20 > one overload of addColumn() accepts IColumn which is from = org.apache.cassanda.db . The thrift classes are only use for the thrift = API. >=20 > > 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. >=20 > only addExpiringColumn accepts a TTL (in seconds) for the column. >=20 >=20 > > 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. >=20 > > 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. >=20 > Cheers >=20 >=20 > ----------------- > Aaron Morton > New Zealand > @aaronmorton >=20 > Co-Founder & Principal Consultant > Apache Cassandra Consulting > http://www.thelastpickle.com >=20 > On 26/09/2013, at 12:44 AM, Jayadev Jayaraman = wrote: >=20 > > 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 =3D 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 =3D 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 ? > > > > > > >=20 --Apple-Mail=_BEB95BEA-3C9F-48CA-A6AE-AE2EFB570014 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=iso-8859-1

Thanks for the reply. Isn't the addColumn(IColumn col) method in the writer private though?



Yes but I thought you had it in your examples, was included for completeness. use the official overloads. 

Cheers

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

Co-Founder & Principal Consultant
Apache Cassandra Consulting

On 27/09/2013, at 4:12 PM, Jayadev Jayaraman <jdisalive@gmail.com> wrote:

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" <aaron@thelastpickle.com> 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 <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 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 <jdisalive@gmail.com> 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 ?
>
>
>


--Apple-Mail=_BEB95BEA-3C9F-48CA-A6AE-AE2EFB570014--