From f57efcf6c868c107edde6bb087dab2280acd86d3 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Tue, 30 Oct 2012 23:19:38 -0400 Subject: [PATCH] lucene4: finish org.elasticsearch.common.compress cleanup --- .../org/elasticsearch/common/compress/CompressedDirectory.java | 3 ++- .../common/compress/lzf/LZFCompressedIndexInput.java | 2 +- .../common/compress/snappy/SnappyCompressedIndexInput.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/common/compress/CompressedDirectory.java b/src/main/java/org/elasticsearch/common/compress/CompressedDirectory.java index 3f62ebfdb88..e5a6b2d0cd5 100644 --- a/src/main/java/org/elasticsearch/common/compress/CompressedDirectory.java +++ b/src/main/java/org/elasticsearch/common/compress/CompressedDirectory.java @@ -73,7 +73,8 @@ public class CompressedDirectory extends Directory implements ForceSyncDirectory @Override public long fileLength(String name) throws IOException { if (actualLength && decompressExtensions.contains(getExtension(name))) { - IndexInput in = openInput(name); + // LUCENE 4 UPGRADE: Is this the right IOContext? + IndexInput in = openInput(name, IOContext.READONCE); try { return in.length(); } catch (Exception e) { diff --git a/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedIndexInput.java b/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedIndexInput.java index 95b12604653..58d79415fd2 100644 --- a/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedIndexInput.java +++ b/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedIndexInput.java @@ -65,7 +65,7 @@ public class LZFCompressedIndexInput extends CompressedIndexInput