org.apache.accumulo.server.util
Class TabletIterator

java.lang.Object
  extended by org.apache.accumulo.server.util.TabletIterator
All Implemented Interfaces:
Iterator<Map<Key,Value>>

public class TabletIterator
extends Object
implements Iterator<Map<Key,Value>>

This class iterates over the metadata table returning all key values for a tablet in one chunk. As it scans the metadata table it checks the correctness of the metadata table, and rescans if needed. So the tablet key/values returned by this iterator should satisfy the sorted linked list property of the metadata table. The purpose of this is to hide inconsistencies caused by splits and detect anomalies in the metadata table. If a tablet that was returned by this iterator is subsequently deleted from the metadata table, then this iterator will throw a TabletDeletedException. This could occur when a table is merged.


Nested Class Summary
static class TabletIterator.TabletDeletedException
           
 
Constructor Summary
TabletIterator(Scanner s, Range range, boolean returnPrevEndRow, boolean returnDir)
           
 
Method Summary
 boolean hasNext()
           
 Map<Key,Value> next()
           
 void remove()
           
protected  void resetScanner()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabletIterator

public TabletIterator(Scanner s,
                      Range range,
                      boolean returnPrevEndRow,
                      boolean returnDir)
Parameters:
s - A scanner over the entire metadata table configure to fetch needed columns.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Map<Key,Value>>

next

public Map<Key,Value> next()
Specified by:
next in interface Iterator<Map<Key,Value>>

remove

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

resetScanner

protected void resetScanner()


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.