public static interface FsVolumeSpi.BlockIterator extends Closeable
Modifier and Type | Method and Description |
---|---|
boolean |
atEnd()
Returns true if we got to the end of the block pool.
|
String |
getBlockPoolId()
Get the id of the block pool which this iterator traverses.
|
long |
getIterStartMs()
Get the wall-clock time, measured in milliseconds since the Epoch,
when this iterator was created.
|
long |
getLastSavedMs()
Get the wall-clock time, measured in milliseconds since the Epoch,
when this iterator was last saved.
|
org.apache.hadoop.hdfs.protocol.ExtendedBlock |
nextBlock()
Get the next block.
Note that this block may be removed in between the time we list it,
and the time the caller tries to use it, or it may represent a stale
entry.
|
void |
rewind()
Repositions the iterator at the beginning of the block pool.
|
void |
save()
Save this block iterator to the underlying volume.
|
void |
setMaxStalenessMs(long maxStalenessMs)
Set the maximum staleness of entries that we will return.
A maximum staleness of 0 means we will never return stale entries; a
larger value will allow us to reduce resource consumption in exchange
for returning more potentially stale entries.
|
org.apache.hadoop.hdfs.protocol.ExtendedBlock nextBlock() throws IOException
IOException
- If there was an error getting the next block in
this volume. In this case, EOF will be set on
the iterator.boolean atEnd()
void rewind()
void save() throws IOException
IOException
- If there was an error when saving the block
iterator.void setMaxStalenessMs(long maxStalenessMs)
long getIterStartMs()
long getLastSavedMs()
String getBlockPoolId()
Copyright © 2018 Apache Software Foundation. All Rights Reserved.