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:
- https://github.com/joshelser/accumulo-column-summing/
- Performs an intermediate sums over numbers that occur in a given column family
- Requires a final summation client-side
- https://github.com/joshelser/RowsWithoutColumns
- Only returns rows that do not contain a provided set of columns
- Uses the WholeRowIterator serialization methods to return multiple key-value pairs as a single Key-Value pair (requires deserialization on the client)
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