@@ -21,18 +21,14 @@ import java.io.Closeable
2121import java .util
2222import java .util .{Map => JMap }
2323
24- import java .io .DataInputStream
25-
26- import org .apache .hadoop .io .{BytesWritable , LongWritable }
27- import org .apache .spark .input .{PortableDataStream , FixedLengthBinaryInputFormat }
28-
2924import scala .collection .JavaConversions
3025import scala .collection .JavaConversions ._
3126import scala .language .implicitConversions
3227import scala .reflect .ClassTag
3328
3429import com .google .common .base .Optional
3530import org .apache .hadoop .conf .Configuration
31+ import org .apache .spark .input .PortableDataStream
3632import org .apache .hadoop .mapred .{InputFormat , JobConf }
3733import org .apache .hadoop .mapreduce .{InputFormat => NewInputFormat }
3834
@@ -286,6 +282,8 @@ class JavaSparkContext(val sc: SparkContext)
286282 new JavaPairRDD (sc.binaryFiles(path, minPartitions))
287283
288284 /**
285+ * :: Experimental ::
286+ *
289287 * Read a directory of binary files from HDFS, a local file system (available on all nodes),
290288 * or any Hadoop-supported file system URI as a byte array. Each file is read as a single
291289 * record and returned in a key-value pair, where the key is the path of each file,
@@ -312,15 +310,19 @@ class JavaSparkContext(val sc: SparkContext)
312310 *
313311 * @note Small files are preferred; very large files but may cause bad performance.
314312 */
313+ @ Experimental
315314 def binaryFiles (path : String ): JavaPairRDD [String , PortableDataStream ] =
316315 new JavaPairRDD (sc.binaryFiles(path, defaultMinPartitions))
317316
318317 /**
318+ * :: Experimental ::
319+ *
319320 * Load data from a flat binary file, assuming the length of each record is constant.
320321 *
321322 * @param path Directory to the input data files
322323 * @return An RDD of data with values, represented as byte arrays
323324 */
325+ @ Experimental
324326 def binaryRecords (path : String , recordLength : Int ): JavaRDD [Array [Byte ]] = {
325327 new JavaRDD (sc.binaryRecords(path, recordLength))
326328 }
0 commit comments