Skip to content

Commit 7add5ef

Browse files
committed
db: rename excise to exciseTable
1 parent 647faa6 commit 7add5ef

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

compaction.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
13501350
// Iterate through all levels and find files that intersect with exciseSpan.
13511351
for layer, ls := range c.version.AllLevelsAndSublevels() {
13521352
for m := range ls.Overlaps(d.cmp, ingestFlushable.exciseSpan.UserKeyBounds()).All() {
1353-
newFiles, err := d.excise(context.TODO(), ingestFlushable.exciseSpan.UserKeyBounds(), m, ve, layer.Level())
1353+
newFiles, err := d.exciseTable(context.TODO(), ingestFlushable.exciseSpan.UserKeyBounds(), m, ve, layer.Level())
13541354
if err != nil {
13551355
return nil, err
13561356
}
@@ -2713,7 +2713,7 @@ func (d *DB) runCopyCompaction(
27132713

27142714
// applyHintOnFile applies a deleteCompactionHint to a file, and updates the
27152715
// versionEdit accordingly. It returns a list of new files that were created
2716-
// if the hint was applied partially to a file (eg. through an excise as opposed
2716+
// if the hint was applied partially to a file (eg. through an exciseTable as opposed
27172717
// to an outright deletion). levelMetrics is kept up-to-date with the number
27182718
// of tables deleted or excised.
27192719
func (d *DB) applyHintOnFile(
@@ -2745,7 +2745,7 @@ func (d *DB) applyHintOnFile(
27452745
}
27462746

27472747
levelMetrics.TablesExcised++
2748-
newFiles, err = d.excise(context.TODO(), base.UserKeyBoundsEndExclusive(h.start, h.end), f, ve, level)
2748+
newFiles, err = d.exciseTable(context.TODO(), base.UserKeyBoundsEndExclusive(h.start, h.end), f, ve, level)
27492749
if err != nil {
27502750
return nil, errors.Wrap(err, "error when running excise for delete-only compaction")
27512751
}

excise.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ func (d *DB) Excise(ctx context.Context, span KeyRange) error {
4444
return err
4545
}
4646

47-
// excise updates ve to include a replacement of the file m with new virtual
48-
// sstables that exclude exciseSpan, returning a slice of newly-created files if
49-
// any. If the entirety of m is deleted by exciseSpan, no new sstables are added
50-
// and m is deleted. Note that ve is updated in-place.
47+
// exciseTable updates ve to include a replacement of the table m with new
48+
// virtual sstables that exclude exciseSpan, returning a slice of newly-created
49+
// files if any. If the entirety of m is deleted by exciseSpan, no new sstables
50+
// are added and m is deleted. Note that ve is updated in-place.
5151
//
5252
// This method is agnostic to whether d.mu is held or not. Some cases call it with
5353
// the db mutex held (eg. ingest-time excises), while in the case of compactions
5454
// the mutex is not held.
55-
func (d *DB) excise(
55+
func (d *DB) exciseTable(
5656
ctx context.Context, exciseSpan base.UserKeyBounds, m *tableMetadata, ve *versionEdit, level int,
5757
) ([]manifest.NewTableEntry, error) {
5858
numCreatedFiles := 0

ingest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ func (d *DB) ingestSplit(
18671867
// as we're guaranteed to not have any data overlap between splitFile and
18681868
// s.ingestFile. d.excise will return an error if we pass an inclusive user
18691869
// key bound _and_ we end up seeing data overlap at the end key.
1870-
added, err := d.excise(ctx, base.UserKeyBoundsFromInternal(s.ingestFile.Smallest, s.ingestFile.Largest), splitFile, ve, s.level)
1870+
added, err := d.exciseTable(ctx, base.UserKeyBoundsFromInternal(s.ingestFile.Smallest, s.ingestFile.Largest), splitFile, ve, s.level)
18711871
if err != nil {
18721872
return err
18731873
}
@@ -2104,7 +2104,7 @@ func (d *DB) ingestApply(
21042104
// out.
21052105
for layer, ls := range current.AllLevelsAndSublevels() {
21062106
for m := range ls.Overlaps(d.cmp, exciseSpan.UserKeyBounds()).All() {
2107-
newFiles, err := d.excise(ctx, exciseSpan.UserKeyBounds(), m, ve, layer.Level())
2107+
newFiles, err := d.exciseTable(ctx, exciseSpan.UserKeyBounds(), m, ve, layer.Level())
21082108
if err != nil {
21092109
return nil, err
21102110
}

ingest_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ func TestExcise(t *testing.T) {
895895
for l, ls := range current.AllLevelsAndSublevels() {
896896
iter := ls.Iter()
897897
for m := iter.SeekGE(d.cmp, exciseSpan.Start); m != nil && d.cmp(m.Smallest.UserKey, exciseSpan.End) < 0; m = iter.Next() {
898-
_, err := d.excise(context.Background(), exciseSpan.UserKeyBounds(), m, ve, l.Level())
898+
_, err := d.exciseTable(context.Background(), exciseSpan.UserKeyBounds(), m, ve, l.Level())
899899
if err != nil {
900900
td.Fatalf(t, "error when excising %s: %s", m.FileNum, err.Error())
901901
}
@@ -1245,7 +1245,7 @@ func testIngestSharedImpl(
12451245
for level := range current.Levels {
12461246
iter := current.Levels[level].Iter()
12471247
for m := iter.SeekGE(d.cmp, exciseSpan.Start); m != nil && d.cmp(m.Smallest.UserKey, exciseSpan.End) < 0; m = iter.Next() {
1248-
_, err := d.excise(context.Background(), exciseSpan.UserKeyBounds(), m, ve, level)
1248+
_, err := d.exciseTable(context.Background(), exciseSpan.UserKeyBounds(), m, ve, level)
12491249
if err != nil {
12501250
d.mu.Lock()
12511251
d.mu.versions.logUnlock()
@@ -1749,7 +1749,7 @@ func TestConcurrentExcise(t *testing.T) {
17491749
for level := range current.Levels {
17501750
iter := current.Levels[level].Iter()
17511751
for m := iter.SeekGE(d.cmp, exciseSpan.Start); m != nil && d.cmp(m.Smallest.UserKey, exciseSpan.End) < 0; m = iter.Next() {
1752-
_, err := d.excise(context.Background(), exciseSpan.UserKeyBounds(), m, ve, level)
1752+
_, err := d.exciseTable(context.Background(), exciseSpan.UserKeyBounds(), m, ve, level)
17531753
if err != nil {
17541754
d.mu.Lock()
17551755
d.mu.versions.logUnlock()

0 commit comments

Comments
 (0)