meta

package
v0.14.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: GPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownObjectType          = errors.New("unknown object type")
	ErrIncorrectBlobovniczaUpdate = errors.New("updating blobovnicza id on object without it")
	ErrIncorrectSplitInfoUpdate   = errors.New("updating split info on object without it")
	ErrIncorrectRootObject        = errors.New("invalid root object")
)
View Source
var ErrLackSplitInfo = errors.New("no split info on parent object")
View Source
var ErrMissingContainerID = errors.New("missing container id field")

Functions

func Delete added in v0.13.0

func Delete(db *DB, addrs ...*objectSDK.Address) error

Delete removes objects from DB.

func DoNotMove added in v0.13.0

func DoNotMove(db *DB, addr *objectSDK.Address) error

DoNotMove prevents the object to be moved into another shard.

func Exists added in v0.13.0

func Exists(db *DB, addr *objectSDK.Address) (bool, error)

Exists checks if object is presented in DB.

func Get added in v0.13.0

func Get(db *DB, addr *objectSDK.Address) (*object.Object, error)

Get reads the object from DB.

func GetRaw added in v0.13.0

func GetRaw(db *DB, addr *objectSDK.Address, raw bool) (*object.Object, error)

GetRaw reads physically stored object from DB.

func Inhume added in v0.13.0

func Inhume(db *DB, target, tomb *objectSDK.Address) error

Inhume inhumes the object by specified address.

func IsSmall added in v0.13.0

func IsSmall(db *DB, addr *objectSDK.Address) (*blobovnicza.ID, error)

IsSmall wraps work with DB.IsSmall method with specified address and other parameters by default. Returns only the blobovnicza identifier.

func Movable added in v0.13.0

func Movable(db *DB) ([]*objectSDK.Address, error)

Movable returns all movable objects of DB.

func Put added in v0.13.0

func Put(db *DB, obj *object.Object, id *blobovnicza.ID) error

Put saves the object in DB.

func Select added in v0.13.0

func Select(db *DB, cid *container.ID, fs object.SearchFilters) ([]*object.Address, error)

Select selects the objects from DB with filtering.

func ToMoveIt added in v0.13.0

func ToMoveIt(db *DB, addr *objectSDK.Address) error

ToMoveIt marks object to move it into another shard.

Types

type CleanUpPrm added in v0.13.0

type CleanUpPrm struct{}

CleanUpPrm groups the parameters of CleanUp operation.

type CleanUpRes added in v0.13.0

type CleanUpRes struct{}

CleanUpRes groups resulting values of CleanUp operation.

type DB

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

DB represents local metabase of storage node.

func New added in v0.13.0

func New(opts ...Option) *DB

New creates and returns new Metabase instance.

func (*DB) CleanUp added in v0.13.0

func (db *DB) CleanUp(prm *CleanUpPrm) (res *CleanUpRes, err error)

CleanUp removes empty buckets from metabase.

func (*DB) Close

func (db *DB) Close() error

Close closes boltDB instance.

func (*DB) Containers added in v0.13.0

func (db *DB) Containers() (list []*container.ID, err error)

func (*DB) Delete

func (db *DB) Delete(prm *DeletePrm) (*DeleteRes, error)

Delete removed object records from metabase indexes.

func (*DB) DoNotMove added in v0.13.0

func (db *DB) DoNotMove(prm *DoNotMovePrm) (res *DoNotMoveRes, err error)

DoNotMove removes `MoveIt` mark from the object.

func (*DB) DumpInfo added in v0.13.0

func (db *DB) DumpInfo() Info

DumpInfo returns information about the DB.

func (*DB) Exists added in v0.13.0

func (db *DB) Exists(prm *ExistsPrm) (res *ExistsRes, err error)

Exists returns ErrAlreadyRemoved if addr was marked as removed. Otherwise it returns true if addr is in primary index or false if it is not.

func (*DB) Get

func (db *DB) Get(prm *GetPrm) (res *GetRes, err error)

Get returns object header for specified address.

func (*DB) Inhume added in v0.13.0

func (db *DB) Inhume(prm *InhumePrm) (res *InhumeRes, err error)

Inhume marks objects as removed but not removes it from metabase.

func (*DB) Init added in v0.13.0

func (db *DB) Init() error

Init initializes metabase, however metabase doesn't need extra preparations, so it implemented to satisfy interface of storage engine components.

func (*DB) IsSmall added in v0.13.0

func (db *DB) IsSmall(prm *IsSmallPrm) (res *IsSmallRes, err error)

IsSmall returns blobovniczaID for small objects and nil for big objects. Small objects stored in blobovnicza instances. Big objects stored in FS by shallow path which is calculated from address and therefore it is not indexed in metabase.

func (*DB) Movable added in v0.13.0

func (db *DB) Movable(prm *MovablePrm) (*MovableRes, error)

Movable returns list of marked objects to move into other shard.

func (*DB) Open added in v0.13.0

func (db *DB) Open() error

Open boltDB instance for metabase.

func (*DB) Put

func (db *DB) Put(prm *PutPrm) (res *PutRes, err error)

Put saves object header in metabase. Object payload expected to be cut. Big objects have nil blobovniczaID.

func (*DB) Select

func (db *DB) Select(prm *SelectPrm) (res *SelectRes, err error)

Select returns list of addresses of objects that match search filters.

func (*DB) ToMoveIt added in v0.13.0

func (db *DB) ToMoveIt(prm *ToMoveItPrm) (res *ToMoveItRes, err error)

ToMoveIt marks objects to move it into another shard. This useful for faster HRW fetching.

type DeletePrm added in v0.13.0

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

DeletePrm groups the parameters of Delete operation.

func (*DeletePrm) WithAddresses added in v0.13.0

func (p *DeletePrm) WithAddresses(addrs ...*objectSDK.Address) *DeletePrm

WithAddresses is a Delete option to set the addresses of the objects to delete.

Option is required.

type DeleteRes added in v0.13.0

type DeleteRes struct{}

DeleteRes groups resulting values of Delete operation.

type DoNotMovePrm added in v0.13.0

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

DoNotMovePrm groups the parameters of DoNotMove operation.

func (*DoNotMovePrm) WithAddress added in v0.13.0

func (p *DoNotMovePrm) WithAddress(addr *objectSDK.Address) *DoNotMovePrm

WithAddress sets address of the object to prevent moving into another shard.

type DoNotMoveRes added in v0.13.0

type DoNotMoveRes struct{}

DoNotMoveRes groups resulting values of DoNotMove operation.

type ExistsPrm added in v0.13.0

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

ExistsPrm groups the parameters of Exists operation.

func (*ExistsPrm) WithAddress added in v0.13.0

func (p *ExistsPrm) WithAddress(addr *objectSDK.Address) *ExistsPrm

WithAddress is an Exists option to set object checked for existence.

type ExistsRes added in v0.13.0

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

ExistsRes groups resulting values of Exists operation.

func (*ExistsRes) Exists added in v0.13.0

func (p *ExistsRes) Exists() bool

Exists returns the fact that the object is in the metabase.

type GetPrm added in v0.13.0

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

GetPrm groups the parameters of Get operation.

func (*GetPrm) WithAddress added in v0.13.0

func (p *GetPrm) WithAddress(addr *objectSDK.Address) *GetPrm

WithAddress is a Get option to set the address of the requested object.

Option is required.

func (*GetPrm) WithRaw added in v0.13.0

func (p *GetPrm) WithRaw(raw bool) *GetPrm

WithRaw is a Get option to set raw flag value. If flag is unset, then Get returns header of virtual object, otherwise it returns SplitInfo of virtual object.

type GetRes added in v0.13.0

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

GetRes groups resulting values of Get operation.

func (*GetRes) Header added in v0.13.0

func (r *GetRes) Header() *object.Object

Header returns the requested object header.

type Info added in v0.13.0

type Info struct {
	// Full path to the metabase.
	Path string

	// Permission of database file.
	Permission os.FileMode
}

Info groups the information about DB.

type InhumePrm added in v0.13.0

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

InhumePrm encapsulates parameters for Inhume operation.

func (*InhumePrm) WithAddress added in v0.13.0

func (p *InhumePrm) WithAddress(addr *objectSDK.Address) *InhumePrm

WithAddress sets object address that should be inhumed.

func (*InhumePrm) WithTombstoneAddress added in v0.13.0

func (p *InhumePrm) WithTombstoneAddress(addr *objectSDK.Address) *InhumePrm

WithTombstoneAddress sets tombstone address as the reason for inhume operation.

type InhumeRes added in v0.13.0

type InhumeRes struct{}

InhumeRes encapsulates results of Inhume operation.

type IsSmallPrm added in v0.13.0

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

IsSmallPrm groups the parameters of IsSmall operation.

func (*IsSmallPrm) WithAddress added in v0.13.0

func (p *IsSmallPrm) WithAddress(addr *objectSDK.Address) *IsSmallPrm

WithAddress is a IsSmall option to set the object address to check.

type IsSmallRes added in v0.13.0

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

IsSmallRes groups resulting values of IsSmall operation.

func (*IsSmallRes) BlobovniczaID added in v0.13.0

func (r *IsSmallRes) BlobovniczaID() *blobovnicza.ID

BlobovniczaID returns blobovnicza identifier.

type MovablePrm added in v0.13.0

type MovablePrm struct{}

MovablePrm groups the parameters of Movable operation.

type MovableRes added in v0.13.0

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

MovableRes groups resulting values of Movable operation.

func (*MovableRes) AddressList added in v0.13.0

func (p *MovableRes) AddressList() []*objectSDK.Address

WithAddress sets address of the object to prevent moving into another shard.

type Option

type Option func(*cfg)

Option is an option of DB constructor.

func WithBoltDBOptions added in v0.13.0

func WithBoltDBOptions(opts *bbolt.Options) Option

WithBoltDBOptions returns option to specify BoltDB options.

func WithLogger

func WithLogger(l *logger.Logger) Option

WithLogger returns option to set logger of DB.

func WithPath added in v0.13.0

func WithPath(path string) Option

WithPath returns option to set system path to Metabase.

func WithPermissions added in v0.13.0

func WithPermissions(perm os.FileMode) Option

WithPermissions returns option to specify permission bits of Metabase system path.

type PutPrm added in v0.13.0

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

PutPrm groups the parameters of Put operation.

func (*PutPrm) WithBlobovniczaID added in v0.13.0

func (p *PutPrm) WithBlobovniczaID(id *blobovnicza.ID) *PutPrm

WithBlobovniczaID is a Put option to set blobovnicza ID to save.

func (*PutPrm) WithObject added in v0.13.0

func (p *PutPrm) WithObject(obj *object.Object) *PutPrm

WithObject is a Put option to set object to save.

type PutRes added in v0.13.0

type PutRes struct{}

PutRes groups resulting values of Put operation.

type SelectPrm added in v0.13.0

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

SelectPrm groups the parameters of Select operation.

func (*SelectPrm) WithContainerID added in v0.13.0

func (p *SelectPrm) WithContainerID(cid *container.ID) *SelectPrm

WithContainerID is a Select option to set the container id to search in.

func (*SelectPrm) WithFilters added in v0.13.0

func (p *SelectPrm) WithFilters(fs object.SearchFilters) *SelectPrm

WithFilters is a Select option to set the object filters.

type SelectRes added in v0.13.0

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

SelectRes groups resulting values of Select operation.

func (*SelectRes) AddressList added in v0.13.0

func (r *SelectRes) AddressList() []*object.Address

AddressList returns list of addresses of the selected objects.

type ToMoveItPrm added in v0.13.0

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

ToMoveItPrm groups the parameters of ToMoveIt operation.

func (*ToMoveItPrm) WithAddress added in v0.13.0

func (p *ToMoveItPrm) WithAddress(addr *objectSDK.Address) *ToMoveItPrm

WithAddress sets address of the object to move into another shard.

type ToMoveItRes added in v0.13.0

type ToMoveItRes struct{}

ToMoveItRes groups resulting values of ToMoveIt operation.

Jump to

Keyboard shortcuts

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