Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # user >> Knowing when an iterator is at the "last row/entry"

Copy link to this message
Re: Knowing when an iterator is at the "last row/entry"
You can override hasTop() to log the message when getSource().hasTop()
is false. Something like:

public boolean hasTop() {
  if (!super.hasTop())
    log.debug("my message");
  return super.hasTop();

However, this won't guarantee that you will catch all occurrences.
Some scan sessions could expire and the iterator stack be torn down
and re-created before the iterator exhausts its source iterator. A
client could resume in the middle of a tablet, with a new instance of
your iterator, and the counter would be smaller, because the count
from the previous instance of the iterator will have been lost.

Christopher L Tubbs II
On Mon, Jan 6, 2014 at 7:30 PM, Terry P. <[EMAIL PROTECTED]> wrote:
> Greetings folks,
> I have an iterator that extends RowFilter and I have a case where I need to
> know when its defined date format doesn't match the format of the data being
> scanned by the iterator.  I don't want to flood the tserver log with an
> error per row (how horrid that would be), but instead keep a counter of the
> number of times that error occurs during a scan or major compaction.
> Trouble is, I don't see any way to know when an iterator is on the "last
> row" or "last entry" in its scan on a tabletserver, as if I could test for
> that, I could then dump my single log message with the count of date format
> parse errors for that scan/compaction.
> Anyone know a way to determine if an iterator is at the "last entry" or
> "last row" of its execution?
> Many thanks in advance.