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 Aug 15, 2024
1 parent b6630de commit f318ad8
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 f318ad8

Please sign in to comment.