@@ -93,16 +93,16 @@ public void testGetAdditionalIndexSettings() throws Exception {
93
93
}
94
94
""" ;
95
95
Settings .Builder additionalSettings = builder ();
96
- provider .provideAdditionalMetadata (
96
+ provider .provideAdditionalSettings (
97
97
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
98
98
dataStreamName ,
99
99
IndexMode .TIME_SERIES ,
100
100
projectMetadata ,
101
101
now ,
102
102
settings ,
103
103
List .of (new CompressedXContent (mapping )),
104
- additionalSettings ,
105
- ( k , v ) -> {}
104
+ IndexVersion . current () ,
105
+ additionalSettings
106
106
);
107
107
Settings result = additionalSettings .build ();
108
108
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -147,16 +147,16 @@ public void testGetAdditionalIndexSettingsIndexRoutingPathAlreadyDefined() throw
147
147
}
148
148
""" ;
149
149
Settings .Builder additionalSettings = builder ();
150
- provider .provideAdditionalMetadata (
150
+ provider .provideAdditionalSettings (
151
151
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
152
152
dataStreamName ,
153
153
IndexMode .TIME_SERIES ,
154
154
projectMetadata ,
155
155
now ,
156
156
settings ,
157
157
List .of (new CompressedXContent (mapping )),
158
- additionalSettings ,
159
- ( k , v ) -> {}
158
+ IndexVersion . current () ,
159
+ additionalSettings
160
160
);
161
161
Settings result = additionalSettings .build ();
162
162
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -221,16 +221,16 @@ public void testGetAdditionalIndexSettingsMappingsMerging() throws Exception {
221
221
}
222
222
""" ;
223
223
Settings .Builder additionalSettings = builder ();
224
- provider .provideAdditionalMetadata (
224
+ provider .provideAdditionalSettings (
225
225
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
226
226
dataStreamName ,
227
227
IndexMode .TIME_SERIES ,
228
228
projectMetadata ,
229
229
now ,
230
230
settings ,
231
231
List .of (new CompressedXContent (mapping1 ), new CompressedXContent (mapping2 ), new CompressedXContent (mapping3 )),
232
- additionalSettings ,
233
- ( k , v ) -> {}
232
+ IndexVersion . current () ,
233
+ additionalSettings
234
234
);
235
235
Settings result = additionalSettings .build ();
236
236
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -255,16 +255,16 @@ public void testGetAdditionalIndexSettingsNoMappings() {
255
255
Instant now = Instant .now ().truncatedTo (ChronoUnit .SECONDS );
256
256
Settings settings = Settings .EMPTY ;
257
257
Settings .Builder additionalSettings = builder ();
258
- provider .provideAdditionalMetadata (
258
+ provider .provideAdditionalSettings (
259
259
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
260
260
dataStreamName ,
261
261
IndexMode .TIME_SERIES ,
262
262
projectMetadata ,
263
263
now ,
264
264
settings ,
265
265
List .of (),
266
- additionalSettings ,
267
- ( k , v ) -> {}
266
+ IndexVersion . current () ,
267
+ additionalSettings
268
268
);
269
269
Settings result = additionalSettings .build ();
270
270
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -284,16 +284,16 @@ public void testGetAdditionalIndexSettingsLookAheadTime() throws Exception {
284
284
TimeValue lookAheadTime = TimeValue .timeValueMinutes (30 );
285
285
Settings settings = builder ().put ("index.mode" , "time_series" ).put ("index.look_ahead_time" , lookAheadTime .getStringRep ()).build ();
286
286
Settings .Builder additionalSettings = builder ();
287
- provider .provideAdditionalMetadata (
287
+ provider .provideAdditionalSettings (
288
288
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
289
289
dataStreamName ,
290
290
IndexMode .TIME_SERIES ,
291
291
projectMetadata ,
292
292
now ,
293
293
settings ,
294
294
List .of (new CompressedXContent ("{}" )),
295
- additionalSettings ,
296
- ( k , v ) -> {}
295
+ IndexVersion . current () ,
296
+ additionalSettings
297
297
);
298
298
Settings result = additionalSettings .build ();
299
299
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -313,16 +313,16 @@ public void testGetAdditionalIndexSettingsLookBackTime() throws Exception {
313
313
TimeValue lookBackTime = TimeValue .timeValueHours (12 );
314
314
Settings settings = builder ().put ("index.mode" , "time_series" ).put ("index.look_back_time" , lookBackTime .getStringRep ()).build ();
315
315
Settings .Builder additionalSettings = builder ();
316
- provider .provideAdditionalMetadata (
316
+ provider .provideAdditionalSettings (
317
317
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
318
318
dataStreamName ,
319
319
IndexMode .TIME_SERIES ,
320
320
projectMetadata ,
321
321
now ,
322
322
settings ,
323
323
List .of (new CompressedXContent ("{}" )),
324
- additionalSettings ,
325
- ( k , v ) -> {}
324
+ IndexVersion . current () ,
325
+ additionalSettings
326
326
);
327
327
Settings result = additionalSettings .build ();
328
328
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -349,16 +349,16 @@ public void testGetAdditionalIndexSettingsDataStreamAlreadyCreated() throws Exce
349
349
Instant now = sixHoursAgo .plus (6 , ChronoUnit .HOURS );
350
350
Settings settings = Settings .EMPTY ;
351
351
Settings .Builder additionalSettings = builder ();
352
- provider .provideAdditionalMetadata (
352
+ provider .provideAdditionalSettings (
353
353
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
354
354
dataStreamName ,
355
355
IndexMode .TIME_SERIES ,
356
356
projectMetadata ,
357
357
now ,
358
358
settings ,
359
359
List .of (new CompressedXContent ("{}" )),
360
- additionalSettings ,
361
- ( k , v ) -> {}
360
+ IndexVersion . current () ,
361
+ additionalSettings
362
362
);
363
363
var result = additionalSettings .build ();
364
364
assertThat (result .size (), equalTo (2 ));
@@ -389,16 +389,16 @@ public void testGetAdditionalIndexSettingsDataStreamAlreadyCreatedTimeSettingsMi
389
389
Settings settings = Settings .EMPTY ;
390
390
Exception e = expectThrows (
391
391
IllegalStateException .class ,
392
- () -> provider .provideAdditionalMetadata (
392
+ () -> provider .provideAdditionalSettings (
393
393
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
394
394
dataStreamName ,
395
395
IndexMode .TIME_SERIES ,
396
396
projectMetadata ,
397
397
now ,
398
398
settings ,
399
399
null ,
400
- builder (),
401
- ( k , v ) -> {}
400
+ IndexVersion . current (),
401
+ builder ()
402
402
)
403
403
);
404
404
assertThat (
@@ -418,16 +418,16 @@ public void testGetAdditionalIndexSettingsNonTsdbTemplate() {
418
418
419
419
Settings settings = Settings .EMPTY ;
420
420
Settings .Builder additionalSettings = builder ();
421
- provider .provideAdditionalMetadata (
421
+ provider .provideAdditionalSettings (
422
422
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
423
423
dataStreamName ,
424
424
null ,
425
425
projectMetadata ,
426
426
Instant .ofEpochMilli (1L ),
427
427
settings ,
428
428
null ,
429
- additionalSettings ,
430
- ( k , v ) -> {}
429
+ IndexVersion . current () ,
430
+ additionalSettings
431
431
);
432
432
Settings result = additionalSettings .build ();
433
433
assertThat (result .size (), equalTo (0 ));
@@ -444,16 +444,16 @@ public void testGetAdditionalIndexSettingsMigrateToTsdb() {
444
444
445
445
Settings settings = Settings .EMPTY ;
446
446
Settings .Builder additionalSettings = builder ();
447
- provider .provideAdditionalMetadata (
447
+ provider .provideAdditionalSettings (
448
448
DataStream .getDefaultBackingIndexName (dataStreamName , 2 ),
449
449
dataStreamName ,
450
450
IndexMode .TIME_SERIES ,
451
451
projectMetadata ,
452
452
now ,
453
453
settings ,
454
454
List .of (),
455
- additionalSettings ,
456
- ( k , v ) -> {}
455
+ IndexVersion . current () ,
456
+ additionalSettings
457
457
);
458
458
Settings result = additionalSettings .build ();
459
459
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -477,16 +477,16 @@ public void testGetAdditionalIndexSettingsDowngradeFromTsdb() {
477
477
);
478
478
479
479
Settings .Builder additionalSettings = builder ();
480
- provider .provideAdditionalMetadata (
480
+ provider .provideAdditionalSettings (
481
481
DataStream .getDefaultBackingIndexName (dataStreamName , 2 ),
482
482
dataStreamName ,
483
483
null ,
484
484
projectMetadata ,
485
485
Instant .ofEpochMilli (1L ),
486
486
Settings .EMPTY ,
487
487
List .of (),
488
- additionalSettings ,
489
- ( k , v ) -> {}
488
+ IndexVersion . current () ,
489
+ additionalSettings
490
490
);
491
491
Settings result = additionalSettings .build ();
492
492
assertThat (result .size (), equalTo (0 ));
@@ -954,16 +954,16 @@ private Settings generateTsdbSettings(String mapping, Instant now) throws IOExce
954
954
Settings settings = Settings .EMPTY ;
955
955
956
956
Settings .Builder additionalSettings = builder ();
957
- provider .provideAdditionalMetadata (
957
+ provider .provideAdditionalSettings (
958
958
DataStream .getDefaultBackingIndexName (dataStreamName , 1 ),
959
959
dataStreamName ,
960
960
IndexMode .TIME_SERIES ,
961
961
projectMetadata ,
962
962
now ,
963
963
settings ,
964
964
List .of (new CompressedXContent (mapping )),
965
- additionalSettings ,
966
- ( k , v ) -> {}
965
+ IndexVersion . current () ,
966
+ additionalSettings
967
967
);
968
968
var result = additionalSettings .build ();
969
969
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
@@ -1002,7 +1002,7 @@ private Settings onUpdateMappings(String routingPath, String dimensions, String
1002
1002
documentMapper = mapperService .documentMapper ();
1003
1003
}
1004
1004
Settings .Builder additionalSettings = builder ();
1005
- provider .onUpdateMappings (im , documentMapper , additionalSettings , ( k , v ) -> {} );
1005
+ provider .onUpdateMappings (im , documentMapper , additionalSettings );
1006
1006
return additionalSettings .build ();
1007
1007
}
1008
1008
0 commit comments