From edf58293ee6ff872224afdbe9e580db781caac22 Mon Sep 17 00:00:00 2001 From: Kevin Mader Date: Wed, 13 Aug 2014 16:19:27 +0200 Subject: [PATCH] fixing line lengths, adding new lines --- .../apache/spark/input/FixedLengthBinaryInputFormat.scala | 8 ++++---- .../spark/input/FixedLengthBinaryRecordReader.scala | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryInputFormat.scala b/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryInputFormat.scala index 4292a63d7f301..a59317afc0e0f 100644 --- a/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryInputFormat.scala +++ b/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryInputFormat.scala @@ -23,9 +23,9 @@ import org.apache.hadoop.mapreduce.lib.input.FileInputFormat import org.apache.hadoop.mapreduce.{InputSplit, JobContext, RecordReader, TaskAttemptContext} /** - * Custom Input Format for reading and splitting flat binary files that contain records, each of which - * are a fixed size in bytes. The fixed record size is specified through a parameter recordLength - * in the Hadoop configuration. + * Custom Input Format for reading and splitting flat binary files that contain records, + * each of which are a fixed size in bytes. The fixed record size is specified through + * a parameter recordLength in the Hadoop configuration. */ object FixedLengthBinaryInputFormat { @@ -92,4 +92,4 @@ class FixedLengthBinaryInputFormat extends FileInputFormat[LongWritable, BytesWr var recordLength = -1 -} \ No newline at end of file +} diff --git a/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryRecordReader.scala b/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryRecordReader.scala index 67f8d49f09aa5..e7ea91809aac5 100644 --- a/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryRecordReader.scala +++ b/core/src/main/scala/org/apache/spark/input/FixedLengthBinaryRecordReader.scala @@ -56,7 +56,9 @@ class FixedLengthBinaryRecordReader extends RecordReader[LongWritable, BytesWrit override def getProgress: Float = { splitStart match { case x if x == splitEnd => 0.0.toFloat - case _ => Math.min(((currentPosition - splitStart) / (splitEnd - splitStart)).toFloat, 1.0).toFloat + case _ => Math.min( + ((currentPosition - splitStart) / (splitEnd - splitStart)).toFloat, 1.0 + ).toFloat } } @@ -141,4 +143,4 @@ class FixedLengthBinaryRecordReader extends RecordReader[LongWritable, BytesWrit var recordKey: LongWritable = null var recordValue: BytesWritable = null -} \ No newline at end of file +}