@@ -272,8 +272,8 @@ public void testSegments() throws Exception {
272
272
InternalEngine engine = createEngine (config (indexSettings , store , createTempDir (), NoMergePolicy .INSTANCE , null ))) {
273
273
List <Segment > segments = engine .segments (false );
274
274
assertThat (segments .isEmpty (), equalTo (true ));
275
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (0L ));
276
- assertThat (engine .segmentsStats (false ).getMemoryInBytes (), equalTo (0L ));
275
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (0L ));
276
+ assertThat (engine .segmentsStats (false , false ).getMemoryInBytes (), equalTo (0L ));
277
277
278
278
// create two docs and refresh
279
279
ParsedDocument doc = testParsedDocument ("1" , null , testDocumentWithTextField (), B_1 , null );
@@ -287,7 +287,7 @@ public void testSegments() throws Exception {
287
287
288
288
segments = engine .segments (false );
289
289
assertThat (segments .size (), equalTo (1 ));
290
- SegmentsStats stats = engine .segmentsStats (false );
290
+ SegmentsStats stats = engine .segmentsStats (false , false );
291
291
assertThat (stats .getCount (), equalTo (1L ));
292
292
assertThat (stats .getTermsMemoryInBytes (), greaterThan (0L ));
293
293
assertThat (stats .getStoredFieldsMemoryInBytes (), greaterThan (0L ));
@@ -306,7 +306,7 @@ public void testSegments() throws Exception {
306
306
307
307
segments = engine .segments (false );
308
308
assertThat (segments .size (), equalTo (1 ));
309
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (1L ));
309
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (1L ));
310
310
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
311
311
assertThat (segments .get (0 ).isSearch (), equalTo (true ));
312
312
assertThat (segments .get (0 ).getNumDocs (), equalTo (2 ));
@@ -319,15 +319,15 @@ public void testSegments() throws Exception {
319
319
320
320
segments = engine .segments (false );
321
321
assertThat (segments .size (), equalTo (2 ));
322
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (2L ));
323
- assertThat (engine .segmentsStats (false ).getTermsMemoryInBytes (),
322
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (2L ));
323
+ assertThat (engine .segmentsStats (false , false ).getTermsMemoryInBytes (),
324
324
greaterThan (stats .getTermsMemoryInBytes ()));
325
- assertThat (engine .segmentsStats (false ).getStoredFieldsMemoryInBytes (),
325
+ assertThat (engine .segmentsStats (false , false ).getStoredFieldsMemoryInBytes (),
326
326
greaterThan (stats .getStoredFieldsMemoryInBytes ()));
327
- assertThat (engine .segmentsStats (false ).getTermVectorsMemoryInBytes (), equalTo (0L ));
328
- assertThat (engine .segmentsStats (false ).getNormsMemoryInBytes (),
327
+ assertThat (engine .segmentsStats (false , false ).getTermVectorsMemoryInBytes (), equalTo (0L ));
328
+ assertThat (engine .segmentsStats (false , false ).getNormsMemoryInBytes (),
329
329
greaterThan (stats .getNormsMemoryInBytes ()));
330
- assertThat (engine .segmentsStats (false ).getDocValuesMemoryInBytes (),
330
+ assertThat (engine .segmentsStats (false , false ).getDocValuesMemoryInBytes (),
331
331
greaterThan (stats .getDocValuesMemoryInBytes ()));
332
332
assertThat (segments .get (0 ).getGeneration () < segments .get (1 ).getGeneration (), equalTo (true ));
333
333
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
@@ -349,7 +349,7 @@ public void testSegments() throws Exception {
349
349
350
350
segments = engine .segments (false );
351
351
assertThat (segments .size (), equalTo (2 ));
352
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (2L ));
352
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (2L ));
353
353
assertThat (segments .get (0 ).getGeneration () < segments .get (1 ).getGeneration (), equalTo (true ));
354
354
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
355
355
assertThat (segments .get (0 ).isSearch (), equalTo (true ));
@@ -370,7 +370,7 @@ public void testSegments() throws Exception {
370
370
371
371
segments = engine .segments (false );
372
372
assertThat (segments .size (), equalTo (3 ));
373
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (3L ));
373
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (3L ));
374
374
assertThat (segments .get (0 ).getGeneration () < segments .get (1 ).getGeneration (), equalTo (true ));
375
375
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
376
376
assertThat (segments .get (0 ).isSearch (), equalTo (true ));
@@ -397,7 +397,7 @@ public void testSegments() throws Exception {
397
397
398
398
segments = engine .segments (false );
399
399
assertThat (segments .size (), equalTo (4 ));
400
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (4L ));
400
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (4L ));
401
401
assertThat (segments .get (0 ).getGeneration () < segments .get (1 ).getGeneration (), equalTo (true ));
402
402
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
403
403
assertThat (segments .get (0 ).isSearch (), equalTo (true ));
@@ -427,7 +427,7 @@ public void testSegments() throws Exception {
427
427
engine .refresh ("test" );
428
428
segments = engine .segments (false );
429
429
assertThat (segments .size (), equalTo (4 ));
430
- assertThat (engine .segmentsStats (false ).getCount (), equalTo (4L ));
430
+ assertThat (engine .segmentsStats (false , false ).getCount (), equalTo (4L ));
431
431
assertThat (segments .get (0 ).getGeneration () < segments .get (1 ).getGeneration (), equalTo (true ));
432
432
assertThat (segments .get (0 ).isCommitted (), equalTo (true ));
433
433
assertThat (segments .get (0 ).isSearch (), equalTo (true ));
@@ -572,13 +572,13 @@ public void testSegmentsWithIndexSort() throws Exception {
572
572
public void testSegmentsStatsIncludingFileSizes () throws Exception {
573
573
try (Store store = createStore ();
574
574
Engine engine = createEngine (defaultSettings , store , createTempDir (), NoMergePolicy .INSTANCE )) {
575
- assertThat (engine .segmentsStats (true ).getFileSizes ().size (), equalTo (0 ));
575
+ assertThat (engine .segmentsStats (true , false ).getFileSizes ().size (), equalTo (0 ));
576
576
577
577
ParsedDocument doc = testParsedDocument ("1" , null , testDocumentWithTextField (), B_1 , null );
578
578
engine .index (indexForDoc (doc ));
579
579
engine .refresh ("test" );
580
580
581
- SegmentsStats stats = engine .segmentsStats (true );
581
+ SegmentsStats stats = engine .segmentsStats (true , false );
582
582
assertThat (stats .getFileSizes ().size (), greaterThan (0 ));
583
583
assertThat (() -> stats .getFileSizes ().valuesIt (), everyItem (greaterThan (0L )));
584
584
@@ -588,7 +588,7 @@ public void testSegmentsStatsIncludingFileSizes() throws Exception {
588
588
engine .index (indexForDoc (doc2 ));
589
589
engine .refresh ("test" );
590
590
591
- assertThat (engine .segmentsStats (true ).getFileSizes ().get (firstEntry .key ), greaterThan (firstEntry .value ));
591
+ assertThat (engine .segmentsStats (true , false ).getFileSizes ().get (firstEntry .key ), greaterThan (firstEntry .value ));
592
592
}
593
593
}
594
594
@@ -3698,23 +3698,23 @@ public void testEngineMaxTimestampIsInitialized() throws IOException {
3698
3698
NoMergePolicy .INSTANCE , null , null , globalCheckpoint ::get );
3699
3699
try (Store store = createStore (newFSDirectory (storeDir )); Engine engine = createEngine (configSupplier .apply (store ))) {
3700
3700
assertEquals (IndexRequest .UNSET_AUTO_GENERATED_TIMESTAMP ,
3701
- engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3701
+ engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3702
3702
final ParsedDocument doc = testParsedDocument ("1" , null , testDocumentWithTextField (),
3703
3703
new BytesArray ("{}" .getBytes (Charset .defaultCharset ())), null );
3704
3704
engine .index (appendOnlyPrimary (doc , true , timestamp1 ));
3705
- assertEquals (timestamp1 , engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3705
+ assertEquals (timestamp1 , engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3706
3706
}
3707
3707
try (Store store = createStore (newFSDirectory (storeDir ));
3708
3708
InternalEngine engine = new InternalEngine (configSupplier .apply (store ))) {
3709
3709
assertEquals (IndexRequest .UNSET_AUTO_GENERATED_TIMESTAMP ,
3710
- engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3710
+ engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3711
3711
engine .initializeMaxSeqNoOfUpdatesOrDeletes ();
3712
3712
engine .recoverFromTranslog (translogHandler , Long .MAX_VALUE );
3713
- assertEquals (timestamp1 , engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3713
+ assertEquals (timestamp1 , engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3714
3714
final ParsedDocument doc = testParsedDocument ("1" , null , testDocumentWithTextField (),
3715
3715
new BytesArray ("{}" .getBytes (Charset .defaultCharset ())), null );
3716
3716
engine .index (appendOnlyPrimary (doc , true , timestamp2 ));
3717
- assertEquals (maxTimestamp12 , engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3717
+ assertEquals (maxTimestamp12 , engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3718
3718
globalCheckpoint .set (1 ); // make sure flush cleans up commits for later.
3719
3719
engine .flush ();
3720
3720
}
@@ -3725,7 +3725,7 @@ public void testEngineMaxTimestampIsInitialized() throws IOException {
3725
3725
store .associateIndexWithNewTranslog (translogUUID );
3726
3726
}
3727
3727
try (Engine engine = new InternalEngine (configSupplier .apply (store ))) {
3728
- assertEquals (maxTimestamp12 , engine .segmentsStats (false ).getMaxUnsafeAutoIdTimestamp ());
3728
+ assertEquals (maxTimestamp12 , engine .segmentsStats (false , false ).getMaxUnsafeAutoIdTimestamp ());
3729
3729
}
3730
3730
}
3731
3731
}
0 commit comments