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

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The last reserved block ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     

    Methods inherited from class org.apache.hadoop.util.SequentialNumber

    equals, getCurrentValue, hashCode, setCurrentValue, setIfGreater, skipTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LAST_RESERVED_BLOCK_ID

      public static final long LAST_RESERVED_BLOCK_ID
      The last reserved block ID.
      See Also:
  • Method Details

    • nextValue

      public long nextValue()
      Specified by:
      nextValue in interface org.apache.hadoop.util.IdGenerator
      Overrides:
      nextValue in class org.apache.hadoop.util.SequentialNumber