Skip to content

Commit bfa001f

Browse files
committed
Addressing comments and resolving conflicts
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
1 parent ec959ca commit bfa001f

File tree

6 files changed

+13
-44
lines changed

6 files changed

+13
-44
lines changed

.github/actions/create-bwc-build/action.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ runs:
3939
arguments: assemble
4040
build-root-directory: ${{ inputs.plugin-branch }}
4141

42-
4342
- id: get-opensearch-version
4443
uses: peternied/get-opensearch-version@v1
4544
with:

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
jdk: [21]
35-
platform: [ ubuntu-latest, windows-latest ]
35+
platform: [ubuntu-latest, windows-latest]
3636
runs-on: ${{ matrix.platform }}
3737

3838
steps:

src/integrationTest/java/org/opensearch/index/codec/rest/CreateIndexWithCodecIT.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.opensearch.common.settings.Settings;
2828
import org.opensearch.core.common.Strings;
2929
import org.opensearch.index.codec.customcodecs.QatZipperFactory;
30-
import org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.Lucene912QatCodec;
30+
import org.opensearch.index.codec.customcodecs.Lucene101QatCodec;
3131
import org.opensearch.test.rest.OpenSearchRestTestCase;
3232

3333
import javax.net.ssl.SSLEngine;
@@ -105,7 +105,7 @@ public void testCreateIndexWithQatSPICodecWithQatHardwareUnavailable() throws IO
105105
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
106106
.put(
107107
"index.codec",
108-
randomFrom(Lucene912QatCodec.Mode.QAT_LZ4.getCodec(), Lucene912QatCodec.Mode.QAT_DEFLATE.getCodec())
108+
randomFrom(Lucene101QatCodec.Mode.QAT_LZ4.getCodec(), Lucene101QatCodec.Mode.QAT_DEFLATE.getCodec())
109109
)
110110
.put("index.codec.compression_level", randomIntBetween(1, 6))
111111
.build()

src/main/java/org/opensearch/index/codec/customcodecs/CustomCodecPlugin.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.opensearch.index.IndexSettings;
1313
import org.opensearch.index.codec.CodecServiceFactory;
1414
import org.opensearch.index.codec.customcodecs.backward_codecs.lucene99.Lucene99QatCodec;
15+
import org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.Lucene912QatCodec;
1516
import org.opensearch.index.engine.EngineConfig;
1617
import org.opensearch.plugins.EnginePlugin;
1718
import org.opensearch.plugins.Plugin;
@@ -65,7 +66,11 @@ public List<Setting<?>> getSettings() {
6566
}
6667

6768
private static boolean isQatCodec(String codecName) {
68-
return codecName.equals(Lucene101QatCodec.Mode.QAT_LZ4.getCodec())
69+
return codecName.equals(Lucene99QatCodec.Mode.QAT_LZ4.getCodec())
70+
|| codecName.equals(Lucene99QatCodec.Mode.QAT_DEFLATE.getCodec())
71+
|| codecName.equals(Lucene912QatCodec.Mode.QAT_LZ4.getCodec())
72+
|| codecName.equals(Lucene912QatCodec.Mode.QAT_DEFLATE.getCodec())
73+
|| codecName.equals(Lucene101QatCodec.Mode.QAT_LZ4.getCodec())
6974
|| codecName.equals(Lucene101QatCodec.Mode.QAT_DEFLATE.getCodec());
7075
}
7176
}

src/main/java/org/opensearch/index/codec/customcodecs/backward_codecs/lucene912/Lucene912QatCodec.java

-39
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import org.apache.lucene.backward_codecs.lucene912.Lucene912Codec;
1313
import org.apache.lucene.codecs.FilterCodec;
1414
import org.apache.lucene.codecs.StoredFieldsFormat;
15-
import org.apache.lucene.codecs.lucene101.Lucene101Codec;
16-
import org.opensearch.index.codec.PerFieldMappingPostingFormatCodec;
17-
import org.opensearch.index.mapper.MapperService;
1815

1916
import java.util.Set;
2017
import java.util.function.Supplier;
@@ -97,42 +94,6 @@ public Lucene912QatCodec(Mode mode, int compressionLevel, Supplier<QatZipper.Mod
9794
this.storedFieldsFormat = new Lucene912QatStoredFieldsFormat(mode, compressionLevel, supplier);
9895
}
9996

100-
/**
101-
* Creates a new compression codec with the given compression level. We use lowercase letters when
102-
* registering the codec so that we remain consistent with the other compression codecs: default,
103-
* lucene_default, and best_compression.
104-
*
105-
* @param mode The compression codec (QAT_LZ4 or QAT_DEFLATE).
106-
* @param compressionLevel The compression level.
107-
* @param mapperService The mapper service.
108-
* @param logger The logger.
109-
*/
110-
public Lucene912QatCodec(Mode mode, int compressionLevel, MapperService mapperService, Logger logger) {
111-
super(mode.getCodec(), new PerFieldMappingPostingFormatCodec(Lucene101Codec.Mode.BEST_SPEED, mapperService, logger));
112-
this.storedFieldsFormat = new Lucene912QatStoredFieldsFormat(mode, compressionLevel);
113-
}
114-
115-
/**
116-
* Creates a new compression codec with the given compression level. We use lowercase letters when
117-
* registering the codec so that we remain consistent with the other compression codecs: default,
118-
* lucene_default, and best_compression.
119-
*
120-
* @param mode The compression codec (QAT_LZ4 or QAT_DEFLATE).
121-
* @param compressionLevel The compression level.
122-
* @param mapperService The mapper service.
123-
* @param logger The logger.
124-
* @param supplier supplier for QAT mode.
125-
*/
126-
public Lucene912QatCodec(
127-
Mode mode,
128-
int compressionLevel,
129-
MapperService mapperService,
130-
Logger logger,
131-
Supplier<QatZipper.Mode> supplier
132-
) {
133-
super(mode.getCodec(), new PerFieldMappingPostingFormatCodec(Lucene101Codec.Mode.BEST_SPEED, mapperService, logger));
134-
this.storedFieldsFormat = new Lucene912QatStoredFieldsFormat(mode, compressionLevel, supplier);
135-
}
13697

13798
@Override
13899
public StoredFieldsFormat storedFieldsFormat() {

src/main/resources/META-INF/services/org.apache.lucene.codecs.Codec

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.Zstd912Codec
99
org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.ZstdNoDict912Codec
1010
org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.QatDeflate912Codec
1111
org.opensearch.index.codec.customcodecs.backward_codecs.lucene912.QatLz4912Codec
12+
org.opensearch.index.codec.customcodecs.Zstd101Codec
13+
org.opensearch.index.codec.customcodecs.ZstdNoDict101Codec
14+
org.opensearch.index.codec.customcodecs.QatDeflate101Codec
15+
org.opensearch.index.codec.customcodecs.QatLz4101Codec

0 commit comments

Comments
 (0)