diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 9ebe603027c..228163bef5a 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -675,6 +675,9 @@ Release 0.23.7 - UNRELEASED MAPREDUCE-4822. Unnecessary conversions in History Events. (Chu Tong via jlowe) + MAPREDUCE-4974. Optimising the LineRecordReader initialize() method + (Gelesh via bobby) + BUG FIXES MAPREDUCE-4458. Warn if java.library.path is used for AM or Task diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/LineRecordReader.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/LineRecordReader.java index e1dcee0b24b..93c3dc80407 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/LineRecordReader.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/LineRecordReader.java @@ -81,13 +81,13 @@ public class LineRecordReader extends RecordReader { start = split.getStart(); end = start + split.getLength(); final Path file = split.getPath(); - compressionCodecs = new CompressionCodecFactory(job); - codec = compressionCodecs.getCodec(file); // open the file and seek to the start of the split final FileSystem fs = file.getFileSystem(job); fileIn = fs.open(file); if (isCompressedInput()) { + compressionCodecs = new CompressionCodecFactory(job); + codec = compressionCodecs.getCodec(file); decompressor = CodecPool.getDecompressor(codec); if (codec instanceof SplittableCompressionCodec) { final SplitCompressionInputStream cIn = @@ -166,9 +166,6 @@ public class LineRecordReader extends RecordReader { while (getFilePosition() <= end) { newSize = in.readLine(value, maxLineLength, Math.max(maxBytesToConsume(pos), maxLineLength)); - if (newSize == 0) { - break; - } pos += newSize; if (newSize < maxLineLength) { break; @@ -219,4 +216,4 @@ public class LineRecordReader extends RecordReader { } } } -} +} \ No newline at end of file