|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicy
@InterfaceAudience.Private public abstract class BlockPlacementPolicy
This interface is used for choosing the desired number of targets for placing block replicas.
| Nested Class Summary | |
|---|---|
static class |
BlockPlacementPolicy.NotEnoughReplicasException
|
| Constructor Summary | |
|---|---|
BlockPlacementPolicy()
|
|
| Method Summary | |
|---|---|
abstract DatanodeDescriptor |
chooseReplicaToDelete(FSInodeInfo srcInode,
Block block,
short replicationFactor,
Collection<DatanodeDescriptor> existingReplicas,
Collection<DatanodeDescriptor> moreExistingReplicas)
Decide whether deleting the specified replica of the block still makes the block conform to the configured block placement policy. |
static BlockPlacementPolicy |
getInstance(org.apache.hadoop.conf.Configuration conf,
FSClusterStats stats,
org.apache.hadoop.net.NetworkTopology clusterMap)
Get an instance of the configured Block Placement Policy based on the value of the configuration paramater dfs.block.replicator.classname. |
protected abstract void |
initialize(org.apache.hadoop.conf.Configuration conf,
FSClusterStats stats,
org.apache.hadoop.net.NetworkTopology clusterMap)
Used to setup a BlockPlacementPolicy object. |
abstract int |
verifyBlockPlacement(String srcPath,
LocatedBlock lBlk,
int minRacks)
Verify that the block is replicated on at least minRacks different racks if there is more than minRacks rack in the system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockPlacementPolicy()
| Method Detail |
|---|
public abstract int verifyBlockPlacement(String srcPath,
LocatedBlock lBlk,
int minRacks)
srcPath - the full pathname of the file to be verifiedlBlk - block with locationsminRacks - number of racks the block should be replicated to
public abstract DatanodeDescriptor chooseReplicaToDelete(FSInodeInfo srcInode,
Block block,
short replicationFactor,
Collection<DatanodeDescriptor> existingReplicas,
Collection<DatanodeDescriptor> moreExistingReplicas)
srcInode - The inode of the file to which the block-to-be-deleted belongsblock - The block to be deletedreplicationFactor - The required number of replicas for this blockexistingReplicas - The replica locations of this block that are present
on at least two unique racks.moreExistingReplicas - Replica locations of this block that are not
listed in the previous parameter.
protected abstract void initialize(org.apache.hadoop.conf.Configuration conf,
FSClusterStats stats,
org.apache.hadoop.net.NetworkTopology clusterMap)
conf - the configuration objectstats - retrieve cluster status from hereclusterMap - cluster topology
public static BlockPlacementPolicy getInstance(org.apache.hadoop.conf.Configuration conf,
FSClusterStats stats,
org.apache.hadoop.net.NetworkTopology clusterMap)
conf - the configuration to be usedstats - an object that is used to retrieve the load on the clusterclusterMap - the network topology of the cluster
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||