SPARK-1767: Prefer HDFS-cached replicas when scheduling data-local tasks

This change reorders the replicas returned by
HadoopRDD#getPreferredLocations so that replicas cached by HDFS are at
the start of the list.  This requires Hadoop 2.5 or higher; previous
versions of Hadoop do not expose the information needed to determine
whether a replica is cached.
Underscores are not allowed in hostnames.  The hostname format was specified in RFC 952 and later updated in RFC 1123.  Legend has it that the underscore was not allowed because a popular teletype unit at the time didn't have an underscore key and the goal was interoperability.  I assume your reference to URIs was a typo since there's no URIs in this file.

I'll lowercase the constants.