concept wholeTextFiles in category graphx
appears as: wholeTextFiles

This is an excerpt from Manning's book Spark GraphX in Action.
As with many real-world problems, we have to accept the input in the format it is given to us and convert that input into the structures we need to create graphs. In this case, the input data is not in a single convenient file but rather is scattered across the files of a directory. Luckily we can use a method on SparkContext called wholeTextFiles to read the contents of a folder into an RDD:
val egonets = sc.wholeTextFiles("socialcircles/data/egonets")wholeTextFiles returns a PairRDD with one element for each file; the key is the folder path to the file, and the value is the contents of the file (see figure 5.9).