Documentation ¶
Index ¶
- Variables
- func IterateBinaryObjects(blz *BlobStor, f func(addr oid.Address, data []byte, descriptor []byte) error) error
- type BlobStor
- func (b *BlobStor) Close() error
- func (b *BlobStor) Delete(prm common.DeletePrm) (common.DeleteRes, error)
- func (b *BlobStor) DumpInfo() Info
- func (b *BlobStor) Exists(ctx context.Context, prm common.ExistsPrm) (common.ExistsRes, error)
- func (b *BlobStor) Get(ctx context.Context, prm common.GetPrm) (common.GetRes, error)
- func (b *BlobStor) GetRange(ctx context.Context, prm common.GetRangePrm) (common.GetRangeRes, error)
- func (b *BlobStor) Init() error
- func (b *BlobStor) Iterate(prm common.IteratePrm) (common.IterateRes, error)
- func (b *BlobStor) NeedsCompression(obj *objectSDK.Object) bool
- func (b *BlobStor) Open(readOnly bool) error
- func (b *BlobStor) Put(prm common.PutPrm) (common.PutRes, error)
- func (b *BlobStor) SetLogger(l *logger.Logger)
- func (b *BlobStor) SetMode(m mode.Mode) error
- func (b *BlobStor) SetReportErrorFunc(f func(string, error))
- type Info
- type Option
- type SubStorage
- type SubStorageInfo
Constants ¶
This section is empty.
Variables ¶
var ErrInitBlobovniczas = errors.New("failure on blobovnicza initialization stage")
ErrInitBlobovniczas is returned when blobovnicza initialization fails.
var ErrNoPlaceFound = logicerr.New("couldn't find a place to store an object")
ErrNoPlaceFound is returned when object can't be saved to any sub-storage component because of the policy.
Functions ¶
func IterateBinaryObjects ¶
func IterateBinaryObjects(blz *BlobStor, f func(addr oid.Address, data []byte, descriptor []byte) error) error
IterateBinaryObjects is a helper function which iterates over BlobStor and passes binary objects to f. Errors related to object reading and unmarshaling are logged and skipped.
Types ¶
type BlobStor ¶
type BlobStor struct {
// contains filtered or unexported fields
}
BlobStor represents FrostFS local BLOB storage.
func (*BlobStor) Exists ¶
Exists checks if the object is presented in BLOB storage.
Returns any error encountered that did not allow to completely check object existence.
func (*BlobStor) Get ¶
Get reads the object from b. If the descriptor is present, only one sub-storage is tried, Otherwise, each sub-storage is tried in order.
func (*BlobStor) GetRange ¶
func (b *BlobStor) GetRange(ctx context.Context, prm common.GetRangePrm) (common.GetRangeRes, error)
GetRange reads object payload data from b. If the descriptor is present, only one sub-storage is tried, Otherwise, each sub-storage is tried in order.
func (*BlobStor) Init ¶
Init initializes internal data structures and system resources.
If BlobStor is already initialized, no action is taken.
Returns wrapped ErrInitBlobovniczas on blobovnicza tree's initializaiton failure.
func (*BlobStor) Iterate ¶
func (b *BlobStor) Iterate(prm common.IteratePrm) (common.IterateRes, error)
Iterate traverses the storage over the stored objects and calls the handler on each element.
Returns any error encountered that did not allow to completely iterate over the storage.
If handler returns an error, method wraps and returns it immediately.
func (*BlobStor) NeedsCompression ¶
NeedsCompression returns true if the object should be compressed. For an object to be compressed 2 conditions must hold: 1. Compression is enabled in settings. 2. Object MIME Content-Type is allowed for compression.
func (*BlobStor) Put ¶
Put saves the object in BLOB storage.
If object is "big", BlobStor saves the object in shallow dir. Otherwise, BlobStor saves the object in blobonicza. In this case the identifier of blobovnicza is returned.
Returns any error encountered that did not allow to completely save the object.
func (*BlobStor) SetLogger ¶
SetLogger sets logger. It is used after the shard ID was generated to use it in logs.
func (*BlobStor) SetReportErrorFunc ¶
SetReportErrorFunc allows to provide a function to be called on disk errors. This function MUST be called before Open.
type Info ¶
type Info struct {
SubStorages []SubStorageInfo
}
Info contains information about blobstor.
type Option ¶
type Option func(*cfg)
Option represents BlobStor's constructor option.
func WithCompressObjects ¶
WithCompressObjects returns option to toggle compression of the stored objects.
If true, Zstandard algorithm is used for data compression.
If compressor (decompressor) creation failed, the uncompressed option will be used, and the error is recorded in the provided log.
func WithLogger ¶
WithLogger returns option to specify BlobStor's logger.
func WithUncompressableContentTypes ¶
WithUncompressableContentTypes returns option to disable decompression for specific content types as seen by object.AttributeContentType attribute.
type SubStorage ¶
SubStorage represents single storage component with some storage policy.
type SubStorageInfo ¶
SubStorageInfo contains information about blobstor storage component.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package memstore implements a memory-backed common.Storage for testing purposes.
|
Package memstore implements a memory-backed common.Storage for testing purposes. |
Package teststore provides a common.Storage implementation for testing/mocking purposes.
|
Package teststore provides a common.Storage implementation for testing/mocking purposes. |