Thanks for working on this Huafeng Wang this looks really, really good. I only have some minor comments:
- Looking through the users of NamenodeProxies, we can remove the method in DfsServlet that calls it since it's unused.
- NNProxiesClient#createFPP with a proxy factory can be made package private, no need for VisibleForTesting either.
- Recommend rename HAProxyFactoryClient to ClientHAProxyFactory to unify naming with NameNodeHAProxyFactory
- Don't need to fix the existing whitespace and checkstyle issues, but we should at least fix the unused imports from moving code around
I would like to see some client unit tests that show we can instantiate the failover proxies without a hadoop-hdfs dependency. TestIsMethodSupported looks like a good place to start.
Unfortunately, we heavily depend on miniclusters for testing, which makes splitting the unit test suite very challenging. Maybe this can be addressed by using the shaded minicluster (or lots of mocking), but I think it's too big a lift to pursue in this change. I still think it'd be a really great follow-on JIRA though.