@@ -137,7 +137,7 @@ const (
137
137
// retained and linked in a new level without being obsoleted.
138
138
compactionKindMove
139
139
// compactionKindCopy denotes a copy compaction where the input file is
140
- // copied byte-by-byte into a new file with a new FileNum in the output level.
140
+ // copied byte-by-byte into a new file with a new TableNum in the output level.
141
141
compactionKindCopy
142
142
// compactionKindDeleteOnly denotes a compaction that only deletes input
143
143
// files. It can occur when wide range tombstones completely contain sstables.
@@ -1060,7 +1060,7 @@ type readCompaction struct {
1060
1060
// The file associated with the compaction.
1061
1061
// If the file no longer belongs in the same
1062
1062
// level, then we skip the compaction.
1063
- fileNum base.FileNum
1063
+ tableNum base.TableNum
1064
1064
}
1065
1065
1066
1066
func (d * DB ) addInProgressCompaction (c * compaction ) {
@@ -1345,7 +1345,7 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
1345
1345
},
1346
1346
v : c .version ,
1347
1347
}
1348
- replacedFiles := make (map [base.FileNum ][]newTableEntry )
1348
+ replacedTables := make (map [base.TableNum ][]newTableEntry )
1349
1349
for _ , file := range ingestFlushable .files {
1350
1350
var fileToSplit * tableMetadata
1351
1351
var level int
@@ -1396,14 +1396,14 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
1396
1396
return nil , err
1397
1397
}
1398
1398
newFiles := applyExciseToVersionEdit (ve , m , leftTable , rightTable , layer .Level ())
1399
- replacedFiles [m .TableNum ] = newFiles
1399
+ replacedTables [m .TableNum ] = newFiles
1400
1400
updateLevelMetricsOnExcise (m , layer .Level (), newFiles )
1401
1401
}
1402
1402
}
1403
1403
}
1404
1404
1405
1405
if len (ingestSplitFiles ) > 0 {
1406
- if err := d .ingestSplit (context .TODO (), ve , updateLevelMetricsOnExcise , ingestSplitFiles , replacedFiles ); err != nil {
1406
+ if err := d .ingestSplit (context .TODO (), ve , updateLevelMetricsOnExcise , ingestSplitFiles , replacedTables ); err != nil {
1407
1407
return nil , err
1408
1408
}
1409
1409
}
@@ -2451,9 +2451,9 @@ func (d *DB) cleanupVersionEdit(ve *versionEdit) {
2451
2451
TableBackings : make ([]* manifest.TableBacking , 0 , len (ve .NewTables )),
2452
2452
BlobFiles : make ([]* manifest.BlobFileMetadata , 0 , len (ve .NewBlobFiles )),
2453
2453
}
2454
- deletedFiles := make (map [base.FileNum ]struct {})
2454
+ deletedTables := make (map [base.TableNum ]struct {})
2455
2455
for key := range ve .DeletedTables {
2456
- deletedFiles [key .FileNum ] = struct {}{}
2456
+ deletedTables [key .FileNum ] = struct {}{}
2457
2457
}
2458
2458
for i := range ve .NewBlobFiles {
2459
2459
obsoleteFiles .AddBlob (ve .NewBlobFiles [i ])
@@ -2470,7 +2470,7 @@ func (d *DB) cleanupVersionEdit(ve *versionEdit) {
2470
2470
// We handle backing files separately.
2471
2471
continue
2472
2472
}
2473
- if _ , ok := deletedFiles [ve .NewTables [i ].Meta .TableNum ]; ok {
2473
+ if _ , ok := deletedTables [ve .NewTables [i ].Meta .TableNum ]; ok {
2474
2474
// This file is being moved in this ve to a different level.
2475
2475
// Don't mark it as obsolete.
2476
2476
continue
@@ -2578,7 +2578,7 @@ func (d *DB) compact1(c *compaction, errChannel chan error) (err error) {
2578
2578
return err
2579
2579
}
2580
2580
2581
- // runCopyCompaction runs a copy compaction where a new FileNum is created that
2581
+ // runCopyCompaction runs a copy compaction where a new TableNum is created that
2582
2582
// is a byte-for-byte copy of the input file or span thereof in some cases. This
2583
2583
// is used in lieu of a move compaction when a file is being moved across the
2584
2584
// local/remote storage boundary. It could also be used in lieu of a rewrite
@@ -2647,7 +2647,7 @@ func (d *DB) runCopyCompaction(
2647
2647
if inputMeta .HasRangeKeys {
2648
2648
newMeta .ExtendRangeKeyBounds (c .cmp , inputMeta .RangeKeyBounds .Smallest (), inputMeta .RangeKeyBounds .Largest ())
2649
2649
}
2650
- newMeta .TableNum = d .mu .versions .getNextFileNum ()
2650
+ newMeta .TableNum = d .mu .versions .getNextTableNum ()
2651
2651
if objMeta .IsExternal () {
2652
2652
// external -> local/shared copy. File must be virtual.
2653
2653
// We will update this size later after we produce the new backing file.
0 commit comments