Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jbowens committed Feb 15, 2024
1 parent 7eb7c1e commit c46bc99
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions flushable.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,28 @@ func (b *bufferedSSTables) init(targetFileSize int) {
b.curr.Grow(targetFileSize)
}

// copyToProvider copies all the finished buffered sstables to the provided
// destination object storage Provider.
func (b *bufferedSSTables) copyToProvider(ctx context.Context, dst objstorage.Provider) error {

Check failure on line 576 in flushable.go

View workflow job for this annotation

GitHub Actions / go-linux

func (*bufferedSSTables).copyToProvider is unused (U1000)

Check failure on line 576 in flushable.go

View workflow job for this annotation

GitHub Actions / go-macos

func (*bufferedSSTables).copyToProvider is unused (U1000)

Check failure on line 576 in flushable.go

View workflow job for this annotation

GitHub Actions / go-linux-32bit

func (*bufferedSSTables).copyToProvider is unused (U1000)

Check failure on line 576 in flushable.go

View workflow job for this annotation

GitHub Actions / go-linux-no-cgo

func (*bufferedSSTables).copyToProvider is unused (U1000)

Check failure on line 576 in flushable.go

View workflow job for this annotation

GitHub Actions / go-linux-no-invariants

func (*bufferedSSTables).copyToProvider is unused (U1000)
for i := range b.finished {
err := func() error {
w, _, err := dst.Create(ctx, base.FileTypeTable, b.finished[i].fileNum, objstorage.CreateOptions{})
if err != nil {
return err
}
if err = w.Write(b.finished[i].buf); err != nil {
w.Abort()
return err
}
return w.Finish()
}()
if err != nil {
return errors.Wrapf(err, "copying file %s", b.finished[i].fileNum)
}
}
return dst.Sync()
}

// Assert that *bufferedSSTables implements the objectCreator interface.
var _ objectCreator = (*bufferedSSTables)(nil)

Expand Down

0 comments on commit c46bc99

Please sign in to comment.