Return-Path: Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: (qmail 50977 invoked from network); 29 Mar 2010 08:41:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Mar 2010 08:41:53 -0000 Received: (qmail 94355 invoked by uid 500); 29 Mar 2010 08:41:53 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 94286 invoked by uid 500); 29 Mar 2010 08:41:51 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 94274 invoked by uid 99); 29 Mar 2010 08:41:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 08:41:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 08:41:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 42AC2234C1F2 for ; Mon, 29 Mar 2010 08:41:27 +0000 (UTC) Message-ID: <997695692.543501269852087272.JavaMail.jira@brutus.apache.org> Date: Mon, 29 Mar 2010 08:41:27 +0000 (UTC) From: "Xiao Kang (JIRA)" To: common-issues@hadoop.apache.org Subject: [jira] Commented: (HADOOP-6663) BlockDecompressorStream get EOF exception when decompressing the file compressed from empty file In-Reply-To: <1619883340.543171269850767204.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-6663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850835#action_12850835 ] Xiao Kang commented on HADOOP-6663: ----------------------------------- The EOF exception caused as follow: BlockCompressorStream compresses the input data block-by-block. For each block, the uncopressed block length is first written to the underlying output stream, followed by compressed chunks, each consists of a chuck-length and compressed chunk-data. So BlockCompressorStream writes an int of 0 to the underlying output stream when compressing empty file, without any following chunks. BlockDecompressorStream decompresses the underlying compressed input stream block by block. For each block, it reads the uncompressed block length and then reads the chunk length and compressed chunk. So BlockDecompressorStream read 0 and get EOF exception trying to read chunk length when decompressing previous compressed empty file. > BlockDecompressorStream get EOF exception when decompressing the file compressed from empty file > ------------------------------------------------------------------------------------------------ > > Key: HADOOP-6663 > URL: https://issues.apache.org/jira/browse/HADOOP-6663 > Project: Hadoop Common > Issue Type: Bug > Components: io > Affects Versions: 0.20.2 > Reporter: Xiao Kang > > An empty file can be compressed using BlockDecompressorStream, which is for block-based compressiong algorithm such as LZO. However, when decompressing the compressed file, BlockDecompressorStream get EOF exception. > Here is a typical exception stack: > java.io.EOFException > at org.apache.hadoop.io.compress.BlockDecompressorStream.rawReadInt(BlockDecompressorStream.java:125) > at org.apache.hadoop.io.compress.BlockDecompressorStream.getCompressedData(BlockDecompressorStream.java:96) > at org.apache.hadoop.io.compress.BlockDecompressorStream.decompress(BlockDecompressorStream.java:82) > at org.apache.hadoop.io.compress.DecompressorStream.read(DecompressorStream.java:74) > at java.io.InputStream.read(InputStream.java:85) > at org.apache.hadoop.util.LineReader.readLine(LineReader.java:134) > at org.apache.hadoop.mapred.LineRecordReader.next(LineRecordReader.java:134) > at org.apache.hadoop.mapred.LineRecordReader.next(LineRecordReader.java:39) > at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.moveToNext(MapTask.java:186) > at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.next(MapTask.java:170) > at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:48) > at org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java:18) > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:334) > at org.apache.hadoop.mapred.Child.main(Child.java:196) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.