Skip to content

Commit

Permalink
internal/keyspan: export Truncate in keyspan.Fragmenter.
Browse files Browse the repository at this point in the history
This change exports the truncateAndFlush method in keyspan.Fragmenter.

Necessary to unblock cockroachdb/cockroach#67284 .
  • Loading branch information
itsbilal committed Nov 7, 2024
1 parent 7e594e2 commit 96bee8f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/keyspan/fragmenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,14 @@ func (f *Fragmenter) Start() []byte {
return nil
}

// Truncate truncates all pending spans up to key (exclusive), flushes them, and
// retains any spans that continue onward for future flushes.
func (f *Fragmenter) Truncate(key []byte) {
if len(f.pending) > 0 {
f.truncateAndFlush(key)
}
}

// Flushes all pending spans up to key (exclusive).
//
// WARNING: The specified key is stored without making a copy, so all callers
Expand Down

0 comments on commit 96bee8f

Please sign in to comment.