Skip to content

Commit

Permalink
Merge pull request #6 from bauer1j/master
Browse files Browse the repository at this point in the history
Add RowDeletingIterator
  • Loading branch information
jatrost committed Aug 16, 2013
2 parents 70b0881 + 15159ab commit 6452593
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pyaccumulo/iterators/__init__.py
Expand Up @@ -101,6 +101,31 @@ def _get_iterator_properties(self):
"negate": str(self.negate).lower()
}

class RowDeletingIterator(BaseIterator):
"""
An iterator for deleting whole rows. After setting this iterator up for
your table, to delete a row insert a row with empty column family, empty
column qualifier, empty column visibility, and a value of DEL_ROW. Do not
use empty columns for anything else when using this iterator. When using
this iterator the locality group containing the row deletes will always be
read. The locality group containing the empty column family will contain
row deletes. Always reading this locality group can have an impact on
performance. For example assume there are two locality groups, one
containing large images and one containing small metadata about the images.
If row deletes are in the same locality group as the images, then this will
significantly slow down scans and major compactions that are only reading
the metadata locality group. Therefore, you would want to put the empty
column family in the locality group that contains the metadata. Another
option is to put the empty column in its own locality group. Which is best
depends on your data.
"""
def __init__(self, name="RowDeletingIterator", priority=10):
classname="org.apache.accumulo.core.iterators.user.RowDeletingIterator"
super(RowDeletingIterator, self).__init__(name=name,
priority=priority,
classname=classname)


class RegExFilter(BaseIterator):
"""docstring for RegExFilter"""
def __init__(self, row_regex=None, cf_regex=None, cq_regex=None, val_regex=None, or_fields=False, match_substring=False, priority=10, name="RegExFilter"):
Expand Down
5 changes: 5 additions & 0 deletions tests/iterator_tests.py
Expand Up @@ -116,6 +116,11 @@ def test_iterator(self):
},
a.properties)

class RowDeletingIteratorTest(unittest.TestCase):
def test_iterator(self):
i = RowDeletingIterator()
self.assertEquals("org.apache.accumulo.core.iterators.user.RowDeletingIterator", i.classname)

class RegExFilterTest(unittest.TestCase):
def test_iterator(self):
i = RegExFilter()
Expand Down

0 comments on commit 6452593

Please sign in to comment.