tracker

package
v0.0.0-...-b177cec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoWriter = errors.New("no writer")
)

Functions

This section is empty.

Types

type CompactionState

type CompactionState struct {
	// contains filtered or unexported fields
}

func (*CompactionState) Done

func (c *CompactionState) Done()

func (*CompactionState) ListReaders

func (c *CompactionState) ListReaders() []t.BlockHoleReader

func (*CompactionState) LiveBlocks

func (c *CompactionState) LiveBlocks() map[t.BlockHoleReader]int64

func (*CompactionState) LiveBytesReader

func (c *CompactionState) LiveBytesReader(rs []t.BlockHoleReader) *blockmap.Reader

func (*CompactionState) PushCompactedReader

func (c *CompactionState) PushCompactedReader(r t.BlockHoleReader)

func (*CompactionState) Reader

func (c *CompactionState) Reader() t.BlockHoleReader

func (*CompactionState) RemoveUnusedReader

func (c *CompactionState) RemoveUnusedReader(r t.BlockHoleReader)

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(blockSize int, numBlocks int64) *Reader

func (*Reader) PushReader

func (m *Reader) PushReader(r t.BlockHoleReader)

func (*Reader) PushWriter

func (m *Reader) PushWriter(w t.BlockHoleReader)

TODO: Rename lots of things. "writers" should really be "mutable reader", and "reader" is really "immutable reader". The distiction is whether the reader contents can change (i.e. a write log), which determines whether we can add it to the block map.

func (*Reader) ReadBlocks

func (m *Reader) ReadBlocks(p []byte, off int64) (int, error)

func (*Reader) RemoveWriter

func (m *Reader) RemoveWriter(w t.BlockHoleReader)

func (*Reader) StartCompaction

func (m *Reader) StartCompaction() *CompactionState

type TrackedWriter

type TrackedWriter interface {
	WriteBlocks(buf []byte, index int64) (blocksWritten int, err error)
	io.Closer
	Flush() error
	CloseWriter() error

	Name() string
	Written() int64
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(blockSize int) *Writer

func (*Writer) Close

func (m *Writer) Close() ([]string, error)

func (*Writer) Flush

func (m *Writer) Flush() error

func (*Writer) LogWritten

func (m *Writer) LogWritten() int64

func (*Writer) Pending

func (m *Writer) Pending() []TrackedWriter

func (*Writer) PushNewLog

func (m *Writer) PushNewLog(wl TrackedWriter) TrackedWriter

func (*Writer) PushPending

func (m *Writer) PushPending(wl TrackedWriter)

func (*Writer) RemovePending

func (m *Writer) RemovePending(p []TrackedWriter)

func (*Writer) WriteBlocks

func (m *Writer) WriteBlocks(buf []byte, index int64) (blocksRead int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL