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