Skip to content

Commit 2d8f30c

Browse files
committed
Use same codec name, change just writer implementation
1 parent 457e9a4 commit 2d8f30c

File tree

14 files changed

+28
-27
lines changed

14 files changed

+28
-27
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/index/codec/tsdb/TSDBDocValuesMergeBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.lucene.util.BytesRef;
2727
import org.elasticsearch.cluster.metadata.DataStream;
2828
import org.elasticsearch.common.logging.LogConfigurator;
29-
import org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec;
29+
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
3030
import org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormat;
3131
import org.openjdk.jmh.annotations.Benchmark;
3232
import org.openjdk.jmh.annotations.BenchmarkMode;
@@ -259,7 +259,7 @@ private static IndexWriterConfig createIndexWriterConfig(boolean optimizedMergeE
259259
config.setLeafSorter(DataStream.TIMESERIES_LEAF_READERS_SORTER);
260260
config.setMergePolicy(new LogByteSizeMergePolicy());
261261
var docValuesFormat = new ES819TSDBDocValuesFormat(4096, optimizedMergeEnabled);
262-
config.setCodec(new Elasticsearch910Lucene102Codec() {
262+
config.setCodec(new Elasticsearch900Lucene101Codec() {
263263

264264
@Override
265265
public DocValuesFormat getDocValuesFormatForField(String field) {

server/src/main/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10+
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
1011
import org.elasticsearch.index.codec.vectors.es910.ES910HnswVectorsFormat;
1112
import org.elasticsearch.plugins.internal.RestExtension;
1213
import org.elasticsearch.reservedstate.ReservedStateHandlerProvider;
@@ -465,7 +466,7 @@
465466
org.elasticsearch.index.codec.Elasticsearch814Codec,
466467
org.elasticsearch.index.codec.Elasticsearch816Codec,
467468
org.elasticsearch.index.codec.Elasticsearch900Codec,
468-
org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec;
469+
Elasticsearch900Lucene101Codec;
469470

470471
provides org.apache.logging.log4j.core.util.ContextDataProvider with org.elasticsearch.common.logging.DynamicContextDataProvider;
471472

server/src/main/java/org/elasticsearch/index/codec/Elasticsearch910Lucene102Codec.java renamed to server/src/main/java/org/elasticsearch/index/codec/Elasticsearch900Lucene101Codec.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* Elasticsearch codec as of 9.0 relying on Lucene 10.1. This extends the Lucene 10.1 codec to compressed
2727
* stored fields with ZSTD instead of LZ4/DEFLATE. See {@link Zstd814StoredFieldsFormat}.
2828
*/
29-
public class Elasticsearch910Lucene102Codec extends CodecService.DeduplicateFieldInfosCodec {
29+
public class Elasticsearch900Lucene101Codec extends CodecService.DeduplicateFieldInfosCodec {
3030

3131
static final PostingsFormat DEFAULT_POSTINGS_FORMAT = new Lucene101PostingsFormat();
3232

@@ -36,36 +36,36 @@ public class Elasticsearch910Lucene102Codec extends CodecService.DeduplicateFiel
3636
private final PostingsFormat postingsFormat = new PerFieldPostingsFormat() {
3737
@Override
3838
public PostingsFormat getPostingsFormatForField(String field) {
39-
return Elasticsearch910Lucene102Codec.this.getPostingsFormatForField(field);
39+
return Elasticsearch900Lucene101Codec.this.getPostingsFormatForField(field);
4040
}
4141
};
4242

4343
private final DocValuesFormat defaultDVFormat;
4444
private final DocValuesFormat docValuesFormat = new XPerFieldDocValuesFormat() {
4545
@Override
4646
public DocValuesFormat getDocValuesFormatForField(String field) {
47-
return Elasticsearch910Lucene102Codec.this.getDocValuesFormatForField(field);
47+
return Elasticsearch900Lucene101Codec.this.getDocValuesFormatForField(field);
4848
}
4949
};
5050

5151
private final KnnVectorsFormat defaultKnnVectorsFormat;
5252
private final KnnVectorsFormat knnVectorsFormat = new PerFieldKnnVectorsFormat() {
5353
@Override
5454
public KnnVectorsFormat getKnnVectorsFormatForField(String field) {
55-
return Elasticsearch910Lucene102Codec.this.getKnnVectorsFormatForField(field);
55+
return Elasticsearch900Lucene101Codec.this.getKnnVectorsFormatForField(field);
5656
}
5757
};
5858

5959
/** Public no-arg constructor, needed for SPI loading at read-time. */
60-
public Elasticsearch910Lucene102Codec() {
60+
public Elasticsearch900Lucene101Codec() {
6161
this(Zstd814StoredFieldsFormat.Mode.BEST_SPEED);
6262
}
6363

6464
/**
6565
* Constructor. Takes a {@link Zstd814StoredFieldsFormat.Mode} that describes whether to optimize for retrieval speed at the expense of
6666
* worse space-efficiency or vice-versa.
6767
*/
68-
public Elasticsearch910Lucene102Codec(Zstd814StoredFieldsFormat.Mode mode) {
68+
public Elasticsearch900Lucene101Codec(Zstd814StoredFieldsFormat.Mode mode) {
6969
super("Elasticsearch900Lucene101", new Lucene101Codec());
7070
this.storedFieldsFormat = mode.getFormat();
7171
this.defaultPostingsFormat = DEFAULT_POSTINGS_FORMAT;

server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public PerFieldFormatSupplier(MapperService mapperService, BigArrays bigArrays)
5151
if (mapperService != null
5252
&& mapperService.getIndexSettings().getIndexVersionCreated().onOrAfter(IndexVersions.USE_LUCENE101_POSTINGS_FORMAT)
5353
&& mapperService.getIndexSettings().getMode().useDefaultPostingsFormat()) {
54-
defaultPostingsFormat = Elasticsearch910Lucene102Codec.DEFAULT_POSTINGS_FORMAT;
54+
defaultPostingsFormat = Elasticsearch900Lucene101Codec.DEFAULT_POSTINGS_FORMAT;
5555
} else {
5656
// our own posting format using PFOR
5757
defaultPostingsFormat = es812PostingsFormat;

server/src/main/java/org/elasticsearch/index/codec/PerFieldMapperCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* per index in real time via the mapping API. If no specific postings format or vector format is
2727
* configured for a specific field the default postings or vector format is used.
2828
*/
29-
public final class PerFieldMapperCodec extends Elasticsearch910Lucene102Codec {
29+
public final class PerFieldMapperCodec extends Elasticsearch900Lucene101Codec {
3030

3131
private final PerFieldFormatSupplier formatSupplier;
3232

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.elasticsearch.index.codec.Elasticsearch814Codec
22
org.elasticsearch.index.codec.Elasticsearch816Codec
33
org.elasticsearch.index.codec.Elasticsearch900Codec
4-
org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec
4+
org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec

server/src/test/java/org/elasticsearch/index/codec/CodecTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void testResolveDefaultCodecs() throws Exception {
5050
assumeTrue("Only when zstd_stored_fields feature flag is enabled", CodecService.ZSTD_STORED_FIELDS_FEATURE_FLAG);
5151
CodecService codecService = createCodecService();
5252
assertThat(codecService.codec("default"), instanceOf(PerFieldMapperCodec.class));
53-
assertThat(codecService.codec("default"), instanceOf(Elasticsearch910Lucene102Codec.class));
53+
assertThat(codecService.codec("default"), instanceOf(Elasticsearch900Lucene101Codec.class));
5454
}
5555

5656
public void testDefault() throws Exception {

server/src/test/java/org/elasticsearch/index/codec/tsdb/DocValuesCodecDuelTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.lucene.tests.index.RandomIndexWriter;
2727
import org.apache.lucene.tests.util.TestUtil;
2828
import org.apache.lucene.util.BytesRef;
29-
import org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec;
29+
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
3030
import org.elasticsearch.index.codec.tsdb.ES87TSDBDocValuesFormatTests.TestES87TSDBDocValuesFormat;
3131
import org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormat;
3232
import org.elasticsearch.test.ESTestCase;
@@ -55,7 +55,7 @@ public void testDuel() throws IOException {
5555
baselineConfig.setCodec(TestUtil.alwaysDocValuesFormat(new Lucene90DocValuesFormat()));
5656
var contenderConf = newIndexWriterConfig();
5757
contenderConf.setMergePolicy(mergePolicy);
58-
Codec codec = new Elasticsearch910Lucene102Codec() {
58+
Codec codec = new Elasticsearch900Lucene101Codec() {
5959

6060
final DocValuesFormat docValuesFormat = randomBoolean()
6161
? new ES819TSDBDocValuesFormat()

server/src/test/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesFormatTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import org.apache.lucene.tests.index.RandomIndexWriter;
3737
import org.apache.lucene.util.BytesRef;
3838
import org.elasticsearch.common.logging.LogConfigurator;
39-
import org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec;
39+
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
4040

4141
import java.io.IOException;
4242
import java.util.ArrayList;
@@ -74,7 +74,7 @@ public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOExcept
7474
}
7575
}
7676

77-
private final Codec codec = new Elasticsearch910Lucene102Codec() {
77+
private final Codec codec = new Elasticsearch900Lucene101Codec() {
7878

7979
@Override
8080
public DocValuesFormat getDocValuesFormatForField(String field) {

server/src/test/java/org/elasticsearch/index/codec/tsdb/TsdbDocValueBwcTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.elasticsearch.cluster.metadata.DataStream;
3434
import org.elasticsearch.core.SuppressForbidden;
3535
import org.elasticsearch.index.codec.Elasticsearch816Codec;
36-
import org.elasticsearch.index.codec.Elasticsearch910Lucene102Codec;
36+
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
3737
import org.elasticsearch.index.codec.perfield.XPerFieldDocValuesFormat;
3838
import org.elasticsearch.index.codec.tsdb.ES87TSDBDocValuesFormatTests.TestES87TSDBDocValuesFormat;
3939
import org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormat;
@@ -64,7 +64,7 @@ public DocValuesFormat getDocValuesFormatForField(String field) {
6464
return docValuesFormat;
6565
}
6666
};
67-
var newCodec = new Elasticsearch910Lucene102Codec() {
67+
var newCodec = new Elasticsearch900Lucene101Codec() {
6868

6969
final DocValuesFormat docValuesFormat = new ES819TSDBDocValuesFormat();
7070

0 commit comments

Comments
 (0)