|
@@ -15,7 +15,7 @@
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/
|
|
|
-package org.apache.hadoop.hdfs.server.namenode;
|
|
|
+package org.apache.hadoop.hdfs.server.blockmanagement;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.io.PrintWriter;
|
|
@@ -39,10 +39,14 @@ import org.apache.hadoop.hdfs.protocol.BlockListAsLongs;
|
|
|
import org.apache.hadoop.hdfs.protocol.BlockListAsLongs.BlockReportIterator;
|
|
|
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
|
|
|
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
|
|
|
+import org.apache.hadoop.hdfs.server.blockmanagement.UnderReplicatedBlocks.BlockIterator;
|
|
|
import org.apache.hadoop.hdfs.server.common.HdfsConstants.BlockUCState;
|
|
|
import org.apache.hadoop.hdfs.server.common.HdfsConstants.ReplicaState;
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.FSNamesystem.NumberReplicas;
|
|
|
-import org.apache.hadoop.hdfs.server.namenode.UnderReplicatedBlocks;
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.INode;
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.INodeFile;
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.INodeFileUnderConstruction;
|
|
|
+import org.apache.hadoop.hdfs.server.namenode.NameNode;
|
|
|
|
|
|
/**
|
|
|
* Keeps information related to the blocks stored in the Hadoop cluster.
|
|
@@ -57,18 +61,43 @@ public class BlockManager {
|
|
|
|
|
|
private final FSNamesystem namesystem;
|
|
|
|
|
|
- volatile long pendingReplicationBlocksCount = 0L;
|
|
|
- volatile long corruptReplicaBlocksCount = 0L;
|
|
|
- volatile long underReplicatedBlocksCount = 0L;
|
|
|
- volatile long scheduledReplicationBlocksCount = 0L;
|
|
|
- volatile long excessBlocksCount = 0L;
|
|
|
- volatile long pendingDeletionBlocksCount = 0L;
|
|
|
+ private volatile long pendingReplicationBlocksCount = 0L;
|
|
|
+ private volatile long corruptReplicaBlocksCount = 0L;
|
|
|
+ private volatile long underReplicatedBlocksCount = 0L;
|
|
|
+ public volatile long scheduledReplicationBlocksCount = 0L;
|
|
|
+ private volatile long excessBlocksCount = 0L;
|
|
|
+ private volatile long pendingDeletionBlocksCount = 0L;
|
|
|
|
|
|
- //
|
|
|
- // Mapping: Block -> { INode, datanodes, self ref }
|
|
|
- // Updated only in response to client-sent information.
|
|
|
- //
|
|
|
- final BlocksMap blocksMap;
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getPendingReplicationBlocksCount() {
|
|
|
+ return pendingReplicationBlocksCount;
|
|
|
+ }
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getUnderReplicatedBlocksCount() {
|
|
|
+ return underReplicatedBlocksCount;
|
|
|
+ }
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getCorruptReplicaBlocksCount() {
|
|
|
+ return corruptReplicaBlocksCount;
|
|
|
+ }
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getScheduledReplicationBlocksCount() {
|
|
|
+ return scheduledReplicationBlocksCount;
|
|
|
+ }
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getPendingDeletionBlocksCount() {
|
|
|
+ return pendingDeletionBlocksCount;
|
|
|
+ }
|
|
|
+ /** Used by metrics */
|
|
|
+ public long getExcessBlocksCount() {
|
|
|
+ return excessBlocksCount;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Mapping: Block -> { INode, datanodes, self ref }
|
|
|
+ * Updated only in response to client-sent information.
|
|
|
+ */
|
|
|
+ public final BlocksMap blocksMap;
|
|
|
|
|
|
//
|
|
|
// Store blocks-->datanodedescriptor(s) map of corrupt replicas
|
|
@@ -90,24 +119,24 @@ public class BlockManager {
|
|
|
// eventually remove these extras.
|
|
|
// Mapping: StorageID -> TreeSet<Block>
|
|
|
//
|
|
|
- Map<String, Collection<Block>> excessReplicateMap =
|
|
|
+ public final Map<String, Collection<Block>> excessReplicateMap =
|
|
|
new TreeMap<String, Collection<Block>>();
|
|
|
|
|
|
//
|
|
|
// Store set of Blocks that need to be replicated 1 or more times.
|
|
|
// We also store pending replication-orders.
|
|
|
//
|
|
|
- UnderReplicatedBlocks neededReplications = new UnderReplicatedBlocks();
|
|
|
+ public UnderReplicatedBlocks neededReplications = new UnderReplicatedBlocks();
|
|
|
private PendingReplicationBlocks pendingReplications;
|
|
|
|
|
|
// The maximum number of replicas allowed for a block
|
|
|
- int maxReplication;
|
|
|
+ public int maxReplication;
|
|
|
// How many outgoing replication streams a given node should have at one time
|
|
|
- int maxReplicationStreams;
|
|
|
+ public int maxReplicationStreams;
|
|
|
// Minimum copies needed or else write is disallowed
|
|
|
- int minReplication;
|
|
|
+ public int minReplication;
|
|
|
// Default number of replicas
|
|
|
- int defaultReplication;
|
|
|
+ public int defaultReplication;
|
|
|
// How many entries are returned by getCorruptInodes()
|
|
|
int maxCorruptFilesReturned;
|
|
|
|
|
@@ -121,9 +150,9 @@ public class BlockManager {
|
|
|
Random r = new Random();
|
|
|
|
|
|
// for block replicas placement
|
|
|
- BlockPlacementPolicy replicator;
|
|
|
+ public BlockPlacementPolicy replicator;
|
|
|
|
|
|
- BlockManager(FSNamesystem fsn, Configuration conf) throws IOException {
|
|
|
+ public BlockManager(FSNamesystem fsn, Configuration conf) throws IOException {
|
|
|
this(fsn, conf, DEFAULT_INITIAL_MAP_CAPACITY);
|
|
|
}
|
|
|
|
|
@@ -178,16 +207,16 @@ public class BlockManager {
|
|
|
FSNamesystem.LOG.info("shouldCheckForEnoughRacks = " + shouldCheckForEnoughRacks);
|
|
|
}
|
|
|
|
|
|
- void activate() {
|
|
|
+ public void activate() {
|
|
|
pendingReplications.start();
|
|
|
}
|
|
|
|
|
|
- void close() {
|
|
|
+ public void close() {
|
|
|
if (pendingReplications != null) pendingReplications.stop();
|
|
|
blocksMap.close();
|
|
|
}
|
|
|
|
|
|
- void metaSave(PrintWriter out) {
|
|
|
+ public void metaSave(PrintWriter out) {
|
|
|
//
|
|
|
// Dump contents of neededReplication
|
|
|
//
|
|
@@ -249,7 +278,7 @@ public class BlockManager {
|
|
|
* @param block
|
|
|
* @return true if the block has minimum replicas
|
|
|
*/
|
|
|
- boolean checkMinReplication(Block block) {
|
|
|
+ public boolean checkMinReplication(Block block) {
|
|
|
return (countNodes(block).liveReplicas() >= minReplication);
|
|
|
}
|
|
|
|
|
@@ -297,7 +326,7 @@ public class BlockManager {
|
|
|
* @throws IOException if the block does not have at least a minimal number
|
|
|
* of replicas reported from data-nodes.
|
|
|
*/
|
|
|
- void commitOrCompleteLastBlock(INodeFileUnderConstruction fileINode,
|
|
|
+ public void commitOrCompleteLastBlock(INodeFileUnderConstruction fileINode,
|
|
|
Block commitBlock) throws IOException {
|
|
|
|
|
|
if(commitBlock == null)
|
|
@@ -362,7 +391,7 @@ public class BlockManager {
|
|
|
* @param fileINode file
|
|
|
* @return the last block locations if the block is partial or null otherwise
|
|
|
*/
|
|
|
- LocatedBlock convertLastBlockToUnderConstruction(
|
|
|
+ public LocatedBlock convertLastBlockToUnderConstruction(
|
|
|
INodeFileUnderConstruction fileINode) throws IOException {
|
|
|
BlockInfo oldBlock = fileINode.getLastBlock();
|
|
|
if(oldBlock == null ||
|
|
@@ -393,7 +422,7 @@ public class BlockManager {
|
|
|
/**
|
|
|
* Get all valid locations of the block
|
|
|
*/
|
|
|
- ArrayList<String> getValidLocations(Block block) {
|
|
|
+ public ArrayList<String> getValidLocations(Block block) {
|
|
|
ArrayList<String> machineSet =
|
|
|
new ArrayList<String>(blocksMap.numNodes(block));
|
|
|
for(Iterator<DatanodeDescriptor> it =
|
|
@@ -407,7 +436,7 @@ public class BlockManager {
|
|
|
return machineSet;
|
|
|
}
|
|
|
|
|
|
- List<LocatedBlock> getBlockLocations(BlockInfo[] blocks, long offset,
|
|
|
+ public List<LocatedBlock> getBlockLocations(BlockInfo[] blocks, long offset,
|
|
|
long length, int nrBlocksToReturn) throws IOException {
|
|
|
int curBlk = 0;
|
|
|
long curPos = 0, blkSize = 0;
|
|
@@ -436,11 +465,15 @@ public class BlockManager {
|
|
|
return results;
|
|
|
}
|
|
|
|
|
|
- /** @param needBlockToken
|
|
|
- * @return a LocatedBlock for the given block */
|
|
|
- LocatedBlock getBlockLocation(final BlockInfo blk, final long pos
|
|
|
+ /** @return a LocatedBlock for the given block */
|
|
|
+ public LocatedBlock getBlockLocation(final BlockInfo blk, final long pos
|
|
|
) throws IOException {
|
|
|
- if (!blk.isComplete()) {
|
|
|
+ if (blk instanceof BlockInfoUnderConstruction) {
|
|
|
+ if (blk.isComplete()) {
|
|
|
+ throw new IOException(
|
|
|
+ "blk instanceof BlockInfoUnderConstruction && blk.isComplete()"
|
|
|
+ + ", blk=" + blk);
|
|
|
+ }
|
|
|
final BlockInfoUnderConstruction uc = (BlockInfoUnderConstruction)blk;
|
|
|
final DatanodeDescriptor[] locations = uc.getExpectedLocations();
|
|
|
return namesystem.createLocatedBlock(uc, locations, pos, false);
|
|
@@ -476,7 +509,7 @@ public class BlockManager {
|
|
|
* Check whether the replication parameter is within the range
|
|
|
* determined by system configuration.
|
|
|
*/
|
|
|
- void verifyReplication(String src,
|
|
|
+ public void verifyReplication(String src,
|
|
|
short replication,
|
|
|
String clientName) throws IOException {
|
|
|
|
|
@@ -544,7 +577,7 @@ public class BlockManager {
|
|
|
* @param b block
|
|
|
* @param dn datanode
|
|
|
*/
|
|
|
- void addToInvalidates(Block b, DatanodeInfo dn) {
|
|
|
+ public void addToInvalidates(Block b, DatanodeInfo dn) {
|
|
|
addToInvalidates(b, dn, true);
|
|
|
}
|
|
|
|
|
@@ -585,7 +618,7 @@ public class BlockManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void findAndMarkBlockAsCorrupt(Block blk,
|
|
|
+ public void findAndMarkBlockAsCorrupt(Block blk,
|
|
|
DatanodeInfo dn) throws IOException {
|
|
|
BlockInfo storedBlock = getStoredBlock(blk);
|
|
|
if (storedBlock == null) {
|
|
@@ -668,14 +701,14 @@ public class BlockManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void updateState() {
|
|
|
+ public void updateState() {
|
|
|
pendingReplicationBlocksCount = pendingReplications.size();
|
|
|
underReplicatedBlocksCount = neededReplications.size();
|
|
|
corruptReplicaBlocksCount = corruptReplicas.size();
|
|
|
}
|
|
|
|
|
|
/** Return number of under-replicated but not missing blocks */
|
|
|
- int getUnderReplicatedNotMissingBlocks() {
|
|
|
+ public int getUnderReplicatedNotMissingBlocks() {
|
|
|
return neededReplications.getUnderReplicatedBlockCount();
|
|
|
}
|
|
|
|
|
@@ -684,7 +717,7 @@ public class BlockManager {
|
|
|
* @param nodesToProcess number of datanodes to schedule deletion work
|
|
|
* @return total number of block for deletion
|
|
|
*/
|
|
|
- int computeInvalidateWork(int nodesToProcess) {
|
|
|
+ public int computeInvalidateWork(int nodesToProcess) {
|
|
|
int numOfNodes = recentInvalidateSets.size();
|
|
|
nodesToProcess = Math.min(numOfNodes, nodesToProcess);
|
|
|
|
|
@@ -724,7 +757,7 @@ public class BlockManager {
|
|
|
*
|
|
|
* @return number of blocks scheduled for replication during this iteration.
|
|
|
*/
|
|
|
- int computeReplicationWork(int blocksToProcess) throws IOException {
|
|
|
+ public int computeReplicationWork(int blocksToProcess) throws IOException {
|
|
|
// Choose the blocks to be replicated
|
|
|
List<List<Block>> blocksToReplicate =
|
|
|
chooseUnderReplicatedBlocks(blocksToProcess);
|
|
@@ -1031,7 +1064,7 @@ public class BlockManager {
|
|
|
* If there were any replication requests that timed out, reap them
|
|
|
* and put them back into the neededReplication queue
|
|
|
*/
|
|
|
- void processPendingReplications() {
|
|
|
+ public void processPendingReplications() {
|
|
|
Block[] timedOutItems = pendingReplications.getTimedOutBlocks();
|
|
|
if (timedOutItems != null) {
|
|
|
namesystem.writeLock();
|
|
@@ -1464,7 +1497,7 @@ public class BlockManager {
|
|
|
short fileReplication = fileINode.getReplication();
|
|
|
if (!isNeededReplication(storedBlock, fileReplication, numCurrentReplica)) {
|
|
|
neededReplications.remove(storedBlock, numCurrentReplica,
|
|
|
- num.decommissionedReplicas, fileReplication);
|
|
|
+ num.decommissionedReplicas(), fileReplication);
|
|
|
} else {
|
|
|
updateNeededReplications(storedBlock, curReplicaDelta, 0);
|
|
|
}
|
|
@@ -1525,7 +1558,7 @@ public class BlockManager {
|
|
|
* For each block in the name-node verify whether it belongs to any file,
|
|
|
* over or under replicated. Place it into the respective queue.
|
|
|
*/
|
|
|
- void processMisReplicatedBlocks() {
|
|
|
+ public void processMisReplicatedBlocks() {
|
|
|
long nrInvalid = 0, nrOverReplicated = 0, nrUnderReplicated = 0;
|
|
|
namesystem.writeLock();
|
|
|
try {
|
|
@@ -1570,7 +1603,7 @@ public class BlockManager {
|
|
|
* If there are any extras, call chooseExcessReplicates() to
|
|
|
* mark them in the excessReplicateMap.
|
|
|
*/
|
|
|
- void processOverReplicatedBlock(Block block, short replication,
|
|
|
+ public void processOverReplicatedBlock(Block block, short replication,
|
|
|
DatanodeDescriptor addedNode, DatanodeDescriptor delNodeHint) {
|
|
|
assert namesystem.hasWriteLock();
|
|
|
if (addedNode == delNodeHint) {
|
|
@@ -1597,7 +1630,7 @@ public class BlockManager {
|
|
|
addedNode, delNodeHint, replicator);
|
|
|
}
|
|
|
|
|
|
- void addToExcessReplicate(DatanodeInfo dn, Block block) {
|
|
|
+ public void addToExcessReplicate(DatanodeInfo dn, Block block) {
|
|
|
assert namesystem.hasWriteLock();
|
|
|
Collection<Block> excessBlocks = excessReplicateMap.get(dn.getStorageID());
|
|
|
if (excessBlocks == null) {
|
|
@@ -1618,7 +1651,7 @@ public class BlockManager {
|
|
|
* Modify (block-->datanode) map. Possibly generate replication tasks, if the
|
|
|
* removed block is still valid.
|
|
|
*/
|
|
|
- void removeStoredBlock(Block block, DatanodeDescriptor node) {
|
|
|
+ public void removeStoredBlock(Block block, DatanodeDescriptor node) {
|
|
|
if(NameNode.stateChangeLog.isDebugEnabled()) {
|
|
|
NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: "
|
|
|
+ block + " from " + node.getName());
|
|
@@ -1673,7 +1706,7 @@ public class BlockManager {
|
|
|
/**
|
|
|
* The given node is reporting that it received a certain block.
|
|
|
*/
|
|
|
- void addBlock(DatanodeDescriptor node, Block block, String delHint)
|
|
|
+ public void addBlock(DatanodeDescriptor node, Block block, String delHint)
|
|
|
throws IOException {
|
|
|
// decrement number of blocks scheduled to this datanode.
|
|
|
node.decBlocksScheduled();
|
|
@@ -1726,7 +1759,7 @@ public class BlockManager {
|
|
|
/**
|
|
|
* Return the number of nodes that are live and decommissioned.
|
|
|
*/
|
|
|
- NumberReplicas countNodes(Block b) {
|
|
|
+ public NumberReplicas countNodes(Block b) {
|
|
|
int count = 0;
|
|
|
int live = 0;
|
|
|
int corrupt = 0;
|
|
@@ -1805,7 +1838,7 @@ public class BlockManager {
|
|
|
* Return true if there are any blocks on this node that have not
|
|
|
* yet reached their replication factor. Otherwise returns false.
|
|
|
*/
|
|
|
- boolean isReplicationInProgress(DatanodeDescriptor srcNode) {
|
|
|
+ public boolean isReplicationInProgress(DatanodeDescriptor srcNode) {
|
|
|
boolean status = false;
|
|
|
int underReplicatedBlocks = 0;
|
|
|
int decommissionOnlyReplicas = 0;
|
|
@@ -1855,11 +1888,11 @@ public class BlockManager {
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
- int getActiveBlockCount() {
|
|
|
+ public int getActiveBlockCount() {
|
|
|
return blocksMap.size() - (int)pendingDeletionBlocksCount;
|
|
|
}
|
|
|
|
|
|
- DatanodeDescriptor[] getNodes(BlockInfo block) {
|
|
|
+ public DatanodeDescriptor[] getNodes(BlockInfo block) {
|
|
|
DatanodeDescriptor[] nodes =
|
|
|
new DatanodeDescriptor[block.numNodes()];
|
|
|
Iterator<DatanodeDescriptor> it = blocksMap.nodeIterator(block);
|
|
@@ -1869,22 +1902,22 @@ public class BlockManager {
|
|
|
return nodes;
|
|
|
}
|
|
|
|
|
|
- int getTotalBlocks() {
|
|
|
+ public int getTotalBlocks() {
|
|
|
return blocksMap.size();
|
|
|
}
|
|
|
|
|
|
- void removeBlock(Block block) {
|
|
|
+ public void removeBlock(Block block) {
|
|
|
addToInvalidates(block);
|
|
|
corruptReplicas.removeFromCorruptReplicasMap(block);
|
|
|
blocksMap.removeBlock(block);
|
|
|
}
|
|
|
|
|
|
- BlockInfo getStoredBlock(Block block) {
|
|
|
+ public BlockInfo getStoredBlock(Block block) {
|
|
|
return blocksMap.getStoredBlock(block);
|
|
|
}
|
|
|
|
|
|
/* updates a block in under replication queue */
|
|
|
- void updateNeededReplications(Block block, int curReplicasDelta,
|
|
|
+ public void updateNeededReplications(Block block, int curReplicasDelta,
|
|
|
int expectedReplicasDelta) {
|
|
|
namesystem.writeLock();
|
|
|
try {
|
|
@@ -1905,13 +1938,13 @@ public class BlockManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void checkReplication(Block block, int numExpectedReplicas) {
|
|
|
+ public void checkReplication(Block block, int numExpectedReplicas) {
|
|
|
// filter out containingNodes that are marked for decommission.
|
|
|
NumberReplicas number = countNodes(block);
|
|
|
if (isNeededReplication(block, numExpectedReplicas, number.liveReplicas())) {
|
|
|
neededReplications.add(block,
|
|
|
number.liveReplicas(),
|
|
|
- number.decommissionedReplicas,
|
|
|
+ number.decommissionedReplicas(),
|
|
|
numExpectedReplicas);
|
|
|
}
|
|
|
}
|
|
@@ -1926,11 +1959,8 @@ public class BlockManager {
|
|
|
return fileINode.getReplication();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Remove a datanode from the invalidatesSet
|
|
|
- * @param n datanode
|
|
|
- */
|
|
|
- void removeFromInvalidates(String storageID) {
|
|
|
+ /** Remove a datanode from the invalidatesSet */
|
|
|
+ public void removeFromInvalidates(String storageID) {
|
|
|
Collection<Block> blocks = recentInvalidateSets.remove(storageID);
|
|
|
if (blocks != null) {
|
|
|
pendingDeletionBlocksCount -= blocks.size();
|
|
@@ -1998,7 +2028,7 @@ public class BlockManager {
|
|
|
//Returns the number of racks over which a given block is replicated
|
|
|
//decommissioning/decommissioned nodes are not counted. corrupt replicas
|
|
|
//are also ignored
|
|
|
- int getNumberOfRacks(Block b) {
|
|
|
+ public int getNumberOfRacks(Block b) {
|
|
|
HashSet<String> rackSet = new HashSet<String>(0);
|
|
|
Collection<DatanodeDescriptor> corruptNodes =
|
|
|
corruptReplicas.getNodes(b);
|
|
@@ -2056,32 +2086,32 @@ public class BlockManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- long getMissingBlocksCount() {
|
|
|
+ public long getMissingBlocksCount() {
|
|
|
// not locking
|
|
|
return this.neededReplications.getCorruptBlockSize();
|
|
|
}
|
|
|
|
|
|
- BlockInfo addINode(BlockInfo block, INodeFile iNode) {
|
|
|
+ public BlockInfo addINode(BlockInfo block, INodeFile iNode) {
|
|
|
return blocksMap.addINode(block, iNode);
|
|
|
}
|
|
|
|
|
|
- INodeFile getINode(Block b) {
|
|
|
+ public INodeFile getINode(Block b) {
|
|
|
return blocksMap.getINode(b);
|
|
|
}
|
|
|
|
|
|
- void removeFromCorruptReplicasMap(Block block) {
|
|
|
+ public void removeFromCorruptReplicasMap(Block block) {
|
|
|
corruptReplicas.removeFromCorruptReplicasMap(block);
|
|
|
}
|
|
|
|
|
|
- int numCorruptReplicas(Block block) {
|
|
|
+ public int numCorruptReplicas(Block block) {
|
|
|
return corruptReplicas.numCorruptReplicas(block);
|
|
|
}
|
|
|
|
|
|
- void removeBlockFromMap(Block block) {
|
|
|
+ public void removeBlockFromMap(Block block) {
|
|
|
blocksMap.removeBlock(block);
|
|
|
}
|
|
|
|
|
|
- int getCapacity() {
|
|
|
+ public int getCapacity() {
|
|
|
namesystem.readLock();
|
|
|
try {
|
|
|
return blocksMap.getCapacity();
|
|
@@ -2104,7 +2134,7 @@ public class BlockManager {
|
|
|
* @return Up to numExpectedBlocks blocks from startingBlockId if it exists
|
|
|
*
|
|
|
*/
|
|
|
- long[] getCorruptReplicaBlockIds(int numExpectedBlocks,
|
|
|
+ public long[] getCorruptReplicaBlockIds(int numExpectedBlocks,
|
|
|
Long startingBlockId) {
|
|
|
return corruptReplicas.getCorruptReplicaBlockIds(numExpectedBlocks,
|
|
|
startingBlockId);
|
|
@@ -2113,7 +2143,7 @@ public class BlockManager {
|
|
|
/**
|
|
|
* Return an iterator over the set of blocks for which there are no replicas.
|
|
|
*/
|
|
|
- UnderReplicatedBlocks.BlockIterator getCorruptReplicaBlockIterator() {
|
|
|
+ public BlockIterator getCorruptReplicaBlockIterator() {
|
|
|
return neededReplications
|
|
|
.iterator(UnderReplicatedBlocks.QUEUE_WITH_CORRUPT_BLOCKS);
|
|
|
}
|