Class AbstractDatanodeStore.KeyValueBlockIterator
java.lang.Object
org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore.KeyValueBlockIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>
- Enclosing class:
AbstractDatanodeStore
@Public
public static class AbstractDatanodeStore.KeyValueBlockIterator
extends Object
implements BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>, Closeable
Block Iterator for KeyValue Container. This block iterator returns blocks
which match with the
MetadataKeyFilters.KeyPrefixFilter.
The default filter is DEFAULT_BLOCK_FILTER.-
Method Details
-
nextBlock
public org.apache.hadoop.ozone.container.common.helpers.BlockData nextBlock() throws IOException, NoSuchElementExceptionThis method returns blocks matching with the filter.- Specified by:
nextBlockin interfaceBlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>- Returns:
- next block or null if no more blocks
- Throws:
IOExceptionNoSuchElementException
-
hasNext
Description copied from interface:BlockIteratorThis checks if iterator has next element. If it has returns true, otherwise false.- Specified by:
hasNextin interfaceBlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>- Returns:
- boolean
- Throws:
IOException
-
seekToFirst
public void seekToFirst()Description copied from interface:BlockIteratorSeek to first entry.- Specified by:
seekToFirstin interfaceBlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>
-
seekToLast
public void seekToLast()Description copied from interface:BlockIteratorSeek to last entry.- Specified by:
seekToLastin interfaceBlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData>
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-