Thanks Hairong for the review comments.
1. Fixed indentation in a few places.
2. Yes, I agree with you that we need to check the pendingReplication queue too. I added this change. This was a good catch! Thanks.
3. I changed the variable name from nonCommisiionedNodeList to nodeList. I did not create a static class (yet) for the return values. If you feel strongly about it, then I can do it. Please let me know.
4. I agree that the test should pick the a node that has some blocks to be decommissioned. Without changing MiniCluster, one way to go about it is to make getFileHints() return the hostname and the port of the datanode on which the block resides. The test can decommission only that node on which a block resides. Currently, getFileHints() returns only the hostname of the datanode. As part of hadoop-1296, we can make the getFileHints() return the port number. And then I can modify the test to decommission a node only if it has blocks on it. I will add this comment to hadoop-1296.