Add support for HDFS federation #227
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes now enforce proper HDFS federation/HA configurations. Specifically:
HA and federated configuration takes precedence such that if a property like dfs.nameservices is present, default clients will not use a sole namenode rpc address defined by dfs.namenode.rpc-address alone.
I'm sorry I haven't written any additional tests; I haven't had the time to set up an image on which to run a minicluster. If you have an idea for easily setting up a testing environment I'd be happy to try it. I think the tests (or testing environment) might actually need some rework to match upstream hadoop client behavior.
I tried not to be too opinionated but some of these changes did break previous behavior. This was done to match the behavior I observed from the
hadoop fs
command, which I used as a generalization for upstream hadoop client behavior. For example, a namenode specified throughdfs.namenode.rpc-address.NAMESERVICE.NNID
will no longer be returned fromNamenodes
orDefaultNamenodes
unless that nameservice and namenode id are present indfs.nameservices
anddfs.ha.namenodes.NAMESERVICE
, respectively. This should close #225, however.Let me know what you think.