6
6
* compatible open source license.
7
7
*/
8
8
9
- package org .opensearch .index .codec .composite .composite99 ;
9
+ package org .opensearch .index .codec .composite .composite912 ;
10
10
11
11
import org .apache .lucene .codecs .CodecUtil ;
12
12
import org .apache .lucene .codecs .DocValuesConsumer ;
55
55
* @opensearch.experimental
56
56
*/
57
57
@ ExperimentalApi
58
- public class Composite99DocValuesWriter extends DocValuesConsumer {
58
+ public class Composite912DocValuesWriter extends DocValuesConsumer {
59
59
private final DocValuesConsumer delegate ;
60
60
private final SegmentWriteState state ;
61
61
private final MapperService mapperService ;
62
62
AtomicReference <MergeState > mergeState = new AtomicReference <>();
63
63
private final Set <CompositeMappedFieldType > compositeMappedFieldTypes ;
64
64
private final Set <String > compositeFieldSet ;
65
- private DocValuesConsumer composite99DocValuesConsumer ;
65
+ private DocValuesConsumer compositeDocValuesConsumer ;
66
66
67
67
public IndexOutput dataOut ;
68
68
public IndexOutput metaOut ;
@@ -72,7 +72,7 @@ public class Composite99DocValuesWriter extends DocValuesConsumer {
72
72
73
73
private final Map <String , DocValuesProducer > fieldProducerMap = new HashMap <>();
74
74
75
- public Composite99DocValuesWriter (DocValuesConsumer delegate , SegmentWriteState segmentWriteState , MapperService mapperService )
75
+ public Composite912DocValuesWriter (DocValuesConsumer delegate , SegmentWriteState segmentWriteState , MapperService mapperService )
76
76
throws IOException {
77
77
78
78
this .delegate = delegate ;
@@ -101,38 +101,38 @@ public Composite99DocValuesWriter(DocValuesConsumer delegate, SegmentWriteState
101
101
// so that all the fields are sparse numeric doc values and not dense numeric doc values
102
102
SegmentWriteState consumerWriteState = getSegmentWriteState (segmentWriteState );
103
103
104
- this .composite99DocValuesConsumer = LuceneDocValuesConsumerFactory .getDocValuesConsumerForCompositeCodec (
104
+ this .compositeDocValuesConsumer = LuceneDocValuesConsumerFactory .getDocValuesConsumerForCompositeCodec (
105
105
consumerWriteState ,
106
- Composite99DocValuesFormat .DATA_DOC_VALUES_CODEC ,
107
- Composite99DocValuesFormat .DATA_DOC_VALUES_EXTENSION ,
108
- Composite99DocValuesFormat .META_DOC_VALUES_CODEC ,
109
- Composite99DocValuesFormat .META_DOC_VALUES_EXTENSION
106
+ Composite912DocValuesFormat .DATA_DOC_VALUES_CODEC ,
107
+ Composite912DocValuesFormat .DATA_DOC_VALUES_EXTENSION ,
108
+ Composite912DocValuesFormat .META_DOC_VALUES_CODEC ,
109
+ Composite912DocValuesFormat .META_DOC_VALUES_EXTENSION
110
110
);
111
111
112
112
String dataFileName = IndexFileNames .segmentFileName (
113
113
this .state .segmentInfo .name ,
114
114
this .state .segmentSuffix ,
115
- Composite99DocValuesFormat .DATA_EXTENSION
115
+ Composite912DocValuesFormat .DATA_EXTENSION
116
116
);
117
117
dataOut = this .state .directory .createOutput (dataFileName , this .state .context );
118
118
CodecUtil .writeIndexHeader (
119
119
dataOut ,
120
- Composite99DocValuesFormat .DATA_CODEC_NAME ,
121
- Composite99DocValuesFormat .VERSION_CURRENT ,
120
+ Composite912DocValuesFormat .DATA_CODEC_NAME ,
121
+ Composite912DocValuesFormat .VERSION_CURRENT ,
122
122
this .state .segmentInfo .getId (),
123
123
this .state .segmentSuffix
124
124
);
125
125
126
126
String metaFileName = IndexFileNames .segmentFileName (
127
127
this .state .segmentInfo .name ,
128
128
this .state .segmentSuffix ,
129
- Composite99DocValuesFormat .META_EXTENSION
129
+ Composite912DocValuesFormat .META_EXTENSION
130
130
);
131
131
metaOut = this .state .directory .createOutput (metaFileName , this .state .context );
132
132
CodecUtil .writeIndexHeader (
133
133
metaOut ,
134
- Composite99DocValuesFormat .META_CODEC_NAME ,
135
- Composite99DocValuesFormat .VERSION_CURRENT ,
134
+ Composite912DocValuesFormat .META_CODEC_NAME ,
135
+ Composite912DocValuesFormat .VERSION_CURRENT ,
136
136
this .state .segmentInfo .getId (),
137
137
this .state .segmentSuffix
138
138
);
@@ -197,12 +197,12 @@ public void close() throws IOException {
197
197
success = true ;
198
198
} finally {
199
199
if (success ) {
200
- IOUtils .close (dataOut , metaOut , composite99DocValuesConsumer );
200
+ IOUtils .close (dataOut , metaOut , compositeDocValuesConsumer );
201
201
} else {
202
- IOUtils .closeWhileHandlingException (dataOut , metaOut , composite99DocValuesConsumer );
202
+ IOUtils .closeWhileHandlingException (dataOut , metaOut , compositeDocValuesConsumer );
203
203
}
204
204
metaOut = dataOut = null ;
205
- composite99DocValuesConsumer = null ;
205
+ compositeDocValuesConsumer = null ;
206
206
}
207
207
}
208
208
@@ -224,7 +224,7 @@ private void createCompositeIndicesIfPossible(DocValuesProducer valuesProducer,
224
224
for (CompositeMappedFieldType mappedType : compositeMappedFieldTypes ) {
225
225
if (mappedType instanceof StarTreeMapper .StarTreeFieldType ) {
226
226
try (StarTreesBuilder starTreesBuilder = new StarTreesBuilder (state , mapperService , fieldNumberAcrossCompositeFields )) {
227
- starTreesBuilder .build (metaOut , dataOut , fieldProducerMap , composite99DocValuesConsumer );
227
+ starTreesBuilder .build (metaOut , dataOut , fieldProducerMap , compositeDocValuesConsumer );
228
228
}
229
229
}
230
230
}
@@ -313,7 +313,7 @@ private void mergeStarTreeFields(MergeState mergeState) throws IOException {
313
313
}
314
314
}
315
315
try (StarTreesBuilder starTreesBuilder = new StarTreesBuilder (state , mapperService , fieldNumberAcrossCompositeFields )) {
316
- starTreesBuilder .buildDuringMerge (metaOut , dataOut , starTreeSubsPerField , composite99DocValuesConsumer );
316
+ starTreesBuilder .buildDuringMerge (metaOut , dataOut , starTreeSubsPerField , compositeDocValuesConsumer );
317
317
}
318
318
}
319
319
0 commit comments