@@ -3390,18 +3390,17 @@ func TestTombstoneDensityCompactionMoveOptimization(t *testing.T) {
33903390 meta := & manifest.TableMetadata {
33913391 TableNum : 1 ,
33923392 Size : 1024 ,
3393- Stats : manifest.TableStats {
3394- NumEntries : 10 ,
3395- NumDeletions : 8 ,
3396- TombstoneDenseBlocksRatio : 0.9 , // Above threshold
3397- },
33983393 }
3394+ meta .PopulateStats (& manifest.TableStats {
3395+ NumEntries : 10 ,
3396+ NumDeletions : 8 ,
3397+ TombstoneDenseBlocksRatio : 0.9 , // Above threshold
3398+ })
33993399 meta .ExtendPointKeyBounds (opts .Comparer .Compare ,
34003400 base .ParseInternalKey ("a.SET.1" ),
34013401 base .ParseInternalKey ("z.SET.2" ),
34023402 )
34033403 meta .InitPhysicalBacking ()
3404- meta .StatsMarkValid ()
34053404
34063405 // Set up the version: L4 has the file, L5 and L6 are empty.
34073406 var files [numLevels ][]* manifest.TableMetadata
@@ -3490,18 +3489,17 @@ func TestTombstoneDensityCompactionMoveOptimization_NoMoveWithOverlap(t *testing
34903489 metaL4 := & manifest.TableMetadata {
34913490 TableNum : 1 ,
34923491 Size : 1024 ,
3493- Stats : manifest.TableStats {
3494- NumEntries : 10 ,
3495- NumDeletions : 8 ,
3496- TombstoneDenseBlocksRatio : 0.9 , // Above threshold
3497- },
34983492 }
3493+ metaL4 .PopulateStats (& manifest.TableStats {
3494+ NumEntries : 10 ,
3495+ NumDeletions : 8 ,
3496+ TombstoneDenseBlocksRatio : 0.9 , // Above threshold
3497+ })
34993498 metaL4 .ExtendPointKeyBounds (opts .Comparer .Compare ,
35003499 base .ParseInternalKey ("a.SET.1" ),
35013500 base .ParseInternalKey ("z.SET.2" ),
35023501 )
35033502 metaL4 .InitPhysicalBacking ()
3504- metaL4 .StatsMarkValid ()
35053503
35063504 // Create an overlapping file in L5.
35073505 metaL5 := & manifest.TableMetadata {
@@ -3513,7 +3511,7 @@ func TestTombstoneDensityCompactionMoveOptimization_NoMoveWithOverlap(t *testing
35133511 base .ParseInternalKey ("z.SET.3" ),
35143512 )
35153513 metaL5 .InitPhysicalBacking ()
3516- metaL5 .StatsMarkValid ( )
3514+ metaL5 .PopulateStats ( & manifest. TableStats {} )
35173515
35183516 // Set up the version: L4 has metaL4, L5 has metaL5.
35193517 var files [numLevels ][]* manifest.TableMetadata
@@ -3571,18 +3569,17 @@ func TestTombstoneDensityCompactionMoveOptimization_GrandparentOverlapTooLarge(t
35713569 metaL4 := & manifest.TableMetadata {
35723570 TableNum : 1 ,
35733571 Size : 1024 ,
3574- Stats : manifest.TableStats {
3575- NumEntries : 10 ,
3576- NumDeletions : 8 ,
3577- TombstoneDenseBlocksRatio : 0.9 ,
3578- },
35793572 }
3573+ metaL4 .PopulateStats (& manifest.TableStats {
3574+ NumEntries : 10 ,
3575+ NumDeletions : 8 ,
3576+ TombstoneDenseBlocksRatio : 0.9 ,
3577+ })
35803578 metaL4 .ExtendPointKeyBounds (opts .Comparer .Compare ,
35813579 base .ParseInternalKey ("a.SET.1" ),
35823580 base .ParseInternalKey ("z.SET.2" ),
35833581 )
35843582 metaL4 .InitPhysicalBacking ()
3585- metaL4 .StatsMarkValid ()
35863583
35873584 // Large overlapping file in L6 (grandparent level).
35883585 metaL6 := & manifest.TableMetadata {
@@ -3594,7 +3591,7 @@ func TestTombstoneDensityCompactionMoveOptimization_GrandparentOverlapTooLarge(t
35943591 base .ParseInternalKey ("z.SET.3" ),
35953592 )
35963593 metaL6 .InitPhysicalBacking ()
3597- metaL6 .StatsMarkValid ( )
3594+ metaL6 .PopulateStats ( & manifest. TableStats {} )
35983595
35993596 var files [numLevels ][]* manifest.TableMetadata
36003597 files [inputLevel ] = []* manifest.TableMetadata {metaL4 }
@@ -3634,18 +3631,17 @@ func TestTombstoneDensityCompactionMoveOptimization_BelowDensityThreshold(t *tes
36343631 meta := & manifest.TableMetadata {
36353632 TableNum : 1 ,
36363633 Size : 1024 ,
3637- Stats : manifest.TableStats {
3638- NumEntries : 10 ,
3639- NumDeletions : 5 ,
3640- TombstoneDenseBlocksRatio : 0.5 , // Below threshold
3641- },
36423634 }
3635+ meta .PopulateStats (& manifest.TableStats {
3636+ NumEntries : 10 ,
3637+ NumDeletions : 5 ,
3638+ TombstoneDenseBlocksRatio : 0.5 , // Below threshold
3639+ })
36433640 meta .ExtendPointKeyBounds (opts .Comparer .Compare ,
36443641 base .ParseInternalKey ("a.SET.1" ),
36453642 base .ParseInternalKey ("z.SET.2" ),
36463643 )
36473644 meta .InitPhysicalBacking ()
3648- meta .StatsMarkValid ()
36493645
36503646 var files [numLevels ][]* manifest.TableMetadata
36513647 files [inputLevel ] = []* manifest.TableMetadata {meta }
0 commit comments