sstable

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataFirstKey         = "min_key"
	MetadataLastKey          = "max_key"
	MetadataNumRecordsKey    = "count"
	MetadataEstimatedSizeKey = "estimated_size_bytes"
)

Variables

View Source
var (
	// ErrKeyNotFound is the error returned when a path is not found
	ErrKeyNotFound = fmt.Errorf("key: %w", committed.ErrNotFound)
)

Functions

func NewStaticCollector

func NewStaticCollector(m map[string]string) func() sstable.TablePropertyCollector

NewStaticCollector returns an SSTable collector that will add the properties in m when writing ends.

Types

type DiskWriter

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

func NewDiskWriter

func NewDiskWriter(ctx context.Context, tierFS pyramid.FS, ns committed.Namespace, hash hash.Hash, metadata graveler.Metadata) (*DiskWriter, error)

func (*DiskWriter) Abort

func (dw *DiskWriter) Abort() error

func (*DiskWriter) Close

func (dw *DiskWriter) Close() (*committed.WriteResult, error)

func (*DiskWriter) GetApproximateSize

func (dw *DiskWriter) GetApproximateSize() uint64

func (*DiskWriter) GetFS

func (dw *DiskWriter) GetFS() pyramid.FS

func (*DiskWriter) GetStoredFile

func (dw *DiskWriter) GetStoredFile() pyramid.StoredFile

func (*DiskWriter) SetMetadata

func (dw *DiskWriter) SetMetadata(key, value string)

SetMetadata associates metadata value (which will be stringified) with key. Keys and values are also calculated as part of the resulting range ID

func (*DiskWriter) ShouldBreakAtKey added in v0.63.0

func (dw *DiskWriter) ShouldBreakAtKey(key graveler.Key, params *committed.Params) bool

ShouldBreakAtKey returns true if it should break range after the given key

func (*DiskWriter) WriteRecord

func (dw *DiskWriter) WriteRecord(record committed.Record) error

type Iterator

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

Iterator returns ordered iteration of the SSTable entries

func NewIterator

func NewIterator(it sstable.Iterator, derefer func() error) *Iterator

func (*Iterator) Close

func (iter *Iterator) Close()

func (*Iterator) Err

func (iter *Iterator) Err() error

func (*Iterator) Next

func (iter *Iterator) Next() bool

func (*Iterator) SeekGE

func (iter *Iterator) SeekGE(lookup committed.Key)

func (*Iterator) Value

func (iter *Iterator) Value() *committed.Record

type NewSSTableReaderFn

type NewSSTableReaderFn func(ctx context.Context, ns committed.Namespace, id committed.ID) (*sstable.Reader, error)

type RangeManager

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

func NewPebbleSSTableRangeManager

func NewPebbleSSTableRangeManager(cache *pebble.Cache, fs pyramid.FS, hash crypto.Hash) *RangeManager

func NewPebbleSSTableRangeManagerWithNewReader

func NewPebbleSSTableRangeManagerWithNewReader(newReader NewSSTableReaderFn, cache Unrefer, fs pyramid.FS, hash crypto.Hash) *RangeManager

func (*RangeManager) Close

func (m *RangeManager) Close() error

func (*RangeManager) Exists

func (m *RangeManager) Exists(ctx context.Context, ns committed.Namespace, id committed.ID) (bool, error)

func (*RangeManager) GetURI

func (*RangeManager) GetValue

GetValue returns the Record matching the key in the SSTable referenced by the id. If key is not found, (nil, ErrKeyNotFound) is returned.

func (*RangeManager) GetValueGE

func (m *RangeManager) GetValueGE(ctx context.Context, ns committed.Namespace, id committed.ID, lookup committed.Key) (*committed.Record, error)

func (*RangeManager) GetWriter

GetWriter returns a new SSTable writer instance

func (*RangeManager) NewRangeIterator

func (m *RangeManager) NewRangeIterator(ctx context.Context, ns committed.Namespace, tid committed.ID) (committed.ValueIterator, error)

NewRangeIterator takes a given SSTable and returns an EntryIterator seeked to >= "from" path

type Unrefer

type Unrefer interface {
	Unref()
}

Jump to

Keyboard shortcuts

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