lucene4: finish org.elasticsearch.common.compress cleanup
This commit is contained in:
parent
93906903b6
commit
f57efcf6c8
|
@ -73,7 +73,8 @@ public class CompressedDirectory extends Directory implements ForceSyncDirectory
|
||||||
@Override
|
@Override
|
||||||
public long fileLength(String name) throws IOException {
|
public long fileLength(String name) throws IOException {
|
||||||
if (actualLength && decompressExtensions.contains(getExtension(name))) {
|
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 {
|
try {
|
||||||
return in.length();
|
return in.length();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class LZFCompressedIndexInput extends CompressedIndexInput<LZFCompressorC
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public IndexInput clone() {
|
||||||
LZFCompressedIndexInput cloned = (LZFCompressedIndexInput) super.clone();
|
LZFCompressedIndexInput cloned = (LZFCompressedIndexInput) super.clone();
|
||||||
cloned.inputBuffer = new byte[LZFChunk.MAX_CHUNK_LEN];
|
cloned.inputBuffer = new byte[LZFChunk.MAX_CHUNK_LEN];
|
||||||
return cloned;
|
return cloned;
|
||||||
|
|
|
@ -59,7 +59,7 @@ public abstract class SnappyCompressedIndexInput extends CompressedIndexInput<Sn
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public IndexInput clone() {
|
||||||
SnappyCompressedIndexInput cloned = (SnappyCompressedIndexInput) super.clone();
|
SnappyCompressedIndexInput cloned = (SnappyCompressedIndexInput) super.clone();
|
||||||
cloned.inputBuffer = new byte[inputBuffer.length];
|
cloned.inputBuffer = new byte[inputBuffer.length];
|
||||||
return cloned;
|
return cloned;
|
||||||
|
|
Loading…
Reference in New Issue