Permalink
Browse files

Merge remote branch 'kw/master'

  • Loading branch information...
2 parents 8aa0605 + 2dd49ec commit b39db4ea111c0c18be4e8245f26c4c8def359395 @toddlipcon committed Nov 26, 2011
Showing with 7 additions and 5 deletions.
  1. +1 −0 build.xml
  2. +6 −5 src/java/com/hadoop/compression/lzo/LzopInputStream.java
View
@@ -247,6 +247,7 @@
<exec dir="${build.native}" executable="sh" failonerror="true">
<env key="OS_NAME" value="${os.name}"/>
<env key="OS_ARCH" value="${os.arch}"/>
+ <env key="LDFLAGS" value="-Wl,--no-as-needed"/>
<env key="JVM_DATA_MODEL" value="${sun.arch.data.model}"/>
<env key="NATIVE_SRCDIR" value="${native.src.dir}"/>
<arg line="${native.src.dir}/configure"/>
@@ -32,7 +32,6 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.compress.BlockDecompressorStream;
import org.apache.hadoop.io.compress.Decompressor;
-import org.apache.hadoop.io.IOUtils;
public class LzopInputStream extends BlockDecompressorStream {
@@ -220,9 +219,11 @@ private void verifyChecksums() throws IOException {
throw new IOException("Corrupted uncompressed block");
}
}
- for (Map.Entry<CChecksum,Integer> chk : ccheck.entrySet()) {
- if (!ldecompressor.verifyCChecksum(chk.getKey(), chk.getValue())) {
- throw new IOException("Corrupted compressed block");
+ if (!ldecompressor.isCurrentBlockUncompressed()) {
+ for (Map.Entry<CChecksum,Integer> chk : ccheck.entrySet()) {
+ if (!ldecompressor.verifyCChecksum(chk.getKey(), chk.getValue())) {
+ throw new IOException("Corrupted compressed block");
+ }
}
}
}
@@ -258,7 +259,7 @@ protected int decompress(byte[] b, int off, int len) throws IOException {
return -1;
} catch (IOException e) {
LOG.warn("IOException in getCompressedData; likely LZO corruption.", e);
- return -1;
+ throw e;
}
}
}

0 comments on commit b39db4e

Please sign in to comment.