Skip to content

Commit f6a4506

Browse files
committed
iter
1 parent cb3ec67 commit f6a4506

File tree

6 files changed

+6
-28
lines changed

6 files changed

+6
-28
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public ES87TSDBDocValuesFormat(int skipIndexIntervalSize) {
9393

9494
@Override
9595
public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
96-
throw new UnsupportedOperationException("writing es87 doc values is no longer supported");
96+
return new ES87TSDBDocValuesConsumer(state, skipIndexIntervalSize, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION);
9797
}
9898

9999
@Override

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.apache.lucene.tests.util.TestUtil;
2828
import org.apache.lucene.util.BytesRef;
2929
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
30-
import org.elasticsearch.index.codec.tsdb.ES87TSDBDocValuesFormatTests.TestES87TSDBDocValuesFormat;
3130
import org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormat;
3231
import org.elasticsearch.test.ESTestCase;
3332

@@ -57,9 +56,7 @@ public void testDuel() throws IOException {
5756
contenderConf.setMergePolicy(mergePolicy);
5857
Codec codec = new Elasticsearch900Lucene101Codec() {
5958

60-
final DocValuesFormat docValuesFormat = randomBoolean()
61-
? new ES819TSDBDocValuesFormat()
62-
: new TestES87TSDBDocValuesFormat();
59+
final DocValuesFormat docValuesFormat = randomBoolean() ? new ES819TSDBDocValuesFormat() : new ES87TSDBDocValuesFormat();
6360

6461
@Override
6562
public DocValuesFormat getDocValuesFormatForField(String field) {

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import org.apache.lucene.analysis.Analyzer;
1313
import org.apache.lucene.codecs.Codec;
14-
import org.apache.lucene.codecs.DocValuesConsumer;
1514
import org.apache.lucene.codecs.DocValuesFormat;
1615
import org.apache.lucene.document.Document;
1716
import org.apache.lucene.document.Field;
@@ -24,7 +23,6 @@
2423
import org.apache.lucene.index.IndexWriter;
2524
import org.apache.lucene.index.IndexWriterConfig;
2625
import org.apache.lucene.index.LeafReaderContext;
27-
import org.apache.lucene.index.SegmentWriteState;
2826
import org.apache.lucene.index.SortedDocValues;
2927
import org.apache.lucene.index.SortedNumericDocValues;
3028
import org.apache.lucene.index.SortedSetDocValues;
@@ -58,27 +56,11 @@ public class ES87TSDBDocValuesFormatTests extends BaseDocValuesFormatTestCase {
5856
LogConfigurator.configureESLogging();
5957
}
6058

61-
static class TestES87TSDBDocValuesFormat extends ES87TSDBDocValuesFormat {
62-
63-
TestES87TSDBDocValuesFormat() {
64-
super();
65-
}
66-
67-
TestES87TSDBDocValuesFormat(int skipIndexIntervalSize) {
68-
super(skipIndexIntervalSize);
69-
}
70-
71-
@Override
72-
public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
73-
return new ES87TSDBDocValuesConsumer(state, skipIndexIntervalSize, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION);
74-
}
75-
}
76-
7759
private final Codec codec = new Elasticsearch900Lucene101Codec() {
7860

7961
@Override
8062
public DocValuesFormat getDocValuesFormatForField(String field) {
81-
return new TestES87TSDBDocValuesFormat();
63+
return new ES87TSDBDocValuesFormat();
8264
}
8365
};
8466

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ES87TSDBDocValuesFormatVariableSkipIntervalTests extends BaseDocVal
3232
@Override
3333
protected Codec getCodec() {
3434
// small interval size to test with many intervals
35-
return TestUtil.alwaysDocValuesFormat(new ES87TSDBDocValuesFormatTests.TestES87TSDBDocValuesFormat(random().nextInt(4, 16)));
35+
return TestUtil.alwaysDocValuesFormat(new ES87TSDBDocValuesFormat(random().nextInt(4, 16)));
3636
}
3737

3838
public void testSkipIndexIntervalSize() {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.elasticsearch.index.codec.Elasticsearch816Codec;
3636
import org.elasticsearch.index.codec.Elasticsearch900Lucene101Codec;
3737
import org.elasticsearch.index.codec.perfield.XPerFieldDocValuesFormat;
38-
import org.elasticsearch.index.codec.tsdb.ES87TSDBDocValuesFormatTests.TestES87TSDBDocValuesFormat;
3938
import org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormat;
4039
import org.elasticsearch.test.ESTestCase;
4140
import org.hamcrest.Matchers;
@@ -49,15 +48,15 @@
4948
public class TsdbDocValueBwcTests extends ESTestCase {
5049

5150
public void testMixedIndex() throws Exception {
52-
var oldCodec = TestUtil.alwaysDocValuesFormat(new TestES87TSDBDocValuesFormat());
51+
var oldCodec = TestUtil.alwaysDocValuesFormat(new ES87TSDBDocValuesFormat());
5352
var newCodec = TestUtil.alwaysDocValuesFormat(new ES819TSDBDocValuesFormat());
5453
testMixedIndex(oldCodec, newCodec);
5554
}
5655

5756
public void testMixedIndex816To900Lucene101() throws Exception {
5857
var oldCodec = new Elasticsearch816Codec() {
5958

60-
final DocValuesFormat docValuesFormat = new TestES87TSDBDocValuesFormat();
59+
final DocValuesFormat docValuesFormat = new ES87TSDBDocValuesFormat();
6160

6261
@Override
6362
public DocValuesFormat getDocValuesFormatForField(String field) {

0 commit comments

Comments
 (0)