Distributed mapping and lookup with Spark
Although the effect depends on your data set and operations, here are options I come up with

Optimize text format (Avro, Kryo etc) so that hashmap can build quickly
Combine the files into one HDFS file and increase block replication factor of the file, so that many Spark executors can get read the files locally
Use Spark broadcast variables for the hashmap so that executors don't need to deserialize it
I need to build a hashmap using text files and map values using that hashmap.
The files are already in HDFS.
I want to map data using this hashmap.
The text files are fairly small (I have around 10 files each few MB that I need to use for building the hashmap). 
If the files are already on HDFS is there anything else that I can do to optimize the processing, so that building the hashmap and the lookup will happen in a distributed fashion?