|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.protocol.BlockListAsLongs
@InterfaceAudience.Private @InterfaceStability.Evolving public class BlockListAsLongs
This class provides an interface for accessing list of blocks that has been implemented as long[]. This class is useful for block report. Rather than send block reports as a Block[] we can send it as a long[]. The structure of the array is as follows: 0: the length of the finalized replica list; 1: the length of the under-construction replica list; - followed by finalized replica list where each replica is represented by 3 longs: one for the blockId, one for the block length, and one for the generation stamp; - followed by the invalid replica represented with three -1s; - followed by the under-construction replica list where each replica is represented by 4 longs: three for the block id, length, generation stamp, and the forth for the replica state.
Nested Class Summary | |
---|---|
class |
BlockListAsLongs.BlockReportIterator
Iterates over blocks in the block report. |
Constructor Summary | |
---|---|
BlockListAsLongs()
|
|
BlockListAsLongs(List<? extends Block> finalized,
List<ReplicaInfo> uc)
Create block report from finalized and under construction lists of blocks. |
|
BlockListAsLongs(long[] iBlockList)
Constructor |
Method Summary | |
---|---|
long |
getBlockGenStamp(int index)
Deprecated. |
long |
getBlockId(int index)
Deprecated. |
long |
getBlockLen(int index)
Deprecated. |
long[] |
getBlockListAsLongs()
|
BlockListAsLongs.BlockReportIterator |
getBlockReportIterator()
Returns BlockListAsLongs.BlockReportIterator . |
int |
getNumberOfBlocks()
The number of blocks |
Iterator<Block> |
iterator()
Returns an iterator over blocks in the block report. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockListAsLongs(List<? extends Block> finalized, List<ReplicaInfo> uc)
finalized
- - list of finalized blocksuc
- - list of under construction blockspublic BlockListAsLongs()
public BlockListAsLongs(long[] iBlockList)
iBlockList
- - BlockListALongs create from this long[] parameterMethod Detail |
---|
public long[] getBlockListAsLongs()
public Iterator<Block> iterator()
iterator
in interface Iterable<Block>
public BlockListAsLongs.BlockReportIterator getBlockReportIterator()
BlockListAsLongs.BlockReportIterator
.
public int getNumberOfBlocks()
@Deprecated public long getBlockId(int index)
index
- - the block whose block-id is desired
@Deprecated public long getBlockLen(int index)
index
- - the block whose block-len is desired
@Deprecated public long getBlockGenStamp(int index)
index
- - the block whose block-len is desired
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |