@@ -490,7 +490,7 @@ type currentBlobFile struct {
490
490
// referencing table number. This would likely be more memory efficient,
491
491
// reduce overall number of pointers to chase and suffer fewer allocations
492
492
// (and we can pool the B-Tree nodes to further reduce allocs)
493
- references map [base. TableNum ]struct {}
493
+ references map [* TableMetadata ]struct {}
494
494
// referencedValueSize is the sum of the length of uncompressed values in
495
495
// this blob file that are still live.
496
496
referencedValueSize uint64
@@ -576,7 +576,7 @@ func (s *CurrentBlobFileSet) Init(bve *BulkVersionEdit, h BlobRewriteHeuristic)
576
576
for blobFileID , pbf := range bve .BlobFiles .Added {
577
577
s .files [blobFileID ] = & currentBlobFile {
578
578
metadata : BlobFileMetadata {FileID : blobFileID , Physical : pbf },
579
- references : make (map [base. TableNum ]struct {}),
579
+ references : make (map [* TableMetadata ]struct {}),
580
580
}
581
581
s .stats .Count ++
582
582
s .stats .PhysicalSize += pbf .Size
@@ -591,7 +591,7 @@ func (s *CurrentBlobFileSet) Init(bve *BulkVersionEdit, h BlobRewriteHeuristic)
591
591
if ! ok {
592
592
panic (errors .AssertionFailedf ("pebble: referenced blob file %d not found" , ref .FileID ))
593
593
}
594
- cbf .references [table . TableNum ] = struct {}{}
594
+ cbf .references [table ] = struct {}{}
595
595
cbf .referencedValueSize += ref .ValueSize
596
596
s .stats .ReferencedValueSize += ref .ValueSize
597
597
s .stats .ReferencesCount ++
@@ -724,7 +724,7 @@ func (s *CurrentBlobFileSet) ApplyAndUpdateVersionEdit(ve *VersionEdit) error {
724
724
}
725
725
726
726
blobFileID := m .FileID
727
- cbf := & currentBlobFile {references : make (map [base. TableNum ]struct {})}
727
+ cbf := & currentBlobFile {references : make (map [* TableMetadata ]struct {})}
728
728
cbf .metadata = BlobFileMetadata {FileID : blobFileID , Physical : m .Physical }
729
729
s .files [blobFileID ] = cbf
730
730
s .stats .Count ++
@@ -742,7 +742,7 @@ func (s *CurrentBlobFileSet) ApplyAndUpdateVersionEdit(ve *VersionEdit) error {
742
742
if ! ok {
743
743
return errors .AssertionFailedf ("pebble: referenced blob file %d not found" , ref .FileID )
744
744
}
745
- cbf .references [e .Meta . TableNum ] = struct {}{}
745
+ cbf .references [e .Meta ] = struct {}{}
746
746
cbf .referencedValueSize += ref .ValueSize
747
747
s .stats .ReferencedValueSize += ref .ValueSize
748
748
s .stats .ReferencesCount ++
@@ -765,7 +765,7 @@ func (s *CurrentBlobFileSet) ApplyAndUpdateVersionEdit(ve *VersionEdit) error {
765
765
return errors .AssertionFailedf ("pebble: referenced value size %d for blob file %s is greater than the referenced value size %d" ,
766
766
ref .ValueSize , cbf .metadata .FileID , cbf .referencedValueSize )
767
767
}
768
- if _ , ok := cbf .references [meta . TableNum ]; ! ok {
768
+ if _ , ok := cbf .references [meta ]; ! ok {
769
769
return errors .AssertionFailedf ("pebble: deleted table %s's reference to blob file %s not known" ,
770
770
meta .TableNum , ref .FileID )
771
771
}
@@ -786,7 +786,7 @@ func (s *CurrentBlobFileSet) ApplyAndUpdateVersionEdit(ve *VersionEdit) error {
786
786
continue
787
787
}
788
788
// Remove the reference of this table to this blob file.
789
- delete (cbf .references , meta . TableNum )
789
+ delete (cbf .references , meta )
790
790
791
791
// If there are no more references to the blob file, remove it from
792
792
// the set and add the removal of the blob file to the version edit.
0 commit comments