From fa8cbc33e1dbee4061877cb9383cb08d71560395 Mon Sep 17 00:00:00 2001 From: Benoit Perroud Date: Fri, 15 Nov 2013 13:32:46 +0100 Subject: [PATCH] Avoid creating LZO indexes on files not spread on several blocs (they are useless) --- .../java/com/hadoop/compression/lzo/DistributedLzoIndexer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hadoop/compression/lzo/DistributedLzoIndexer.java b/src/main/java/com/hadoop/compression/lzo/DistributedLzoIndexer.java index edbde8f4..c360526b 100644 --- a/src/main/java/com/hadoop/compression/lzo/DistributedLzoIndexer.java +++ b/src/main/java/com/hadoop/compression/lzo/DistributedLzoIndexer.java @@ -43,7 +43,7 @@ private void walkPath(Path path, PathFilter pathFilter, List accumulator) for (FileStatus childStatus : children) { walkPath(childStatus.getPath(), pathFilter, accumulator); } - } else if (path.toString().endsWith(LZO_EXTENSION)) { + } else if (path.toString().endsWith(LZO_EXTENSION) && fileStatus.getLen() > fileStatus.getBlockSize()) { Path lzoIndexPath = path.suffix(LzoIndex.LZO_INDEX_SUFFIX); if (fs.exists(lzoIndexPath)) { // If the index exists and is of nonzero size, we're already done.