public class BlockIdManager extends Object
FSNamesystem
is responsible for persisting the allocations in the
FSEditLog
.Constructor and Description |
---|
BlockIdManager(org.apache.hadoop.hdfs.server.blockmanagement.BlockManager blockManager) |
Modifier and Type | Method and Description |
---|---|
void |
applyImpendingGenerationStamp()
Set the current genstamp to the impending genstamp.
|
static byte |
getBlockIndex(org.apache.hadoop.hdfs.protocol.Block reportedBlock) |
long |
getGenerationStamp() |
long |
getGenerationStampAtblockIdSwitch()
Gets the value of the generation stamp that delineates sequential
and random block IDs.
|
long |
getImpendingGenerationStamp() |
long |
getLastAllocatedContiguousBlockId()
Gets the maximum sequentially allocated contiguous block ID for this
filesystem
|
long |
getLastAllocatedStripedBlockId()
Gets the maximum sequentially allocated striped block ID for this
filesystem
|
long |
getLegacyGenerationStamp()
Gets the current generation stamp for legacy blocks
|
long |
getLegacyGenerationStampLimit() |
boolean |
isStripedBlock(org.apache.hadoop.hdfs.protocol.Block block)
Return true if the block is a striped block.
|
static boolean |
isStripedBlockID(long id)
See
isStripedBlock(Block) , we should not use this function alone
to determine a block is striped block. |
void |
setGenerationStamp(long stamp)
Gets the current generation stamp for this filesystem
|
void |
setGenerationStampIfGreater(long stamp)
Set genstamp only when the given one is higher.
|
void |
setImpendingGenerationStamp(long stamp)
Set the currently highest gen stamp from active.
|
void |
setLastAllocatedContiguousBlockId(long blockId)
Sets the maximum allocated contiguous block ID for this filesystem.
|
void |
setLastAllocatedStripedBlockId(long blockId)
Sets the maximum allocated striped block ID for this filesystem.
|
void |
setLegacyGenerationStamp(long stamp)
Sets the current generation stamp for legacy blocks
|
void |
setLegacyGenerationStampLimit(long stamp)
Sets the generation stamp that delineates random and sequentially
allocated block IDs.
|
long |
upgradeLegacyGenerationStamp()
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 upgradeLegacyGenerationStamp()
public void setLegacyGenerationStampLimit(long stamp)
stamp
- set generation stamp limit to this valuepublic long getGenerationStampAtblockIdSwitch()
public void setLastAllocatedContiguousBlockId(long blockId)
public long getLastAllocatedContiguousBlockId()
public void setLastAllocatedStripedBlockId(long blockId)
public long getLastAllocatedStripedBlockId()
public void setLegacyGenerationStamp(long stamp)
public long getLegacyGenerationStamp()
public void setGenerationStamp(long stamp)
public void setImpendingGenerationStamp(long stamp)
stamp
- new genstamppublic void applyImpendingGenerationStamp()
public long getImpendingGenerationStamp()
public void setGenerationStampIfGreater(long stamp)
stamp
- public long getGenerationStamp()
public long getLegacyGenerationStampLimit()
public boolean isStripedBlock(org.apache.hadoop.hdfs.protocol.Block block)
detecting legacy block IDs.
public static boolean isStripedBlockID(long id)
isStripedBlock(Block)
, we should not use this function alone
to determine a block is striped block.public static byte getBlockIndex(org.apache.hadoop.hdfs.protocol.Block reportedBlock)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.