def whole_text_files(path, min_partitions=nil, serializer=nil)
      min_partitions ||= default_parallelism
      serializer     ||= default_serializer
      deserializer     = Spark::Serializer.build{ __pair__(__text__, __text__) }

      Spark::RDD.new(@jcontext.wholeTextFiles(path, min_partitions), self, serializer, deserializer)
    end
def whole_text_files(path, min_partitions=nil, serializer=nil)
      min_partitions ||= default_parallelism
      serializer     ||= default_serializer
      deserializer     = Spark::Serializer.build{ __pair__(__text__, __text__) }

      Spark::RDD.new(@jcontext.wholeTextFiles(path, min_partitions), self, serializer, deserializer)
    end
Read a directory of text files from HDFS, a local file system (available on all nodes), or any
 Hadoop-supported file system URI. Each file is read as a single record and returned in a
 key-value pair, where the key is the path of each file, the value is the content of each file.

 == Example:
   dir = Dir.mktmpdir
   f1 = Tempfile.new("test1", dir)
   f2 = Tempfile.new("test2", dir)
   f1.puts("1"); f1.puts("2");
   f2.puts("3"); f2.puts("4");
   f1.close
   f2.close

   $sc.whole_text_files(dir).flat_map(lambda{|key, value| value.split}).collect
   # => ["1", "2", "3", "4"]