|
@@ -1212,8 +1212,10 @@ public class BlockManager implements BlockStatsMXBean {
|
|
|
return;
|
|
|
}
|
|
|
StringBuilder datanodes = new StringBuilder();
|
|
|
- for(DatanodeStorageInfo storage : blocksMap.getStorages(storedBlock,
|
|
|
- State.NORMAL)) {
|
|
|
+ for (DatanodeStorageInfo storage : blocksMap.getStorages(storedBlock)) {
|
|
|
+ if (storage.getState() != State.NORMAL) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
final DatanodeDescriptor node = storage.getDatanodeDescriptor();
|
|
|
final Block b = getBlockOnStorage(storedBlock, storage);
|
|
|
if (b != null) {
|
|
@@ -3164,7 +3166,10 @@ public class BlockManager implements BlockStatsMXBean {
|
|
|
Collection<DatanodeStorageInfo> nonExcess = new ArrayList<>();
|
|
|
Collection<DatanodeDescriptor> corruptNodes = corruptReplicas
|
|
|
.getNodes(block);
|
|
|
- for(DatanodeStorageInfo storage : blocksMap.getStorages(block, State.NORMAL)) {
|
|
|
+ for (DatanodeStorageInfo storage : blocksMap.getStorages(block)) {
|
|
|
+ if (storage.getState() != State.NORMAL) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
final DatanodeDescriptor cur = storage.getDatanodeDescriptor();
|
|
|
if (storage.areBlockContentsStale()) {
|
|
|
LOG.trace("BLOCK* processOverReplicatedBlock: Postponing {}"
|
|
@@ -3665,7 +3670,10 @@ public class BlockManager implements BlockStatsMXBean {
|
|
|
// else proceed with fast case
|
|
|
int live = 0;
|
|
|
Collection<DatanodeDescriptor> nodesCorrupt = corruptReplicas.getNodes(b);
|
|
|
- for(DatanodeStorageInfo storage : blocksMap.getStorages(b, State.NORMAL)) {
|
|
|
+ for (DatanodeStorageInfo storage : blocksMap.getStorages(b)) {
|
|
|
+ if (storage.getState() != State.NORMAL) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
final DatanodeDescriptor node = storage.getDatanodeDescriptor();
|
|
|
if ((nodesCorrupt == null) || (!nodesCorrupt.contains(node)))
|
|
|
live++;
|