@@ -683,10 +683,10 @@ func (c *compaction) errorOnUserKeyOverlap(ve *versionEdit) error {
683683 if n := len (ve .NewTables ); n > 1 {
684684 meta := ve .NewTables [n - 1 ].Meta
685685 prevMeta := ve .NewTables [n - 2 ].Meta
686- if ! prevMeta .Largest .IsExclusiveSentinel () &&
687- c .cmp (prevMeta .Largest .UserKey , meta .Smallest .UserKey ) >= 0 {
686+ if ! prevMeta .Largest () .IsExclusiveSentinel () &&
687+ c .cmp (prevMeta .Largest () .UserKey , meta .Smallest () .UserKey ) >= 0 {
688688 return errors .Errorf ("pebble: compaction split user key across two sstables: %s in %s and %s" ,
689- prevMeta .Largest .Pretty (c .formatKey ),
689+ prevMeta .Largest () .Pretty (c .formatKey ),
690690 prevMeta .FileNum ,
691691 meta .FileNum )
692692 }
@@ -1000,7 +1000,7 @@ func (c *compaction) String() string {
10001000 i := level - c .startLevel .level
10011001 fmt .Fprintf (& buf , "%d:" , level )
10021002 for f := range c .inputs [i ].files .All () {
1003- fmt .Fprintf (& buf , " %s:%s-%s" , f .FileNum , f .Smallest , f .Largest )
1003+ fmt .Fprintf (& buf , " %s:%s-%s" , f .FileNum , f .Smallest () , f .Largest () )
10041004 }
10051005 fmt .Fprintf (& buf , "\n " )
10061006 }
@@ -1319,8 +1319,8 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
13191319
13201320 // This file fits perfectly within the excise span, so we can slot it at L6.
13211321 if ingestFlushable .exciseSpan .Valid () &&
1322- ingestFlushable .exciseSpan .Contains (d .cmp , file .Smallest ) &&
1323- ingestFlushable .exciseSpan .Contains (d .cmp , file .Largest ) {
1322+ ingestFlushable .exciseSpan .Contains (d .cmp , file .Smallest () ) &&
1323+ ingestFlushable .exciseSpan .Contains (d .cmp , file .Largest () ) {
13241324 level = 6
13251325 } else {
13261326 // TODO(radu): this can perform I/O; we should not do this while holding DB.mu.
@@ -2146,7 +2146,7 @@ func (h *deleteCompactionHint) canDeleteOrExcise(
21462146 default :
21472147 panic (fmt .Sprintf ("pebble: unknown delete compaction hint type: %d" , h .hintType ))
21482148 }
2149- if cmp (h .start , m .Smallest .UserKey ) <= 0 &&
2149+ if cmp (h .start , m .Smallest () .UserKey ) <= 0 &&
21502150 base .UserKeyExclusive (h .end ).CompareUpperBounds (cmp , m .UserKeyBounds ().End ) >= 0 {
21512151 return hintDeletesFile
21522152 }
@@ -2157,7 +2157,7 @@ func (h *deleteCompactionHint) canDeleteOrExcise(
21572157 }
21582158 // Check for any overlap. In cases of partial overlap, we can excise the part of the file
21592159 // that overlaps with the deletion hint.
2160- if cmp (h .end , m .Smallest .UserKey ) > 0 &&
2160+ if cmp (h .end , m .Smallest () .UserKey ) > 0 &&
21612161 (m .UserKeyBounds ().End .CompareUpperBounds (cmp , base .UserKeyInclusive (h .start )) >= 0 ) {
21622162 return hintExcisesFile
21632163 }
@@ -2260,7 +2260,7 @@ func checkDeleteCompactionHints(
22602260 // leaves a fragment of the file on the left, decrement
22612261 // the counter once. If the hint leaves a fragment of the
22622262 // file on the right, decrement the counter once.
2263- if cmp (h .start , m .Smallest .UserKey ) > 0 {
2263+ if cmp (h .start , m .Smallest () .UserKey ) > 0 {
22642264 filesDeletedByCurrentHint --
22652265 }
22662266 if m .UserKeyBounds ().End .IsUpperBoundFor (cmp , h .end ) {
@@ -2660,7 +2660,7 @@ func (d *DB) runCopyCompaction(
26602660 }
26612661 deleteOnExit = true
26622662
2663- start , end := newMeta .Smallest , newMeta .Largest
2663+ start , end := newMeta .Smallest () , newMeta .Largest ()
26642664 if newMeta .SyntheticPrefixAndSuffix .HasPrefix () {
26652665 syntheticPrefix := newMeta .SyntheticPrefixAndSuffix .Prefix ()
26662666 start .UserKey = syntheticPrefix .Invert (start .UserKey )
@@ -2797,7 +2797,7 @@ func (d *DB) runDeleteOnlyCompactionForLevel(
27972797 // it maps to a virtual file that replaces f, or nil if f got removed
27982798 // in its entirety.
27992799 curFile := f
2800- for curFragment < len (fragments ) && d .cmp (fragments [curFragment ].start , f .Smallest .UserKey ) <= 0 {
2800+ for curFragment < len (fragments ) && d .cmp (fragments [curFragment ].start , f .Smallest () .UserKey ) <= 0 {
28012801 curFragment ++
28022802 }
28032803 if curFragment > 0 {
@@ -3284,7 +3284,7 @@ func (c *compaction) makeVersionEdit(result compact.Result) (*versionEdit, error
32843284
32853285 // Sanity check that the tables are ordered and don't overlap.
32863286 for i := 1 ; i < len (ve .NewTables ); i ++ {
3287- if ve .NewTables [i - 1 ].Meta .UserKeyBounds ().End .IsUpperBoundFor (c .cmp , ve .NewTables [i ].Meta .Smallest .UserKey ) {
3287+ if ve .NewTables [i - 1 ].Meta .UserKeyBounds ().End .IsUpperBoundFor (c .cmp , ve .NewTables [i ].Meta .Smallest () .UserKey ) {
32883288 return nil , base .AssertionFailedf ("pebble: compaction output tables overlap: %s and %s" ,
32893289 ve .NewTables [i - 1 ].Meta .DebugString (c .formatKey , true ),
32903290 ve .NewTables [i ].Meta .DebugString (c .formatKey , true ),
@@ -3399,11 +3399,11 @@ func validateVersionEdit(
33993399
34003400 // Validate both new and deleted files.
34013401 for _ , f := range ve .NewTables {
3402- validateKey (f .Meta , f .Meta .Smallest .UserKey )
3403- validateKey (f .Meta , f .Meta .Largest .UserKey )
3402+ validateKey (f .Meta , f .Meta .Smallest () .UserKey )
3403+ validateKey (f .Meta , f .Meta .Largest () .UserKey )
34043404 }
34053405 for _ , m := range ve .DeletedTables {
3406- validateKey (m , m .Smallest .UserKey )
3407- validateKey (m , m .Largest .UserKey )
3406+ validateKey (m , m .Smallest () .UserKey )
3407+ validateKey (m , m .Largest () .UserKey )
34083408 }
34093409}
0 commit comments