disable optimized decoder by default

This commit is contained in:
Shay Banon 2011-11-14 10:10:22 +02:00
parent eb1b0b150f
commit eefbe52580
1 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package org.elasticsearch.common.compress.lzf.util; package org.elasticsearch.common.compress.lzf.util;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.compress.lzf.ChunkDecoder; import org.elasticsearch.common.compress.lzf.ChunkDecoder;
import org.elasticsearch.common.compress.lzf.impl.UnsafeChunkDecoder; import org.elasticsearch.common.compress.lzf.impl.UnsafeChunkDecoder;
import org.elasticsearch.common.compress.lzf.impl.VanillaChunkDecoder; import org.elasticsearch.common.compress.lzf.impl.VanillaChunkDecoder;
@ -27,6 +28,10 @@ public class ChunkDecoderFactory {
if (impl == null) { if (impl == null) {
impl = VanillaChunkDecoder.class; impl = VanillaChunkDecoder.class;
} }
// ES: Because of this: https://github.com/ning/compress/issues/13, disable the optimized by default
if (!Booleans.parseBoolean(System.getProperty("compress.lzf.decoder.optimized"), false)) {
impl = VanillaChunkDecoder.class;
}
_instance = new ChunkDecoderFactory(impl); _instance = new ChunkDecoderFactory(impl);
} }