HDFS-13541 implemented based selective encryption in the Namenode.
This feature allows HDFS to selectively enforce encryption for both RPC (NameNode) and data transfer (DataNode).
With this feature enabled, NameNode can listen on multiple ports, and different ports can have different security
configurations. Depending on which NameNode port clients connect to, the RPC calls and the following data transfer
will enforce security configuration corresponding to this NameNode port. This can help when there is requirement
to enforce different security policies depending on the location where the clients are connecting from.
This ability for selective encryption should still be available to clients when they connect to routers instead of directly to the namenode.
This implemented can leverage a lot of the code written for the Namenode selective port based encryption. A lot of the changes are in hadoop-common, eg.