You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Sanal Vasudevan <ge...@gmail.com> on 2017/02/23 00:05:01 UTC

Truncate operation not available in Mutation Object

Hi Folks,

I am trying to read Mutations from commit log files through an
implementation of CommitLogReadHandler interface.

For a truncate CQL operation, I do not see a Mutation object.

Does C* skip writing the truncate operation into the commit log file?


Thanks for your help.

Best regards,
Sanal

Re: Truncate operation not available in Mutation Object

Posted by Jeremy Hanna <je...@gmail.com>.
thanks Chris

> On Feb 23, 2017, at 11:00 AM, Chris Lohfink <ch...@datastax.com> wrote:
> 
> The truncates are written to the truncated_at field in system.local and
> should be honored by the commit log replayer (
> https://github.com/apache/cassandra/blob/af3fe39dcabd9ef77a00309ce6741268423206df/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L102
> ).
> 
> Chris
> 
> On Wed, Feb 22, 2017 at 7:02 PM, Sanal Vasudevan <ge...@gmail.com>
> wrote:
> 
>> Thanks Jeremy.
>> Any way I could detect that such a truncate operation was performed on the
>> table? Does it leave a trace that the truncate happened anywhere?
>> 
>> 
>> Best regards,
>> Sanal
>> 
>> On Thu, Feb 23, 2017 at 11:47 AM, Jeremy Hanna <jeremy.hanna1234@gmail.com
>>> 
>> wrote:
>> 
>>> Everything in that table is deleted. There's no mutation or anything in
>>> the commitlog. It's a deletion of all the sstables for that table. To
>> make
>>> sure everything is gone, it first does a flush, then a snapshot to
>> protect
>>> against a mistake, then the truncate itself.
>>> 
>>>> On Feb 22, 2017, at 6:05 PM, Sanal Vasudevan <ge...@gmail.com>
>>> wrote:
>>>> 
>>>> Hi Folks,
>>>> 
>>>> I am trying to read Mutations from commit log files through an
>>>> implementation of CommitLogReadHandler interface.
>>>> 
>>>> For a truncate CQL operation, I do not see a Mutation object.
>>>> 
>>>> Does C* skip writing the truncate operation into the commit log file?
>>>> 
>>>> 
>>>> Thanks for your help.
>>>> 
>>>> Best regards,
>>>> Sanal
>>> 
>> 
>> 
>> 
>> --
>> Sanal Vasudevan Nair
>> 


Re: Truncate operation not available in Mutation Object

Posted by Sanal Vasudevan <ge...@gmail.com>.
Thank you Chris.

On Fri, Feb 24, 2017 at 4:00 AM, Chris Lohfink <ch...@datastax.com>
wrote:

> The truncates are written to the truncated_at field in system.local and
> should be honored by the commit log replayer (
> https://github.com/apache/cassandra/blob/af3fe39dcabd9ef77a00309ce67412
> 68423206df/src/java/org/apache/cassandra/db/commitlog/
> CommitLogReplayer.java#L102
> ).
>
> Chris
>
> On Wed, Feb 22, 2017 at 7:02 PM, Sanal Vasudevan <ge...@gmail.com>
> wrote:
>
> > Thanks Jeremy.
> > Any way I could detect that such a truncate operation was performed on
> the
> > table? Does it leave a trace that the truncate happened anywhere?
> >
> >
> > Best regards,
> > Sanal
> >
> > On Thu, Feb 23, 2017 at 11:47 AM, Jeremy Hanna <
> jeremy.hanna1234@gmail.com
> > >
> > wrote:
> >
> > > Everything in that table is deleted. There's no mutation or anything in
> > > the commitlog. It's a deletion of all the sstables for that table. To
> > make
> > > sure everything is gone, it first does a flush, then a snapshot to
> > protect
> > > against a mistake, then the truncate itself.
> > >
> > > > On Feb 22, 2017, at 6:05 PM, Sanal Vasudevan <ge...@gmail.com>
> > > wrote:
> > > >
> > > > Hi Folks,
> > > >
> > > > I am trying to read Mutations from commit log files through an
> > > > implementation of CommitLogReadHandler interface.
> > > >
> > > > For a truncate CQL operation, I do not see a Mutation object.
> > > >
> > > > Does C* skip writing the truncate operation into the commit log file?
> > > >
> > > >
> > > > Thanks for your help.
> > > >
> > > > Best regards,
> > > > Sanal
> > >
> >
> >
> >
> > --
> > Sanal Vasudevan Nair
> >
>



-- 
Sanal Vasudevan Nair

Re: Truncate operation not available in Mutation Object

Posted by Chris Lohfink <ch...@datastax.com>.
The truncates are written to the truncated_at field in system.local and
should be honored by the commit log replayer (
https://github.com/apache/cassandra/blob/af3fe39dcabd9ef77a00309ce6741268423206df/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L102
).

Chris

On Wed, Feb 22, 2017 at 7:02 PM, Sanal Vasudevan <ge...@gmail.com>
wrote:

> Thanks Jeremy.
> Any way I could detect that such a truncate operation was performed on the
> table? Does it leave a trace that the truncate happened anywhere?
>
>
> Best regards,
> Sanal
>
> On Thu, Feb 23, 2017 at 11:47 AM, Jeremy Hanna <jeremy.hanna1234@gmail.com
> >
> wrote:
>
> > Everything in that table is deleted. There's no mutation or anything in
> > the commitlog. It's a deletion of all the sstables for that table. To
> make
> > sure everything is gone, it first does a flush, then a snapshot to
> protect
> > against a mistake, then the truncate itself.
> >
> > > On Feb 22, 2017, at 6:05 PM, Sanal Vasudevan <ge...@gmail.com>
> > wrote:
> > >
> > > Hi Folks,
> > >
> > > I am trying to read Mutations from commit log files through an
> > > implementation of CommitLogReadHandler interface.
> > >
> > > For a truncate CQL operation, I do not see a Mutation object.
> > >
> > > Does C* skip writing the truncate operation into the commit log file?
> > >
> > >
> > > Thanks for your help.
> > >
> > > Best regards,
> > > Sanal
> >
>
>
>
> --
> Sanal Vasudevan Nair
>

Re: Truncate operation not available in Mutation Object

Posted by Sanal Vasudevan <ge...@gmail.com>.
Thanks Jeremy.
Any way I could detect that such a truncate operation was performed on the
table? Does it leave a trace that the truncate happened anywhere?


Best regards,
Sanal

On Thu, Feb 23, 2017 at 11:47 AM, Jeremy Hanna <je...@gmail.com>
wrote:

> Everything in that table is deleted. There's no mutation or anything in
> the commitlog. It's a deletion of all the sstables for that table. To make
> sure everything is gone, it first does a flush, then a snapshot to protect
> against a mistake, then the truncate itself.
>
> > On Feb 22, 2017, at 6:05 PM, Sanal Vasudevan <ge...@gmail.com>
> wrote:
> >
> > Hi Folks,
> >
> > I am trying to read Mutations from commit log files through an
> > implementation of CommitLogReadHandler interface.
> >
> > For a truncate CQL operation, I do not see a Mutation object.
> >
> > Does C* skip writing the truncate operation into the commit log file?
> >
> >
> > Thanks for your help.
> >
> > Best regards,
> > Sanal
>



-- 
Sanal Vasudevan Nair

Re: Truncate operation not available in Mutation Object

Posted by Jeremy Hanna <je...@gmail.com>.
Everything in that table is deleted. There's no mutation or anything in the commitlog. It's a deletion of all the sstables for that table. To make sure everything is gone, it first does a flush, then a snapshot to protect against a mistake, then the truncate itself.

> On Feb 22, 2017, at 6:05 PM, Sanal Vasudevan <ge...@gmail.com> wrote:
> 
> Hi Folks,
> 
> I am trying to read Mutations from commit log files through an
> implementation of CommitLogReadHandler interface.
> 
> For a truncate CQL operation, I do not see a Mutation object.
> 
> Does C* skip writing the truncate operation into the commit log file?
> 
> 
> Thanks for your help.
> 
> Best regards,
> Sanal