Documentation ¶
Index ¶
- Constants
- type Blobovniczas
- func (b *Blobovniczas) Close() error
- func (b *Blobovniczas) Delete(prm common.DeletePrm) (res common.DeleteRes, err error)
- func (b *Blobovniczas) Exists(prm common.ExistsPrm) (common.ExistsRes, error)
- func (b *Blobovniczas) Get(prm common.GetPrm) (res common.GetRes, err error)
- func (b *Blobovniczas) GetRange(prm common.GetRangePrm) (res common.GetRangeRes, err error)
- func (b *Blobovniczas) Init() error
- func (b *Blobovniczas) Iterate(prm common.IteratePrm) (common.IterateRes, error)
- func (b *Blobovniczas) Open(readOnly bool) error
- func (b *Blobovniczas) Path() string
- func (b *Blobovniczas) Put(prm common.PutPrm) (common.PutRes, error)
- func (b *Blobovniczas) SetCompressor(cc *compression.Config)
- func (b *Blobovniczas) SetReportErrorFunc(f func(string, error))
- func (b *Blobovniczas) Type() string
- type Option
- func WithBlobovniczaShallowDepth(depth uint64) Option
- func WithBlobovniczaShallowWidth(width uint64) Option
- func WithBlobovniczaSize(sz uint64) Option
- func WithLogger(l *zap.Logger) Option
- func WithObjectSizeLimit(sz uint64) Option
- func WithOpenedCacheSize(sz int) Option
- func WithPermissions(perm fs.FileMode) Option
- func WithRootPath(p string) Option
Constants ¶
const Type = "blobovnicza"
Type is blobovniczatree storage type used in logs and configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blobovniczas ¶
type Blobovniczas struct {
// contains filtered or unexported fields
}
Blobovniczas represents the storage of the "small" objects.
Each object is stored in Blobovnicza's (B-s). B-s are structured in a multilevel directory hierarchy with fixed depth and width (configured by BlobStor).
Example (width = 4, depth = 3):
x===============================x |[0] [1] [2] [3]| | \ / | | \ / | | \ / | | \ / | |[0] [1] [2] [3]| | | / | | | / | | | / | | | / | |[0](F) [1](A) [X] [X]| x===============================x
Elements of the deepest level are B-s. B-s are allocated dynamically. At each moment of the time there is an active B (ex. A), set of already filled B-s (ex. F) and a list of not yet initialized B-s (ex. X). After filling the active B it becomes full, and next B becomes initialized and active.
Active B and some of the full B-s are cached (LRU). All cached B-s are intitialized and opened.
Object is saved as follows:
- at each level, according to HRW, the next one is selected and dives into it until we reach the deepest;
- at the B-s level object is saved to the active B. If active B is full, next B is opened, initialized and cached. If there is no more X candidates, goto 1 and process next level.
After the object is saved in B, path concatenation is returned in system path format as B identifier (ex. "0/1/1" or "3/2/1").
func NewBlobovniczaTree ¶
func NewBlobovniczaTree(opts ...Option) (blz *Blobovniczas)
NewBlobovniczaTree returns new instance of blobovnizas tree.
func (*Blobovniczas) Delete ¶
Delete deletes object from blobovnicza tree.
If blobocvnicza ID is specified, only this blobovnicza is processed. Otherwise, all Blobovniczas are processed descending weight.
func (*Blobovniczas) Get ¶
Get reads object from blobovnicza tree.
If blobocvnicza ID is specified, only this blobovnicza is processed. Otherwise, all Blobovniczas are processed descending weight.
func (*Blobovniczas) GetRange ¶
func (b *Blobovniczas) GetRange(prm common.GetRangePrm) (res common.GetRangeRes, err error)
GetRange reads range of object payload data from blobovnicza tree.
If blobocvnicza ID is specified, only this blobovnicza is processed. Otherwise, all Blobovniczas are processed descending weight.
func (*Blobovniczas) Init ¶
func (b *Blobovniczas) Init() error
Init initializes blobovnicza tree.
Should be called exactly once.
func (*Blobovniczas) Iterate ¶
func (b *Blobovniczas) Iterate(prm common.IteratePrm) (common.IterateRes, error)
Iterate iterates over all objects in b.
func (*Blobovniczas) Open ¶
func (b *Blobovniczas) Open(readOnly bool) error
Open opens blobovnicza tree.
func (*Blobovniczas) Path ¶ added in v0.33.0
func (b *Blobovniczas) Path() string
Path implements common.Storage.
func (*Blobovniczas) Put ¶
Put saves object in the maximum weight blobobnicza.
returns error if could not save object in any blobovnicza.
func (*Blobovniczas) SetCompressor ¶
func (b *Blobovniczas) SetCompressor(cc *compression.Config)
SetCompressor implements common.Storage.
func (*Blobovniczas) SetReportErrorFunc ¶ added in v0.36.0
func (b *Blobovniczas) SetReportErrorFunc(f func(string, error))
SetReportErrorFunc implements common.Storage.
type Option ¶
type Option func(*cfg)