def text_file(path, min_partitions=nil, encoding=Encoding::UTF_8, serializer=nil)
      min_partitions ||= default_parallelism
      serializer     ||= default_serializer
      deserializer     = Spark::Serializer.build { __text__(encoding) }

      Spark::RDD.new(@jcontext.textFile(path, min_partitions), self, serializer, deserializer)
    end
def text_file(path, min_partitions=nil, encoding=Encoding::UTF_8, serializer=nil)
      min_partitions ||= default_parallelism
      serializer     ||= default_serializer
      deserializer     = Spark::Serializer.build { __text__(encoding) }

      Spark::RDD.new(@jcontext.textFile(path, min_partitions), self, serializer, deserializer)
    end
Read a text file from HDFS, a local file system (available on all nodes), or any
 Hadoop-supported file system URI, and return it as an RDD of Strings.

 == Example:
   f = Tempfile.new("test")
   f.puts("1")
   f.puts("2")
   f.close

   $sc.text_file(f.path).map(lambda{|x| x.to_i}).collect
   # => [1, 2]