@@ -51,21 +51,25 @@ public CustomCodecService(MapperService mapperService, IndexSettings indexSettin
51
51
if (mapperService == null ) {
52
52
codecs .put (ZSTD_CODEC , new Zstd99Codec (compressionLevel ));
53
53
codecs .put (ZSTD_NO_DICT_CODEC , new ZstdNoDict99Codec (compressionLevel ));
54
- codecs .put (QAT_LZ4_CODEC , new QatLz499Codec (compressionLevel , () -> {
55
- return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
56
- }));
57
- codecs .put (QAT_DEFLATE_CODEC , new QatDeflate99Codec (compressionLevel , () -> {
58
- return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
59
- }));
54
+ if (QatZipperFactory .isQatAvailable ()) {
55
+ codecs .put (QAT_LZ4_CODEC , new QatLz499Codec (compressionLevel , () -> {
56
+ return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
57
+ }));
58
+ codecs .put (QAT_DEFLATE_CODEC , new QatDeflate99Codec (compressionLevel , () -> {
59
+ return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
60
+ }));
61
+ }
60
62
} else {
61
63
codecs .put (ZSTD_CODEC , new Zstd99Codec (mapperService , logger , compressionLevel ));
62
64
codecs .put (ZSTD_NO_DICT_CODEC , new ZstdNoDict99Codec (mapperService , logger , compressionLevel ));
63
- codecs .put (QAT_LZ4_CODEC , new QatLz499Codec (mapperService , logger , compressionLevel , () -> {
64
- return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
65
- }));
66
- codecs .put (QAT_DEFLATE_CODEC , new QatDeflate99Codec (mapperService , logger , compressionLevel , () -> {
67
- return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
68
- }));
65
+ if (QatZipperFactory .isQatAvailable ()) {
66
+ codecs .put (QAT_LZ4_CODEC , new QatLz499Codec (mapperService , logger , compressionLevel , () -> {
67
+ return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
68
+ }));
69
+ codecs .put (QAT_DEFLATE_CODEC , new QatDeflate99Codec (mapperService , logger , compressionLevel , () -> {
70
+ return indexSettings .getValue (Lucene99QatCodec .INDEX_CODEC_QAT_MODE_SETTING );
71
+ }));
72
+ }
69
73
}
70
74
this .codecs = codecs .immutableMap ();
71
75
}
0 commit comments