Class RowIterator

All Implemented Interfaces:

public class RowIterator extends Object implements Iterator<Iterator<Map.Entry<Key,Value>>>
Group Key/Value pairs into Iterators over rows. Suggested usage:
 RowIterator rowIterator = new RowIterator(connector.createScanner(tableName, authorizations));
  • Constructor Details

    • RowIterator

      public RowIterator(Iterator<Map.Entry<Key,Value>> iterator)
      Create an iterator from an (ordered) sequence of KeyValue pairs.
    • RowIterator

      public RowIterator(Iterable<Map.Entry<Key,Value>> iterable)
      Create an iterator from an Iterable.
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if there is at least one more row to get. If the last row hasn't been fully read, this method will read through the end of the last row so it can determine if the underlying iterator has a next row. The last row is disabled from future use.
      Specified by:
      hasNext in interface Iterator<Iterator<Map.Entry<Key,Value>>>
    • next

      public Iterator<Map.Entry<Key,Value>> next()
      Fetch the next row.
      Specified by:
      next in interface Iterator<Iterator<Map.Entry<Key,Value>>>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<Iterator<Map.Entry<Key,Value>>>
    • getKVCount

      public long getKVCount()
      Get a count of the total number of entries in all rows read so far.