rbstor

package
v0.0.0-...-7b67058 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0, MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLocalGroupCount = 64 // todo user config

Variables

View Source
var ErrOffloaded = fmt.Errorf("group is offloaded")

Functions

func Open

func Open(root string, opts ...OpenOption) (iface.RBS, error)

todo root as option, separate data / data index / index (/ staging?) paths

Types

type Group

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

func OpenGroup

func OpenGroup(ctx context.Context, db *rbsDB, index iface.Index, staging *atomic.Pointer[iface.StagingStorageProvider],
	id, committedBlocks, committedSize, recordedHead int64,
	path string, state iface.GroupState, create bool) (*Group, error)

func (*Group) Close

func (m *Group) Close() error

func (*Group) FinDataReload

func (m *Group) FinDataReload(ctx context.Context) error

func (*Group) Finalize

func (m *Group) Finalize(ctx context.Context) error

func (*Group) GenCommP

func (m *Group) GenCommP() error

func (*Group) LoadFilCar

func (m *Group) LoadFilCar(ctx context.Context, f io.Reader, sz int64) error

func (*Group) Put

func (m *Group) Put(ctx context.Context, b []blocks.Block) (int, error)

func (*Group) Sync

func (m *Group) Sync(ctx context.Context) error
func (m *Group) Unlink(ctx context.Context, c []mh.Multihash) error

func (*Group) View

func (m *Group) View(ctx context.Context, c []mh.Multihash, cb func(cidx int, found bool, data []byte)) error

func (*Group) WrapStorageProvider

func (m *Group) WrapStorageProvider() carlog.CarStorageProvider

type MeteredIndex

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

func NewMeteredIndex

func NewMeteredIndex(sub iface.Index) *MeteredIndex

func (*MeteredIndex) AddGroup

func (m *MeteredIndex) AddGroup(ctx context.Context, mh []multihash.Multihash, sizes []int32, group iface.GroupKey) error

func (*MeteredIndex) Close

func (m *MeteredIndex) Close() error

func (*MeteredIndex) DropGroup

func (m *MeteredIndex) DropGroup(ctx context.Context, mh []multihash.Multihash, group iface.GroupKey) error

func (*MeteredIndex) EstimateSize

func (m *MeteredIndex) EstimateSize(ctx context.Context) (int64, error)

func (*MeteredIndex) GetGroups

func (m *MeteredIndex) GetGroups(ctx context.Context, mh []multihash.Multihash, cb func(cidx int, gk iface.GroupKey) (more bool, err error)) error

func (*MeteredIndex) GetSizes

func (m *MeteredIndex) GetSizes(ctx context.Context, mh []multihash.Multihash, cb func([]int32) error) error

func (*MeteredIndex) Sync

func (m *MeteredIndex) Sync(ctx context.Context) error

type OpenOption

type OpenOption func(*openOptions)

func WithDB

func WithDB(db *ributil.RetryDB) OpenOption

type PebbleIndex

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

PebbleIndex is the top-level index, thread-safe.

func NewPebbleIndex

func NewPebbleIndex(path string) (*PebbleIndex, error)

NewPebbleIndex creates a new Pebble-backed Index.

func (*PebbleIndex) AddGroup

func (i *PebbleIndex) AddGroup(ctx context.Context, mh []multihash.Multihash, sizes []int32, group iface.GroupKey) error

func (*PebbleIndex) Close

func (i *PebbleIndex) Close() error

func (*PebbleIndex) DropGroup

func (i *PebbleIndex) DropGroup(ctx context.Context, mh []multihash.Multihash, group iface.GroupKey) error

func (*PebbleIndex) EstimateSize

func (i *PebbleIndex) EstimateSize(ctx context.Context) (int64, error)

func (*PebbleIndex) GetGroups

func (i *PebbleIndex) GetGroups(ctx context.Context, mh []multihash.Multihash, cb func(cidx int, gk iface.GroupKey) (more bool, err error)) error

func (*PebbleIndex) GetSizes

func (i *PebbleIndex) GetSizes(ctx context.Context, mh []multihash.Multihash, cb func([]int32) error) error

func (*PebbleIndex) Sync

func (i *PebbleIndex) Sync(ctx context.Context) error

Jump to

Keyboard shortcuts

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