Skip to content

Commit 1622935

Browse files
committed
changing the line lengths to make jenkins happy
1 parent 1cfa38a commit 1622935

File tree

4 files changed

+48
-40
lines changed

4 files changed

+48
-40
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class SparkContext(config: SparkConf) extends Logging {
289289
value <- Option(System.getenv(envKey)).orElse(Option(System.getProperty(propKey)))} {
290290
executorEnvs(envKey) = value
291291
}
292-
Option(System.getenv("SPARK_PREPEND_CLASSES")).foreach { v =>
292+
Option(System.getenv("SPARK_PREPEND_CLASSES")).foreach { v =>
293293
executorEnvs("SPARK_PREPEND_CLASSES") = v
294294
}
295295
// The Mesos scheduler backend relies on this environment variable to set executor memory.
@@ -511,13 +511,15 @@ class SparkContext(config: SparkConf) extends Logging {
511511
}
512512

513513
/**
514-
* Get an RDD for a Hadoop-readable dataset as byte-streams for each file (useful for binary data)
514+
* Get an RDD for a Hadoop-readable dataset as byte-streams for each file
515+
* (useful for binary data)
515516
*
516517
* @param minPartitions A suggestion value of the minimal splitting number for input data.
517518
*
518519
* @note Small files are preferred, large file is also allowable, but may cause bad performance.
519520
*/
520-
def binaryFiles(path: String, minPartitions: Int = defaultMinPartitions): RDD[(String, Array[Byte])] = {
521+
def binaryFiles(path: String, minPartitions: Int = defaultMinPartitions):
522+
RDD[(String, Array[Byte])] = {
521523
val job = new NewHadoopJob(hadoopConfiguration)
522524
NewFileInputFormat.addInputPath(job, new Path(path))
523525
val updateConf = job.getConfiguration
@@ -531,15 +533,18 @@ class SparkContext(config: SparkConf) extends Logging {
531533
}
532534

533535
/**
534-
* Get an RDD for a Hadoop-readable dataset as DataInputStreams for each file (useful for binary data)
535-
* Care must be taken to close the files afterwards
536+
* Get an RDD for a Hadoop-readable dataset as DataInputStreams for each file
537+
* (useful for binary data)
538+
*
536539
*
537540
* @param minPartitions A suggestion value of the minimal splitting number for input data.
538541
*
542+
* @note Care must be taken to close the files afterwards
539543
* @note Small files are preferred, large file is also allowable, but may cause bad performance.
540544
*/
541545
@DeveloperApi
542-
def dataStreamFiles(path: String, minPartitions: Int = defaultMinPartitions): RDD[(String, DataInputStream)] = {
546+
def dataStreamFiles(path: String, minPartitions: Int = defaultMinPartitions):
547+
RDD[(String, DataInputStream)] = {
543548
val job = new NewHadoopJob(hadoopConfiguration)
544549
NewFileInputFormat.addInputPath(job, new Path(path))
545550
val updateConf = job.getConfiguration
@@ -1250,7 +1255,7 @@ class SparkContext(config: SparkConf) extends Logging {
12501255
* If <tt>checkSerializable</tt> is set, <tt>clean</tt> will also proactively
12511256
* check to see if <tt>f</tt> is serializable and throw a <tt>SparkException</tt>
12521257
* if not.
1253-
*
1258+
*
12541259
* @param f the closure to clean
12551260
* @param checkSerializable whether or not to immediately check <tt>f</tt> for serializability
12561261
* @throws <tt>SparkException<tt> if <tt>checkSerializable</tt> is set but <tt>f</tt> is not

core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
215215
new JavaPairRDD(sc.wholeTextFiles(path, minPartitions))
216216

217217
/**
218-
* Read a directory of binary files from HDFS, a local file system (available on all nodes), or any
219-
* Hadoop-supported file system URI as a byte array. Each file is read as a single record and returned in a
220-
* key-value pair, where the key is the path of each file, the value is the content of each file.
218+
* Read a directory of binary files from HDFS, a local file system (available on all nodes),
219+
* or any Hadoop-supported file system URI as a byte array. Each file is read as a single
220+
* record and returned in a key-value pair, where the key is the path of each file,
221+
* the value is the content of each file.
221222
*
222223
* <p> For example, if you have the following files:
223224
* {{{
@@ -227,7 +228,8 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
227228
* hdfs://a-hdfs-path/part-nnnnn
228229
* }}}
229230
*
230-
* Do `JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path")`,
231+
* Do
232+
* `JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path")`,
231233
*
232234
* <p> then `rdd` contains
233235
* {{{
@@ -241,13 +243,14 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
241243
*
242244
* @param minPartitions A suggestion value of the minimal splitting number for input data.
243245
*/
244-
def dataStreamFiles(path: String, minPartitions: Int = defaultMinPartitions): JavaPairRDD[String,DataInputStream] =
245-
new JavaPairRDD(sc.dataStreamFiles(path,minPartitions))
246+
def dataStreamFiles(path: String, minPartitions: Int = defaultMinPartitions):
247+
JavaPairRDD[String,DataInputStream] = new JavaPairRDD(sc.dataStreamFiles(path,minPartitions))
246248

247249
/**
248-
* Read a directory of files as DataInputStreams from HDFS, a local file system (available on all nodes), or any
249-
* Hadoop-supported file system URI as a byte array. Each file is read as a single record and returned in a
250-
* key-value pair, where the key is the path of each file, the value is the content of each file.
250+
* Read a directory of files as DataInputStream from HDFS,
251+
* a local file system (available on all nodes), or any Hadoop-supported file system URI
252+
* as a byte array. Each file is read as a single record and returned in a
253+
* key-value pair, where the key is the path of each file, the value is the content of each.
251254
*
252255
* <p> For example, if you have the following files:
253256
* {{{
@@ -257,7 +260,8 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
257260
* hdfs://a-hdfs-path/part-nnnnn
258261
* }}}
259262
*
260-
* Do `JavaPairRDD<String, DataInputStream> rdd = sparkContext.binaryFiles("hdfs://a-hdfs-path")`,
263+
* Do
264+
* `JavaPairRDD<String,DataInputStream> rdd = sparkContext.binaryFiles("hdfs://a-hdfs-path")`,
261265
*
262266
* <p> then `rdd` contains
263267
* {{{
@@ -271,8 +275,8 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
271275
*
272276
* @param minPartitions A suggestion value of the minimal splitting number for input data.
273277
*/
274-
def binaryFiles(path: String, minPartitions: Int = defaultMinPartitions): JavaPairRDD[String,Array[Byte]] =
275-
new JavaPairRDD(sc.binaryFiles(path,minPartitions))
278+
def binaryFiles(path: String, minPartitions: Int = defaultMinPartitions):
279+
JavaPairRDD[String,Array[Byte]] = new JavaPairRDD(sc.binaryFiles(path,minPartitions))
276280

277281
/**
278282
* Read a directory of text files from HDFS, a local file system (available on all nodes), or any

core/src/main/scala/org/apache/spark/input/RawFileInput.scala

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import java.io.DataInputStream
3131

3232

3333
/**
34-
* A general format for reading whole files in as streams, byte arrays, or other functions to be added
34+
* A general format for reading whole files in as streams, byte arrays,
35+
* or other functions to be added
3536
*/
3637
abstract class StreamFileInputFormat[T]
3738
extends CombineFileInputFormat[String,T] {
@@ -49,12 +50,14 @@ abstract class StreamFileInputFormat[T]
4950
super.setMaxSplitSize(maxSplitSize)
5051
}
5152

52-
def createRecordReader(split: InputSplit, taContext: TaskAttemptContext): RecordReader[String,T]
53+
def createRecordReader(split: InputSplit, taContext: TaskAttemptContext):
54+
RecordReader[String,T]
5355

5456
}
5557

5658
/**
57-
* An abstract class of [[org.apache.hadoop.mapreduce.RecordReader RecordReader]] to reading files out as streams
59+
* An abstract class of [[org.apache.hadoop.mapreduce.RecordReader RecordReader]]
60+
* to reading files out as streams
5861
*/
5962
abstract class StreamBasedRecordReader[T](
6063
split: CombineFileSplit,
@@ -111,17 +114,20 @@ class StreamRecordReader(
111114
}
112115

113116
/**
114-
* A class for extracting the information from the file using the BinaryRecordReader (as Byte array)
117+
* A class for extracting the information from the file using the
118+
* BinaryRecordReader (as Byte array)
115119
*/
116120
class StreamInputFormat extends StreamFileInputFormat[DataInputStream] {
117121
override def createRecordReader(split: InputSplit, taContext: TaskAttemptContext)=
118122
{
119-
new CombineFileRecordReader[String,DataInputStream](split.asInstanceOf[CombineFileSplit],taContext,classOf[StreamRecordReader])
123+
new CombineFileRecordReader[String,DataInputStream](
124+
split.asInstanceOf[CombineFileSplit],taContext,classOf[StreamRecordReader]
125+
)
120126
}
121127
}
122128

123129
/**
124-
* A [[org.apache.hadoop.mapreduce.RecordReader RecordReader]] for reading a single whole binary file
130+
* A [[org.apache.hadoop.mapreduce.RecordReader RecordReader]] for reading a single binary file
125131
* out in a key-value pair, where the key is the file path and the value is the entire content of
126132
* the file as a byte array
127133
*/
@@ -150,12 +156,14 @@ class ByteRecordReader(
150156
}
151157

152158
/**
153-
* A class for extracting the information from the file using the BinaryRecordReader (as Byte array)
159+
* A class for reading the file using the BinaryRecordReader (as Byte array)
154160
*/
155161
class ByteInputFormat extends StreamFileInputFormat[Array[Byte]] {
156162
override def createRecordReader(split: InputSplit, taContext: TaskAttemptContext)=
157163
{
158-
new CombineFileRecordReader[String,Array[Byte]](split.asInstanceOf[CombineFileSplit],taContext,classOf[ByteRecordReader])
164+
new CombineFileRecordReader[String,Array[Byte]](
165+
split.asInstanceOf[CombineFileSplit],taContext,classOf[ByteRecordReader]
166+
)
159167
}
160168
}
161169

core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,10 @@ package org.apache.spark.rdd
2020
/** Allows better control of the partitioning
2121
*
2222
*/
23-
import java.text.SimpleDateFormat
24-
import java.util.Date
25-
2623
import org.apache.hadoop.conf.{Configurable, Configuration}
2724
import org.apache.hadoop.io.Writable
2825
import org.apache.hadoop.mapreduce._
29-
30-
import org.apache.spark.annotation.DeveloperApi
31-
import org.apache.spark.input.WholeTextFileInputFormat
32-
import org.apache.spark.InterruptibleIterator
33-
import org.apache.spark.Logging
34-
import org.apache.spark.Partition
35-
import org.apache.spark.SerializableWritable
36-
import org.apache.spark.{SparkContext, TaskContext}
37-
26+
import org.apache.spark.{Partition, SparkContext}
3827
import org.apache.spark.input.StreamFileInputFormat
3928

4029
private[spark] class RawFileRDD[T](
@@ -58,7 +47,9 @@ private[spark] class RawFileRDD[T](
5847
val rawSplits = inputFormat.getSplits(jobContext).toArray
5948
val result = new Array[Partition](rawSplits.size)
6049
for (i <- 0 until rawSplits.size) {
61-
result(i) = new NewHadoopPartition(id, i, rawSplits(i).asInstanceOf[InputSplit with Writable])
50+
result(i) = new NewHadoopPartition(
51+
id, i, rawSplits(i).asInstanceOf[InputSplit with Writable]
52+
)
6253
}
6354
result
6455
}

0 commit comments

Comments
 (0)