Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Added support for truncate().
Browse files Browse the repository at this point in the history
  • Loading branch information
thobbs committed Aug 14, 2010
1 parent ee0a12d commit 1b9cb8d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pycassa/columnfamily.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,3 +625,14 @@ def remove(self, key, columns=None, super_column=None, write_consistency_level =
self.client.remove(key, cp, clock,
self._wcl(write_consistency_level))
return clock.timestamp

def truncate(self)
"""
Marks the entire ColumnFamily as deleted.
From the user's perspective a successful call to truncate will result complete data deletion from cfname.
Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one
only marks the data as deleted.
The operation succeeds only if all hosts in the cluster at available and will throw an UnavailableException if
some hosts are down.
"""
self.client.truncate(self.column_family)

0 comments on commit 1b9cb8d

Please sign in to comment.