Attached patch applies on top of
HDFS-1971. I broke out BlockPoolManager to a new file so I could easily add true unit tests against mocks. I ran all of the tests that call refreshNameNodes or call MiniDFSCluster.addNameNode, and they passed.
I elected not to support changing the set of NNs within a namespace - you can only add or remove namespaces. Converting a namespace from non-HA to HA will require a restart. But I think that's fine for a first implementation, and we can always add that feature later if need be.