You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Claire Chang <cl...@merchantcircle.com> on 2010/06/18 19:24:59 UTC
what is the best way to truncate a column family
programmatically w/o bringing the servers down.
thanks,
claire
Re: what is the best way to truncate a column family
Posted by Benjamin Black <b...@b3k.us>.
I have been reminded that you can do a range query+pagination with RP
in 0.6 to perform this operation.
On Fri, Jun 18, 2010 at 10:29 AM, Benjamin Black <b...@b3k.us> wrote:
> In 0.6 your only option with those constraints is to iterate over the
> entire CF and deleting row by row. This requires you are either using
> OPP or have an index that covers all keys in the CF. 0.7 adds the
> ability to truncate a CF (deleting all its rows) through the API.
>
> On Fri, Jun 18, 2010 at 10:24 AM, Claire Chang
> <cl...@merchantcircle.com> wrote:
>> programmatically w/o bringing the servers down.
>>
>> thanks,
>> claire
>>
>
Re: what is the best way to truncate a column family
Posted by Phil Stanhope <ps...@wimba.com>.
I am happy with this restriction on truncate operation for 0.7. Thanks for the quick response.
-phil
On Jun 18, 2010, at 4:57 PM, Ran Tavory wrote:
> it will be immediate.
> But it will fail if not all hosts in the cluster are up, this is the tradeoff. We regard the truncate operation an admin api so I think it's a fair tradeoff.
>
> On Fri, Jun 18, 2010 at 11:50 PM, Phil Stanhope <ps...@wimba.com> wrote:
> In 0.6.x the iterating approach works ... but you need to flush and compact (after GCGraceSeconds) in order to NOT see the keys in the CF.
>
> Will the behavior of the truncate method in 0.7 require flush/compact as well? Or will it be immediate?
>
> -phil
>
> On Jun 18, 2010, at 1:29 PM, Benjamin Black wrote:
>
> > In 0.6 your only option with those constraints is to iterate over the
> > entire CF and deleting row by row. This requires you are either using
> > OPP or have an index that covers all keys in the CF. 0.7 adds the
> > ability to truncate a CF (deleting all its rows) through the API.
> >
> > On Fri, Jun 18, 2010 at 10:24 AM, Claire Chang
> > <cl...@merchantcircle.com> wrote:
> >> programmatically w/o bringing the servers down.
> >>
> >> thanks,
> >> claire
> >>
>
>
Re: what is the best way to truncate a column family
Posted by Ran Tavory <ra...@gmail.com>.
it will be immediate.
But it will fail if not all hosts in the cluster are up, this is the
tradeoff. We regard the truncate operation an admin api so I think it's a
fair tradeoff.
On Fri, Jun 18, 2010 at 11:50 PM, Phil Stanhope <ps...@wimba.com> wrote:
> In 0.6.x the iterating approach works ... but you need to flush and compact
> (after GCGraceSeconds) in order to NOT see the keys in the CF.
>
> Will the behavior of the truncate method in 0.7 require flush/compact as
> well? Or will it be immediate?
>
> -phil
>
> On Jun 18, 2010, at 1:29 PM, Benjamin Black wrote:
>
> > In 0.6 your only option with those constraints is to iterate over the
> > entire CF and deleting row by row. This requires you are either using
> > OPP or have an index that covers all keys in the CF. 0.7 adds the
> > ability to truncate a CF (deleting all its rows) through the API.
> >
> > On Fri, Jun 18, 2010 at 10:24 AM, Claire Chang
> > <cl...@merchantcircle.com> wrote:
> >> programmatically w/o bringing the servers down.
> >>
> >> thanks,
> >> claire
> >>
>
>
Re: what is the best way to truncate a column family
Posted by Phil Stanhope <ps...@wimba.com>.
In 0.6.x the iterating approach works ... but you need to flush and compact (after GCGraceSeconds) in order to NOT see the keys in the CF.
Will the behavior of the truncate method in 0.7 require flush/compact as well? Or will it be immediate?
-phil
On Jun 18, 2010, at 1:29 PM, Benjamin Black wrote:
> In 0.6 your only option with those constraints is to iterate over the
> entire CF and deleting row by row. This requires you are either using
> OPP or have an index that covers all keys in the CF. 0.7 adds the
> ability to truncate a CF (deleting all its rows) through the API.
>
> On Fri, Jun 18, 2010 at 10:24 AM, Claire Chang
> <cl...@merchantcircle.com> wrote:
>> programmatically w/o bringing the servers down.
>>
>> thanks,
>> claire
>>
Re: what is the best way to truncate a column family
Posted by Benjamin Black <b...@b3k.us>.
In 0.6 your only option with those constraints is to iterate over the
entire CF and deleting row by row. This requires you are either using
OPP or have an index that covers all keys in the CF. 0.7 adds the
ability to truncate a CF (deleting all its rows) through the API.
On Fri, Jun 18, 2010 at 10:24 AM, Claire Chang
<cl...@merchantcircle.com> wrote:
> programmatically w/o bringing the servers down.
>
> thanks,
> claire
>