2022-07-08 07:09:48 +00:00
|
|
|
package common
|
|
|
|
|
2023-03-13 11:37:35 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/compression"
|
|
|
|
)
|
2022-07-11 12:34:17 +00:00
|
|
|
|
2022-07-08 07:09:48 +00:00
|
|
|
// Storage represents key-value object storage.
|
|
|
|
// It is used as a building block for a blobstor of a shard.
|
|
|
|
type Storage interface {
|
2022-07-08 11:33:49 +00:00
|
|
|
Open(readOnly bool) error
|
|
|
|
Init() error
|
|
|
|
Close() error
|
|
|
|
|
|
|
|
Type() string
|
2022-10-05 12:11:12 +00:00
|
|
|
Path() string
|
2023-08-09 12:54:08 +00:00
|
|
|
|
2022-08-19 14:29:53 +00:00
|
|
|
SetCompressor(cc *compression.Config)
|
2023-08-09 12:54:08 +00:00
|
|
|
Compressor() *compression.Config
|
|
|
|
|
2022-11-09 10:59:24 +00:00
|
|
|
// SetReportErrorFunc allows to provide a function to be called on disk errors.
|
|
|
|
// This function MUST be called before Open.
|
|
|
|
SetReportErrorFunc(f func(string, error))
|
2023-06-07 11:39:03 +00:00
|
|
|
SetParentID(parentID string)
|
2022-07-08 11:33:49 +00:00
|
|
|
|
2023-03-13 11:37:35 +00:00
|
|
|
Get(context.Context, GetPrm) (GetRes, error)
|
|
|
|
GetRange(context.Context, GetRangePrm) (GetRangeRes, error)
|
|
|
|
Exists(context.Context, ExistsPrm) (ExistsRes, error)
|
2023-04-12 14:01:29 +00:00
|
|
|
Put(context.Context, PutPrm) (PutRes, error)
|
|
|
|
Delete(context.Context, DeletePrm) (DeleteRes, error)
|
2023-05-24 11:09:11 +00:00
|
|
|
Iterate(context.Context, IteratePrm) (IterateRes, error)
|
2022-07-08 07:09:48 +00:00
|
|
|
}
|