HDFS-8682. Should not remove decommissioned node,while calculating the number of live/dead decommissioned node. (Contributed by J. Andreina)

This commit is contained in:
Vinayakumar B 2015-08-27 13:06:43 +05:30
parent 4cbbfa2220
commit fdb56f74f3
2 changed files with 5 additions and 2 deletions

View File

@ -1228,6 +1228,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8932. NPE thrown in NameNode when try to get TotalSyncCount metric HDFS-8932. NPE thrown in NameNode when try to get TotalSyncCount metric
before editLogStream initialization. (Surendra Singh Lilhore via xyao) before editLogStream initialization. (Surendra Singh Lilhore via xyao)
HDFS-8682. Should not remove decommissioned node,while calculating the
number of live/dead decommissioned node. (J. Andreina via vinayakumarb)
Release 2.7.2 - UNRELEASED Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -5070,7 +5070,7 @@ public int getNumDeadDataNodes() {
@Override // FSNamesystemMBean @Override // FSNamesystemMBean
public int getNumDecomLiveDataNodes() { public int getNumDecomLiveDataNodes() {
final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>(); final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
getBlockManager().getDatanodeManager().fetchDatanodes(live, null, true); getBlockManager().getDatanodeManager().fetchDatanodes(live, null, false);
int liveDecommissioned = 0; int liveDecommissioned = 0;
for (DatanodeDescriptor node : live) { for (DatanodeDescriptor node : live) {
liveDecommissioned += node.isDecommissioned() ? 1 : 0; liveDecommissioned += node.isDecommissioned() ? 1 : 0;
@ -5081,7 +5081,7 @@ public int getNumDecomLiveDataNodes() {
@Override // FSNamesystemMBean @Override // FSNamesystemMBean
public int getNumDecomDeadDataNodes() { public int getNumDecomDeadDataNodes() {
final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>(); final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>();
getBlockManager().getDatanodeManager().fetchDatanodes(null, dead, true); getBlockManager().getDatanodeManager().fetchDatanodes(null, dead, false);
int deadDecommissioned = 0; int deadDecommissioned = 0;
for (DatanodeDescriptor node : dead) { for (DatanodeDescriptor node : dead) {
deadDecommissioned += node.isDecommissioned() ? 1 : 0; deadDecommissioned += node.isDecommissioned() ? 1 : 0;