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
http://www.thelastpickle.com

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 ?
>
>
>