Documentation ¶
Index ¶
- Variables
- func IsErrNotFound(err error) bool
- func IsErrObjectExpired(err error) bool
- func IsErrOutOfRange(err error) bool
- func IsErrRemoved(err error) bool
- type ContainerSizePrm
- type ContainerSizeRes
- type Cursor
- type DeletePrm
- type DeleteRes
- type DeletedLockCallback
- type DumpPrm
- type DumpRes
- type Event
- type ExistsPrm
- type ExistsRes
- type ExpiredObjectsCallback
- type ExpiredTombstonesCallback
- type FlushWriteCachePrm
- type GetPrm
- type GetRes
- type HeadPrm
- type HeadRes
- type ID
- type Info
- type InhumePrm
- type InhumeRes
- type ListContainersPrm
- type ListContainersRes
- type ListWithCursorPrm
- type ListWithCursorRes
- type MetricsWriter
- type ObjectStatus
- type Option
- func WithBlobStorOptions(opts ...blobstor.Option) Option
- func WithDeletedLockCallback(v DeletedLockCallback) Option
- func WithExpiredLocksCallback(cb ExpiredObjectsCallback) Option
- func WithExpiredTombstonesCallback(cb ExpiredTombstonesCallback) Option
- func WithGCRemoverSleepInterval(dur time.Duration) Option
- func WithGCWorkerPoolInitializer(wpInit func(int) util.WorkerPool) Option
- func WithID(id *ID) Option
- func WithLogger(l *zap.Logger) Option
- func WithMetaBaseOptions(opts ...meta.Option) Option
- func WithMetricsWriter(v MetricsWriter) Option
- func WithMode(v mode.Mode) Option
- func WithPiloramaOptions(opts ...pilorama.Option) Option
- func WithRefillMetabase(v bool) Option
- func WithRemoverBatchSize(sz int) Option
- func WithReportErrorFunc(f func(selfID string, message string, err error)) Option
- func WithTombstoneSource(v TombstoneSource) Option
- func WithWriteCache(use bool) Option
- func WithWriteCacheOptions(opts ...writecache.Option) Option
- type PutPrm
- type PutRes
- type RestorePrm
- type RestoreRes
- type RngPrm
- type RngRes
- type SelectPrm
- type SelectRes
- type Shard
- func (s *Shard) Close() error
- func (s *Shard) ContainerSize(prm ContainerSizePrm) (ContainerSizeRes, error)
- func (s *Shard) Delete(prm DeletePrm) (DeleteRes, error)
- func (s *Shard) DeleteContainer(_ context.Context, cID cid.ID) error
- func (s *Shard) Dump(prm DumpPrm) (DumpRes, error)
- func (s *Shard) DumpInfo() Info
- func (s *Shard) Exists(prm ExistsPrm) (ExistsRes, error)
- func (s *Shard) FlushWriteCache(p FlushWriteCachePrm) error
- func (s *Shard) Get(prm GetPrm) (GetRes, error)
- func (s *Shard) GetBytes(addr oid.Address) ([]byte, error)
- func (s *Shard) GetBytesWithMetadataLookup(addr oid.Address) ([]byte, bool, error)
- func (s *Shard) GetMode() mode.Mode
- func (s *Shard) GetRange(prm RngPrm) (RngRes, error)
- func (s *Shard) HandleDeletedLocks(lockers []oid.Address)
- func (s *Shard) HandleExpiredLocks(lockers []oid.Address)
- func (s *Shard) HandleExpiredTombstones(tss []meta.TombstonedObject)
- func (s *Shard) Head(prm HeadPrm) (HeadRes, error)
- func (s *Shard) ID() *ID
- func (s *Shard) Inhume(prm InhumePrm) (InhumeRes, error)
- func (s *Shard) InhumeContainer(cID cid.ID) error
- func (s *Shard) Init() error
- func (s *Shard) IsLocked(addr oid.Address) (bool, error)
- func (s *Shard) List() (res SelectRes, err error)
- func (s *Shard) ListContainers(_ ListContainersPrm) (ListContainersRes, error)
- func (s *Shard) ListWithCursor(prm ListWithCursorPrm) (ListWithCursorRes, error)
- func (s *Shard) Lock(idCnr cid.ID, locker oid.ID, locked []oid.ID) error
- func (s *Shard) NotificationChannel() chan<- Event
- func (s *Shard) ObjectStatus(address oid.Address) (ObjectStatus, error)
- func (s *Shard) Open() error
- func (s *Shard) Put(prm PutPrm) (PutRes, error)
- func (s *Shard) Reload(opts ...Option) error
- func (s *Shard) Restore(prm RestorePrm) (RestoreRes, error)
- func (s *Shard) Select(prm SelectPrm) (SelectRes, error)
- func (s *Shard) SetMode(m mode.Mode) error
- func (s *Shard) ToMoveIt(prm ToMoveItPrm) (ToMoveItRes, error)
- func (s *Shard) TreeAddByPath(d pilorama.CIDDescriptor, treeID string, attr string, path []string, ...) ([]pilorama.LogMove, error)
- func (s *Shard) TreeApply(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move, backgroundSync bool) error
- func (s *Shard) TreeDrop(cid cidSDK.ID, treeID string) error
- func (s *Shard) TreeExists(cid cidSDK.ID, treeID string) (bool, error)
- func (s *Shard) TreeGetByPath(cid cidSDK.ID, treeID string, attr string, path []string, latest bool) ([]pilorama.Node, error)
- func (s *Shard) TreeGetChildren(cid cidSDK.ID, treeID string, nodeID pilorama.Node) ([]uint64, error)
- func (s *Shard) TreeGetMeta(cid cidSDK.ID, treeID string, nodeID pilorama.Node) (pilorama.Meta, uint64, error)
- func (s *Shard) TreeGetOpLog(cid cidSDK.ID, treeID string, height uint64) (pilorama.Move, error)
- func (s *Shard) TreeList(cid cidSDK.ID) ([]string, error)
- func (s *Shard) TreeMove(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move) (*pilorama.LogMove, error)
- func (s *Shard) UpdateID() (err error)
- type ToMoveItPrm
- type ToMoveItRes
- type TombstoneSource
Constants ¶
This section is empty.
Variables ¶
var ErrDegradedMode = logicerr.New("shard is in degraded mode")
ErrDegradedMode is returned when operation requiring metabase is executed in degraded mode.
var ErrEndOfListing = meta.ErrEndOfListing
ErrEndOfListing is returned from object listing with cursor when storage can't return any more objects after provided cursor. Use nil cursor object to start listing again.
var ErrInvalidMagic = logicerr.New("invalid magic")
ErrInvalidMagic is returned when dump format is invalid.
var ErrLockObjectRemoval = meta.ErrLockObjectRemoval
ErrLockObjectRemoval is returned when inhume operation is being performed on lock object, and it is not a forced object removal.
var ErrMustBeReadOnly = logicerr.New("shard must be in read-only mode")
var ErrPiloramaDisabled = logicerr.New("pilorama is disabled")
ErrPiloramaDisabled is returned when pilorama was disabled in the configuration.
var ErrReadOnlyMode = logicerr.New("shard is in read-only mode")
ErrReadOnlyMode is returned when it is impossible to apply operation that changes shard's memory due to the "read-only" shard's mode.
Functions ¶
func IsErrNotFound ¶
IsErrNotFound checks if error returned by Shard Get/Head/GetRange method corresponds to missing object.
func IsErrObjectExpired ¶
IsErrObjectExpired checks if an error returned by Shard corresponds to expired object.
func IsErrOutOfRange ¶
IsErrOutOfRange checks if an error returned by Shard GetRange method corresponds to exceeding the object bounds.
func IsErrRemoved ¶
IsErrRemoved checks if error returned by Shard Exists/Get/Head/GetRange method corresponds to removed object.
Types ¶
type ContainerSizePrm ¶
type ContainerSizePrm struct {
// contains filtered or unexported fields
}
func (*ContainerSizePrm) SetContainerID ¶
func (p *ContainerSizePrm) SetContainerID(cnr cid.ID)
type ContainerSizeRes ¶
type ContainerSizeRes struct {
// contains filtered or unexported fields
}
func (ContainerSizeRes) Size ¶
func (r ContainerSizeRes) Size() uint64
type DeletePrm ¶
type DeletePrm struct {
// contains filtered or unexported fields
}
DeletePrm groups the parameters of Delete operation.
func (*DeletePrm) SetAddresses ¶
SetAddresses is a Delete option to set the addresses of the objects to delete.
Option is required.
func (*DeletePrm) SkipNotFoundError ¶
func (p *DeletePrm) SkipNotFoundError()
SkipNotFoundError is a Delete option to skip errors when an already deleted object is being deleted.
type DeletedLockCallback ¶
DeletedLockCallback is a callback handling list of deleted LOCK objects.
type DumpPrm ¶
type DumpPrm struct {
// contains filtered or unexported fields
}
DumpPrm groups the parameters of Dump operation.
func (*DumpPrm) WithIgnoreErrors ¶
WithIgnoreErrors is an Dump option to allow ignore all errors during iteration. This includes invalid peapods as well as corrupted objects.
func (*DumpPrm) WithStream ¶
WithStream is an Dump option to set the destination stream. It takes priority over `path` option.
type DumpRes ¶
type DumpRes struct {
// contains filtered or unexported fields
}
DumpRes groups the result fields of Dump operation.
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
Event represents class of external events.
type ExistsPrm ¶
type ExistsPrm struct {
// contains filtered or unexported fields
}
ExistsPrm groups the parameters of Exists operation.
func (*ExistsPrm) SetAddress ¶
SetAddress is an Exists option to set object checked for existence.
type ExistsRes ¶
type ExistsRes struct {
// contains filtered or unexported fields
}
ExistsRes groups the resulting values of Exists operation.
type ExpiredObjectsCallback ¶
ExpiredObjectsCallback is a callback handling list of expired objects.
type ExpiredTombstonesCallback ¶
type ExpiredTombstonesCallback func(context.Context, []meta.TombstonedObject)
ExpiredTombstonesCallback is a callback handling list of expired tombstones.
type FlushWriteCachePrm ¶
type FlushWriteCachePrm struct {
// contains filtered or unexported fields
}
FlushWriteCachePrm represents parameters of a `FlushWriteCache` operation.
func (*FlushWriteCachePrm) SetIgnoreErrors ¶
func (p *FlushWriteCachePrm) SetIgnoreErrors(ignore bool)
SetIgnoreErrors sets the flag to ignore read-errors during flush.
type GetPrm ¶
type GetPrm struct {
// contains filtered or unexported fields
}
GetPrm groups the parameters of Get operation.
func (*GetPrm) SetAddress ¶
SetAddress is a Get option to set the address of the requested object.
Option is required.
func (*GetPrm) SetIgnoreMeta ¶
SetIgnoreMeta is a Get option try to fetch object from blobstor directly, without accessing metabase.
type GetRes ¶
type GetRes struct {
// contains filtered or unexported fields
}
GetRes groups the resulting values of Get operation.
type HeadPrm ¶
type HeadPrm struct {
// contains filtered or unexported fields
}
HeadPrm groups the parameters of Head operation.
func (*HeadPrm) SetAddress ¶
SetAddress is a Head option to set the address of the requested object.
Option is required.
type HeadRes ¶
type HeadRes struct {
// contains filtered or unexported fields
}
HeadRes groups the resulting values of Head operation.
type ID ¶
type ID []byte
ID represents Shard identifier.
Each shard should have the unique ID within a single instance of local storage.
func NewIDFromBytes ¶
NewIDFromBytes constructs ID from byte slice.
type Info ¶
type Info struct { // Identifier of the shard. ID *ID // Shard mode. Mode mode.Mode // Information about the metabase. MetaBaseInfo meta.Info // Information about the BLOB storage. BlobStorInfo blobstor.Info // Information about the Write Cache. WriteCacheInfo writecache.Info // ErrorCount contains amount of errors occurred in shard operations. ErrorCount uint32 // PiloramaInfo contains information about trees stored on this shard. PiloramaInfo pilorama.Info }
Info groups the information about Shard.
type InhumePrm ¶
type InhumePrm struct {
// contains filtered or unexported fields
}
InhumePrm encapsulates parameters for inhume operation.
func (*InhumePrm) ForceRemoval ¶
func (p *InhumePrm) ForceRemoval()
ForceRemoval forces object removing despite any restrictions imposed on deleting that object. Expected to be used only in control service.
func (*InhumePrm) InhumeByTomb ¶
InhumeByTomb sets a list of objects that should be inhumed and tombstone address as the reason for inhume operation.
tombstone should not be nil, addr should not be empty. Should not be called along with MarkAsGarbage.
func (*InhumePrm) MarkAsGarbage ¶
MarkAsGarbage marks object to be physically removed from shard.
Should not be called along with InhumeByTomb.
func (*InhumePrm) SetTargets ¶
SetTargets sets targets and does not change inhuming operation (GC or Tombstone).
type ListContainersPrm ¶
type ListContainersPrm struct{}
type ListContainersRes ¶
type ListContainersRes struct {
// contains filtered or unexported fields
}
func (ListContainersRes) Containers ¶
func (r ListContainersRes) Containers() []cid.ID
type ListWithCursorPrm ¶
type ListWithCursorPrm struct {
// contains filtered or unexported fields
}
ListWithCursorPrm contains parameters for ListWithCursor operation.
func (*ListWithCursorPrm) WithCount ¶
func (p *ListWithCursorPrm) WithCount(count uint32)
WithCount sets maximum amount of addresses that ListWithCursor should return.
func (*ListWithCursorPrm) WithCursor ¶
func (p *ListWithCursorPrm) WithCursor(cursor *Cursor)
WithCursor sets cursor for ListWithCursor operation. For initial request, ignore this param or use nil value. For consecutive requests, use value from ListWithCursorRes.
type ListWithCursorRes ¶
type ListWithCursorRes struct {
// contains filtered or unexported fields
}
ListWithCursorRes contains values returned from ListWithCursor operation.
func (ListWithCursorRes) AddressList ¶
func (r ListWithCursorRes) AddressList() []objectcore.AddressWithType
AddressList returns addresses selected by ListWithCursor operation.
func (ListWithCursorRes) Cursor ¶
func (r ListWithCursorRes) Cursor() *Cursor
Cursor returns cursor for consecutive listing requests.
type MetricsWriter ¶
type MetricsWriter interface { // SetObjectCounter must set object counter taking into account object type. SetObjectCounter(objectType string, v uint64) // AddToObjectCounter must update object counter taking into account object // type. // Negative parameter must decrease the counter. AddToObjectCounter(objectType string, delta int) // AddToContainerSize must add a value to the container size. // Value can be negative. AddToContainerSize(cnr string, value int64) // AddToPayloadSize must add a value to the payload size. // Value can be negative. AddToPayloadSize(value int64) // IncObjectCounter must increment shard's object counter taking into account // object type. IncObjectCounter(objectType string) // DecObjectCounter must decrement shard's object counter taking into account // object type. DecObjectCounter(objectType string) // SetShardID must set (update) the shard identifier that will be used in // metrics. SetShardID(id string) // SetReadonly must set shard readonly state. SetReadonly(readonly bool) }
MetricsWriter is an interface that must store shard's metrics.
type ObjectStatus ¶
type ObjectStatus struct { Blob blobstor.ObjectStatus Metabase meta.ObjectStatus Writecache writecache.ObjectStatus Errors []error }
ObjectStatus represents the status of an object in a storage system. It contains information about the object's status in various sub-components such as Blob storage, Metabase, and Writecache. Additionally, it includes a slice of errors that may have occurred at the object level.
type Option ¶
type Option func(*cfg)
Option represents Shard's constructor option.
func WithBlobStorOptions ¶
WithBlobStorOptions returns option to set internal BlobStor options.
func WithDeletedLockCallback ¶
func WithDeletedLockCallback(v DeletedLockCallback) Option
WithDeletedLockCallback returns option to specify callback of the deleted LOCK objects handler.
func WithExpiredLocksCallback ¶
func WithExpiredLocksCallback(cb ExpiredObjectsCallback) Option
WithExpiredLocksCallback returns option to specify callback of the expired LOCK objects handler.
func WithExpiredTombstonesCallback ¶
func WithExpiredTombstonesCallback(cb ExpiredTombstonesCallback) Option
WithExpiredTombstonesCallback returns option to specify callback of the expired tombstones handler.
func WithGCRemoverSleepInterval ¶
WithGCRemoverSleepInterval returns option to specify sleep interval between object remover executions.
func WithGCWorkerPoolInitializer ¶
func WithGCWorkerPoolInitializer(wpInit func(int) util.WorkerPool) Option
WithGCWorkerPoolInitializer returns option to set initializer of worker pool with specified worker number.
func WithLogger ¶
WithLogger returns option to set Shard's logger.
func WithMetaBaseOptions ¶
WithMetaBaseOptions returns option to set internal metabase options.
func WithMetricsWriter ¶
func WithMetricsWriter(v MetricsWriter) Option
WithMetricsWriter returns option to specify storage of the shard's metrics.
func WithMode ¶
WithMode returns option to set shard's mode. Mode must be one of the predefined:
- mode.ReadWrite;
- mode.ReadOnly.
func WithPiloramaOptions ¶
WithPiloramaOptions returns option to set internal write cache options.
func WithRefillMetabase ¶
WithRefillMetabase returns option to set flag to refill the Metabase on Shard's initialization step.
func WithRemoverBatchSize ¶
WithRemoverBatchSize returns option to set batch size of single removal operation.
func WithReportErrorFunc ¶
WithReportErrorFunc returns option to specify callback for handling storage-related errors in the background workers.
func WithTombstoneSource ¶
func WithTombstoneSource(v TombstoneSource) Option
WithTombstoneSource returns option to set TombstoneSource.
func WithWriteCache ¶
WithWriteCache returns option to toggle write cache usage.
func WithWriteCacheOptions ¶
func WithWriteCacheOptions(opts ...writecache.Option) Option
WithWriteCacheOptions returns option to set internal write cache options.
type PutPrm ¶
type PutPrm struct {
// contains filtered or unexported fields
}
PutPrm groups the parameters of Put operation.
func (*PutPrm) SetObjectBinary ¶
SetObjectBinary allows to provide the already encoded object in Shard format. Object header must be a prefix with specified length. If provided, the encoding step is skipped. It's the caller's responsibility to ensure that the data matches the object structure being processed.
type RestorePrm ¶
type RestorePrm struct {
// contains filtered or unexported fields
}
RestorePrm groups the parameters of Restore operation.
func (*RestorePrm) WithIgnoreErrors ¶
func (p *RestorePrm) WithIgnoreErrors(ignore bool)
WithIgnoreErrors is a Restore option which allows to ignore errors encountered during restore. Corrupted objects will not be processed.
func (*RestorePrm) WithPath ¶
func (p *RestorePrm) WithPath(path string)
WithPath is a Restore option to set the destination path.
func (*RestorePrm) WithStream ¶
func (p *RestorePrm) WithStream(r io.Reader)
WithStream is a Restore option to set the stream to read objects from. It takes priority over `WithPath` option.
type RestoreRes ¶
type RestoreRes struct {
// contains filtered or unexported fields
}
RestoreRes groups the result fields of Restore operation.
func (RestoreRes) FailCount ¶
func (r RestoreRes) FailCount() int
FailCount return amount of object skipped.
type RngPrm ¶
type RngPrm struct {
// contains filtered or unexported fields
}
RngPrm groups the parameters of GetRange operation.
func (*RngPrm) SetAddress ¶
SetAddress is a Rng option to set the address of the requested object.
Option is required.
func (*RngPrm) SetIgnoreMeta ¶
SetIgnoreMeta is a Get option try to fetch object from blobstor directly, without accessing metabase.
type RngRes ¶
type RngRes struct {
// contains filtered or unexported fields
}
RngRes groups the resulting values of GetRange operation.
type SelectPrm ¶
type SelectPrm struct {
// contains filtered or unexported fields
}
SelectPrm groups the parameters of Select operation.
func (*SelectPrm) SetContainerID ¶
SetContainerID is a Select option to set the container id to search in.
func (*SelectPrm) SetFilters ¶
func (p *SelectPrm) SetFilters(fs object.SearchFilters)
SetFilters is a Select option to set the object filters.
type SelectRes ¶
type SelectRes struct {
// contains filtered or unexported fields
}
SelectRes groups the resulting values of Select operation.
func (SelectRes) AddressList ¶
AddressList returns list of addresses of the selected objects.
type Shard ¶
type Shard struct {
// contains filtered or unexported fields
}
Shard represents single shard of NeoFS Local Storage Engine.
func (*Shard) ContainerSize ¶
func (s *Shard) ContainerSize(prm ContainerSizePrm) (ContainerSizeRes, error)
func (*Shard) DeleteContainer ¶
DeleteContainer deletes any information related to the container including: - Metabase; - Blobstor; - Pilorama (if configured); - Write-cache (if configured).
func (*Shard) Dump ¶
Dump dumps all objects from the shard to a file or stream.
Returns any error encountered.
func (*Shard) Exists ¶
Exists checks if object is presented in shard.
Returns any error encountered that does not allow to unambiguously determine the presence of an object.
Returns an error of type apistatus.ObjectAlreadyRemoved if object has been marked as removed. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*Shard) FlushWriteCache ¶
func (s *Shard) FlushWriteCache(p FlushWriteCachePrm) error
FlushWriteCache flushes all data from the write-cache.
func (*Shard) Get ¶
Get reads an object from shard.
Returns any error encountered that did not allow to completely read the object part.
Returns an error of type apistatus.ObjectNotFound if the requested object is missing in shard. Returns an error of type apistatus.ObjectAlreadyRemoved if the requested object has been marked as removed in shard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*Shard) GetBytes ¶
GetBytes reads object from the Shard by address into memory buffer in a canonical NeoFS binary format. Returns apistatus.ObjectNotFound if object is missing.
func (*Shard) GetBytesWithMetadataLookup ¶
GetBytesWithMetadataLookup works similar to shard.GetBytes, but pre-checks object presence in the underlying metabase: if object cannot be accessed from the metabase, GetBytesWithMetadataLookup returns an error.
func (*Shard) GetRange ¶
GetRange reads part of an object from shard.
Returns any error encountered that did not allow to completely read the object part.
Returns ErrRangeOutOfBounds if the requested object range is out of bounds. Returns an error of type apistatus.ObjectNotFound if the requested object is missing. Returns an error of type apistatus.ObjectAlreadyRemoved if the requested object has been marked as removed in shard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*Shard) HandleDeletedLocks ¶
HandleDeletedLocks unlocks all objects which were locked by lockers. Also, marks as garbage every object that becomes free-to-remove and just removed lock object is the only reason for that object to be alive (e.g. expired but locked objects).
func (*Shard) HandleExpiredLocks ¶
HandleExpiredLocks unlocks all objects which were locked by lockers. If successful, marks lockers themselves as garbage. Also, marks as garbage every object that becomes free-to-remove and just removed lock object is the only reason for that object to be alive (e.g. expired but locked objects).
func (*Shard) HandleExpiredTombstones ¶
func (s *Shard) HandleExpiredTombstones(tss []meta.TombstonedObject)
HandleExpiredTombstones marks tombstones themselves as garbage and clears up corresponding graveyard records.
Does not modify tss.
func (*Shard) Head ¶
Head reads header of the object from the shard.
Returns any error encountered.
Returns an error of type apistatus.ObjectNotFound if object is missing in Shard. Returns an error of type apistatus.ObjectAlreadyRemoved if the requested object has been marked as removed in shard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*Shard) Inhume ¶
Inhume calls metabase. Inhume method to mark object as removed. It won't be removed physically from blobStor and metabase until `Delete` operation.
Allows inhuming non-locked objects only. Returns apistatus.ObjectLocked if at least one object is locked.
Returns ErrReadOnlyMode error if shard is in "read-only" mode.
func (*Shard) InhumeContainer ¶
InhumeContainer marks every object in a container as removed. Any further [StorageEngine.Get] calls will return apistatus.ObjectNotFound errors. There is no any LOCKs, forced GC marks and any relations checks, every object that belongs to a provided container will be marked as a removed one.
func (*Shard) IsLocked ¶
IsLocked checks object locking relation of the provided object. Not found object is considered as not locked. Requires healthy metabase, returns ErrDegradedMode otherwise.
func (*Shard) ListContainers ¶
func (s *Shard) ListContainers(_ ListContainersPrm) (ListContainersRes, error)
func (*Shard) ListWithCursor ¶
func (s *Shard) ListWithCursor(prm ListWithCursorPrm) (ListWithCursorRes, error)
ListWithCursor lists physical objects available in shard starting from cursor. Includes regular, tombstone and storage group objects. Does not include inhumed objects. Use cursor value from response for consecutive requests.
Returns ErrEndOfListing if there are no more objects to return or count parameter set to zero.
func (*Shard) Lock ¶
Lock marks objects as locked with another object. All objects from the specified container.
Allows locking regular objects only (otherwise returns apistatus.LockNonRegularObject).
Locked list should be unique. Panics if it is empty.
func (*Shard) NotificationChannel ¶
NotificationChannel returns channel for shard events.
func (*Shard) ObjectStatus ¶
func (s *Shard) ObjectStatus(address oid.Address) (ObjectStatus, error)
ObjectStatus returns the status of the object in the Shard. It contains status of the object in Blob storage, Metabase and Writecache.
func (*Shard) Put ¶
Put saves the object in shard.
Returns any error encountered that did not allow to completely save the object.
Returns ErrReadOnlyMode error if shard is in "read-only" mode.
func (*Shard) Reload ¶
Reload reloads configuration portions that are necessary. If a config option is invalid, it logs an error and returns nil. If there was a problem with applying new configuration, an error is returned.
func (*Shard) Restore ¶
func (s *Shard) Restore(prm RestorePrm) (RestoreRes, error)
Restore restores objects from the dump prepared by Dump.
Returns any error encountered.
func (*Shard) Select ¶
Select selects the objects from shard that match select parameters.
Returns any error encountered that did not allow to completely select the objects.
Returns [object.ErrInvalidSearchQuery] if specified query is invalid.
func (*Shard) SetMode ¶
SetMode sets mode of the shard.
Returns any error encountered that did not allow setting shard mode.
func (*Shard) ToMoveIt ¶
func (s *Shard) ToMoveIt(prm ToMoveItPrm) (ToMoveItRes, error)
ToMoveIt calls metabase.ToMoveIt method to mark object as relocatable to another shard.
func (*Shard) TreeAddByPath ¶
func (s *Shard) TreeAddByPath(d pilorama.CIDDescriptor, treeID string, attr string, path []string, meta []pilorama.KeyValue) ([]pilorama.LogMove, error)
TreeAddByPath implements the pilorama.Forest interface.
func (*Shard) TreeApply ¶
func (s *Shard) TreeApply(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move, backgroundSync bool) error
TreeApply implements the pilorama.Forest interface.
func (*Shard) TreeExists ¶
TreeExists implements the pilorama.Forest interface.
func (*Shard) TreeGetByPath ¶
func (s *Shard) TreeGetByPath(cid cidSDK.ID, treeID string, attr string, path []string, latest bool) ([]pilorama.Node, error)
TreeGetByPath implements the pilorama.Forest interface.
func (*Shard) TreeGetChildren ¶
func (s *Shard) TreeGetChildren(cid cidSDK.ID, treeID string, nodeID pilorama.Node) ([]uint64, error)
TreeGetChildren implements the pilorama.Forest interface.
func (*Shard) TreeGetMeta ¶
func (s *Shard) TreeGetMeta(cid cidSDK.ID, treeID string, nodeID pilorama.Node) (pilorama.Meta, uint64, error)
TreeGetMeta implements the pilorama.Forest interface.
func (*Shard) TreeGetOpLog ¶
TreeGetOpLog implements the pilorama.Forest interface.
type ToMoveItPrm ¶
type ToMoveItPrm struct {
// contains filtered or unexported fields
}
ToMoveItPrm encapsulates parameters for ToMoveIt operation.
func (*ToMoveItPrm) SetAddress ¶
func (p *ToMoveItPrm) SetAddress(addr oid.Address)
SetAddress sets object address that should be marked to move into another shard.
type ToMoveItRes ¶
type ToMoveItRes struct{}
ToMoveItRes encapsulates results of ToMoveIt operation.
type TombstoneSource ¶
type TombstoneSource interface { // IsTombstoneAvailable must return boolean value that means // provided tombstone's presence in the NeoFS network at the // time of the passed epoch. IsTombstoneAvailable(ctx context.Context, addr oid.Address, epoch uint64) bool }
TombstoneSource is an interface that checks tombstone status in the NeoFS network.