How to override the functions of SortedKeyValueIterator interface in Accumulo? How to override the functions of SortedKeyValueIterator interface in Accumulo? hadoop hadoop

How to override the functions of SortedKeyValueIterator interface in Accumulo?


Start with a look at the Javadoc on SortedKeyValueIterator -- http://accumulo.apache.org/1.6/apidocs/. That's a good starting place for what each method is supposed to do.

A good analogy in writing an iterator is to think of your Accumulo table (which the iterator is operating on) as a single-linked list (in sorted order). next() moves to the next node in the list and seek() moves forward/down skipping zero to many nodes. init() provides any necessary configuration (your iterator is likely running in the Accumulo server) from both the Accumulo table configuration and the client. deepCopy() should duplicate the exact state of the current iterator into a new instance (similar to Object.clone()).

I can also provide two examples of custom iterators:

You can also take a look at other provided "user-facing" iterators in Accumulo http://accumulo.apache.org/1.6/apidocs/org/apache/accumulo/core/iterators/user/package-summary.html