Skip to content

Commit edf5829

Browse files
committed
fixing line lengths, adding new lines
1 parent f4841dc commit edf5829

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
2323
import org.apache.hadoop.mapreduce.{InputSplit, JobContext, RecordReader, TaskAttemptContext}
2424

2525
/**
26-
* Custom Input Format for reading and splitting flat binary files that contain records, each of which
27-
* are a fixed size in bytes. The fixed record size is specified through a parameter recordLength
28-
* in the Hadoop configuration.
26+
* Custom Input Format for reading and splitting flat binary files that contain records,
27+
* each of which are a fixed size in bytes. The fixed record size is specified through
28+
* a parameter recordLength in the Hadoop configuration.
2929
*/
3030

3131
object FixedLengthBinaryInputFormat {
@@ -92,4 +92,4 @@ class FixedLengthBinaryInputFormat extends FileInputFormat[LongWritable, BytesWr
9292

9393
var recordLength = -1
9494

95-
}
95+
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class FixedLengthBinaryRecordReader extends RecordReader[LongWritable, BytesWrit
5656
override def getProgress: Float = {
5757
splitStart match {
5858
case x if x == splitEnd => 0.0.toFloat
59-
case _ => Math.min(((currentPosition - splitStart) / (splitEnd - splitStart)).toFloat, 1.0).toFloat
59+
case _ => Math.min(
60+
((currentPosition - splitStart) / (splitEnd - splitStart)).toFloat, 1.0
61+
).toFloat
6062
}
6163
}
6264

@@ -141,4 +143,4 @@ class FixedLengthBinaryRecordReader extends RecordReader[LongWritable, BytesWrit
141143
var recordKey: LongWritable = null
142144
var recordValue: BytesWritable = null
143145

144-
}
146+
}

0 commit comments

Comments
 (0)