public class BlockIdManager extends Object
FSNamesystem
is responsible for persisting the allocations in the
EditLog
.Constructor and Description |
---|
BlockIdManager(org.apache.hadoop.hdfs.server.blockmanagement.BlockManager blockManager) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
long |
getGenerationStampAtblockIdSwitch()
Gets the value of the generation stamp that delineates sequential
and random block IDs.
|
long |
getGenerationStampV1()
Gets the current generation stamp for legacy blocks
|
long |
getGenerationStampV1Limit() |
long |
getGenerationStampV2() |
long |
getLastAllocatedBlockId()
Gets the maximum sequentially allocated block ID for this filesystem
|
boolean |
isGenStampInFuture(org.apache.hadoop.hdfs.protocol.Block block) |
boolean |
isLegacyBlock(org.apache.hadoop.hdfs.protocol.Block block)
Determine whether the block ID was randomly generated (legacy) or
sequentially generated.
|
long |
nextBlockId()
Increments, logs and then returns the block ID
|
long |
nextGenerationStamp(boolean legacyBlock)
Increments, logs and then returns the stamp
|
void |
setGenerationStampV1(long stamp)
Sets the current generation stamp for legacy blocks
|
void |
setGenerationStampV1Limit(long stamp)
Sets the generation stamp that delineates random and sequentially
allocated block IDs.
|
void |
setGenerationStampV2(long stamp)
Gets the current generation stamp for this filesystem
|
void |
setLastAllocatedBlockId(long blockId)
Sets the maximum allocated block ID for this filesystem.
|
long |
upgradeGenerationStampToV2()
Upgrades the generation stamp for the filesystem
by reserving a sufficient range for all existing blocks.
|
public BlockIdManager(org.apache.hadoop.hdfs.server.blockmanagement.BlockManager blockManager)
public long upgradeGenerationStampToV2()
public void setGenerationStampV1Limit(long stamp)
stamp
- set generation stamp limit to this valuepublic long getGenerationStampAtblockIdSwitch()
public void setLastAllocatedBlockId(long blockId)
public long getLastAllocatedBlockId()
public void setGenerationStampV1(long stamp)
public long getGenerationStampV1()
public void setGenerationStampV2(long stamp)
public long getGenerationStampV2()
public long nextGenerationStamp(boolean legacyBlock) throws IOException
IOException
public long getGenerationStampV1Limit()
public boolean isLegacyBlock(org.apache.hadoop.hdfs.protocol.Block block)
public long nextBlockId()
public boolean isGenStampInFuture(org.apache.hadoop.hdfs.protocol.Block block)
public void clear()
Copyright © 2017 Apache Software Foundation. All Rights Reserved.