Class SequentialBlockIdGenerator
java.lang.Object
org.apache.hadoop.util.SequentialNumber
org.apache.hadoop.hdfs.server.blockmanagement.SequentialBlockIdGenerator
- All Implemented Interfaces:
org.apache.hadoop.util.IdGenerator
@Private
public class SequentialBlockIdGenerator
extends org.apache.hadoop.util.SequentialNumber
Generate the next valid block ID by incrementing the maximum block
ID allocated so far, starting at 2^30+1.
Block IDs used to be allocated randomly in the past. Hence we may
find some conflicts while stepping through the ID space sequentially.
However given the sparsity of the ID space, conflicts should be rare
and can be skipped over when detected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe last reserved block ID. -
Method Summary
Methods inherited from class org.apache.hadoop.util.SequentialNumber
equals, getCurrentValue, hashCode, setCurrentValue, setIfGreater, skipTo
-
Field Details
-
LAST_RESERVED_BLOCK_ID
public static final long LAST_RESERVED_BLOCK_IDThe last reserved block ID.- See Also:
-
-
Method Details
-
nextValue
public long nextValue()- Specified by:
nextValuein interfaceorg.apache.hadoop.util.IdGenerator- Overrides:
nextValuein classorg.apache.hadoop.util.SequentialNumber
-