Documentation ¶
Index ¶
- Variables
- func IsAtrributeIndexed(attr string) bool
- func IsUserObject(obj *objectSDK.Object) bool
- func Upgrade(ctx context.Context, path string, compact bool, cs container.InfoProvider, ...) error
- type ContainerCounters
- type CountAliveObjectsInContainerPrm
- type Cursor
- type DB
- func (db *DB) Close(context.Context) error
- func (db *DB) ContainerCount(ctx context.Context, id cid.ID) (ObjectCounters, error)
- func (db *DB) ContainerCounters(ctx context.Context) (ContainerCounters, error)
- func (db *DB) ContainerSize(id cid.ID) (size uint64, err error)
- func (db *DB) Containers(ctx context.Context) (list []cid.ID, err error)
- func (db *DB) CountAliveObjectsInContainer(ctx context.Context, prm CountAliveObjectsInContainerPrm) (uint64, error)
- func (db *DB) Delete(ctx context.Context, prm DeletePrm) (DeleteRes, error)
- func (db *DB) DeleteContainerCount(ctx context.Context, id cid.ID) error
- func (db *DB) DeleteContainerSize(ctx context.Context, id cid.ID) error
- func (db *DB) DumpInfo() Info
- func (db *DB) Exists(ctx context.Context, prm ExistsPrm) (res ExistsRes, err error)
- func (db *DB) FilterExpired(ctx context.Context, epoch uint64, addresses []oid.Address) ([]oid.Address, error)
- func (db *DB) FreeLockedBy(lockers []oid.Address) ([]oid.Address, error)
- func (db *DB) Get(ctx context.Context, prm GetPrm) (res GetRes, err error)
- func (db *DB) GetChildren(ctx context.Context, addresses []oid.Address) (map[oid.Address][]oid.Address, error)
- func (db *DB) GetLocked(ctx context.Context, addr oid.Address) (res []oid.ID, err error)
- func (db *DB) GetShardID(ctx context.Context, mode metamode.Mode) ([]byte, error)
- func (db *DB) Inhume(ctx context.Context, prm InhumePrm) (InhumeRes, error)
- func (db *DB) InhumeTombstones(ctx context.Context, tss []TombstonedObject) (InhumeRes, error)
- func (db *DB) Init(_ context.Context) error
- func (db *DB) IsLocked(ctx context.Context, prm IsLockedPrm) (res IsLockedRes, err error)
- func (db *DB) IterateCoveredByTombstones(ctx context.Context, tss map[string]oid.Address, h func(oid.Address) error) error
- func (db *DB) IterateExpired(ctx context.Context, epoch uint64, h ExpiredObjectHandler) error
- func (db *DB) IterateOverContainers(ctx context.Context, prm IterateOverContainersPrm) error
- func (db *DB) IterateOverGarbage(ctx context.Context, p GarbageIterationPrm) error
- func (db *DB) IterateOverGraveyard(ctx context.Context, p GraveyardIterationPrm) error
- func (db *DB) IterateOverObjectsInContainer(ctx context.Context, prm IterateOverObjectsInContainerPrm) error
- func (db *DB) ListWithCursor(ctx context.Context, prm ListPrm) (res ListRes, err error)
- func (db *DB) Lock(ctx context.Context, cnr cid.ID, locker oid.ID, locked []oid.ID) error
- func (db *DB) ObjectCounters() (cc ObjectCounters, err error)
- func (db *DB) Open(ctx context.Context, m mode.Mode) error
- func (db *DB) Put(ctx context.Context, prm PutPrm) (res PutRes, err error)
- func (db *DB) Reload(ctx context.Context, opts ...Option) (bool, error)
- func (db *DB) Reset() error
- func (db *DB) Select(ctx context.Context, prm SelectPrm) (res SelectRes, err error)
- func (db *DB) SetLogger(l *logger.Logger)
- func (db *DB) SetMode(ctx context.Context, m mode.Mode) error
- func (db *DB) SetParentID(parentID string)
- func (db *DB) SetShardID(ctx context.Context, id []byte, mode metamode.Mode) error
- func (db *DB) StorageID(ctx context.Context, prm StorageIDPrm) (res StorageIDRes, err error)
- func (db *DB) SyncCounters() error
- func (db *DB) UpdateStorageID(ctx context.Context, prm UpdateStorageIDPrm) (res UpdateStorageIDRes, err error)
- func (db *DB) ZeroCountContainers(ctx context.Context) ([]cid.ID, error)
- func (db *DB) ZeroSizeContainers(ctx context.Context) ([]cid.ID, error)
- type DeletePrm
- type DeleteRes
- type DeletionInfo
- type EpochState
- type ExistsPrm
- type ExistsRes
- type ExpiredObject
- type ExpiredObjectHandler
- type GarbageHandler
- type GarbageIterationPrm
- type GarbageObject
- type GetPrm
- type GetRes
- type GraveyardIterationPrm
- type Info
- type InhumePrm
- type InhumeRes
- func (i InhumeRes) DeletedLockObjects() []oid.Address
- func (i InhumeRes) GetDeletionInfoByIndex(target int) DeletionInfo
- func (i InhumeRes) GetDeletionInfoLength() int
- func (i InhumeRes) InhumedByCnrID() map[cid.ID]ObjectCounters
- func (i InhumeRes) LogicInhumed() uint64
- func (i InhumeRes) UserInhumed() uint64
- type IsLockedPrm
- type IsLockedRes
- type IterateOverContainersPrm
- type IterateOverObjectsInContainerPrm
- type ListPrm
- type ListRes
- type Metrics
- type ObjectCounters
- type Option
- func WithBoltDBOptions(opts *bbolt.Options) Option
- func WithEpochState(s EpochState) Option
- func WithLogger(l *logger.Logger) Option
- func WithMaxBatchDelay(d time.Duration) Option
- func WithMaxBatchSize(s int) Option
- func WithMetrics(m Metrics) Option
- func WithPath(path string) Option
- func WithPermissions(perm fs.FileMode) Option
- type PutPrm
- type PutRes
- type SelectPrm
- type SelectRes
- type StorageIDPrm
- type StorageIDRes
- type TombstonedHandler
- type TombstonedObject
- type UpdateStorageIDPrm
- type UpdateStorageIDRes
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownObjectType = errors.New("unknown object type") ErrIncorrectRootObject = errors.New("invalid root object") )
var ErrDegradedMode = logicerr.New("metabase is in a degraded mode")
ErrDegradedMode is returned when metabase is in a degraded mode.
var ErrEndOfListing = logicerr.New("end of object listing")
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 ErrIncompletedUpgrade = logicerr.New("metabase upgrade is not completed")
var ErrInterruptIterator = logicerr.New("iterator is interrupted")
ErrInterruptIterator is returned by iteration handlers as a "break" keyword.
var ErrLackSplitInfo = logicerr.New("no split info on parent object")
var ErrLockObjectRemoval = logicerr.New("lock object removal")
ErrLockObjectRemoval is returned when inhume operation is being performed on lock object, and it is not a forced object removal.
var ErrObjectIsExpired = logicerr.New("object is expired")
ErrObjectIsExpired is returned when the requested object's epoch is less than the current one. Such objects are considered as removed and should not be returned from the Storage Engine.
var ErrOutdatedVersion = logicerr.New("invalid version, resynchronization is required")
ErrOutdatedVersion is returned on initializing an existing metabase that is not compatible with the current code version.
var ErrReadOnlyMode = logicerr.New("metabase is in a read-only mode")
ErrReadOnlyMode is returned when metabase is in a read-only mode.
Functions ¶
func IsAtrributeIndexed ¶ added in v0.44.0
IsAtrributeIndexed returns True if attribute is indexed by metabase.
func IsUserObject ¶ added in v0.38.0
Types ¶
type ContainerCounters ¶ added in v0.38.0
type ContainerCounters struct {
Counts map[cid.ID]ObjectCounters
}
type CountAliveObjectsInContainerPrm ¶ added in v0.44.0
type CountAliveObjectsInContainerPrm struct { // ObjectType type of objects to iterate over. ObjectType objectSDK.Type // ContainerID container for objects to iterate over. ContainerID cid.ID }
CountAliveObjectsInContainerPrm contains parameters for IterateOverObjectsInContainer operation.
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor is a type for continuous object listing.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents local metabase of storage node.
func (*DB) ContainerCount ¶ added in v0.38.0
func (*DB) ContainerCounters ¶ added in v0.38.0
func (db *DB) ContainerCounters(ctx context.Context) (ContainerCounters, error)
ContainerCounters returns object counters for each container that metabase has tracked since it was opened and initialized.
Returns only the errors that do not allow reading counter in Bolt database.
It is guaranteed that the ContainerCounters fields are not nil.
func (*DB) CountAliveObjectsInContainer ¶ added in v0.44.0
func (db *DB) CountAliveObjectsInContainer(ctx context.Context, prm CountAliveObjectsInContainerPrm) (uint64, error)
CountAliveObjectsInContainer count objects in bucket which aren't in graveyard or garbage.
func (*DB) DeleteContainerCount ¶ added in v0.38.0
func (*DB) DeleteContainerSize ¶ added in v0.38.0
func (*DB) Exists ¶
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.
Returns an error of type apistatus.ObjectAlreadyRemoved if object has been placed in graveyard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*DB) FilterExpired ¶
func (db *DB) FilterExpired(ctx context.Context, epoch uint64, addresses []oid.Address) ([]oid.Address, error)
FilterExpired return expired items from addresses. Address considered expired if metabase does contain information about expiration and expiration epoch is less than epoch.
func (*DB) FreeLockedBy ¶
FreeLockedBy unlocks all objects in DB which are locked by lockers. Returns slice of unlocked object ID's or an error.
func (*DB) Get ¶
Get returns object header for specified address.
Returns an error of type apistatus.ObjectNotFound if object is missing in DB. Returns an error of type apistatus.ObjectAlreadyRemoved if object has been placed in graveyard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*DB) GetChildren ¶
func (db *DB) GetChildren(ctx context.Context, addresses []oid.Address) (map[oid.Address][]oid.Address, error)
GetChildren returns parent -> children map. If an object has no children, then map will contain addr -> empty slice value.
func (*DB) GetLocked ¶ added in v0.40.0
GetLocked return `LOCK` id's if provided object is locked by any `LOCK`. Not found object is considered as non-locked.
Returns only non-logical errors related to underlying database.
func (*DB) GetShardID ¶ added in v0.38.2
GetShardID sets metabase operation mode and reads shard id from db. If id is missing, returns nil, nil.
GetShardID does not report any metrics.
func (*DB) Inhume ¶
Inhume marks objects as removed but not removes it from metabase.
Allows inhuming non-locked objects only. Returns apistatus.ObjectLocked if at least one object is locked. Returns ErrLockObjectRemoval if inhuming is being performed on lock (not locked) object.
NOTE: Marks any object with GC mark (despite any prohibitions on operations with that object) if WithForceGCMark option has been provided.
func (*DB) InhumeTombstones ¶ added in v0.44.0
InhumeTombstones deletes tombstoned objects from the graveyard bucket.
Returns any error appeared during deletion process.
func (*DB) Init ¶
Init initializes metabase. It creates static (CID-independent) buckets in underlying BoltDB instance.
Returns ErrOutdatedVersion if a database at the provided path is outdated.
Does nothing if metabase has already been initialized and filled. To roll back the database to its initial state, use Reset.
func (*DB) IsLocked ¶
func (db *DB) IsLocked(ctx context.Context, prm IsLockedPrm) (res IsLockedRes, err error)
IsLocked checks is the provided object is locked by any `LOCK`. Not found object is considered as non-locked.
Returns only non-logical errors related to underlying database.
func (*DB) IterateCoveredByTombstones ¶
func (db *DB) IterateCoveredByTombstones(ctx context.Context, tss map[string]oid.Address, h func(oid.Address) error) error
IterateCoveredByTombstones iterates over all objects in DB which are covered by tombstone with string address from tss. Locked objects are not included (do not confuse with objects of type LOCK).
If h returns ErrInterruptIterator, nil returns immediately. Returns other errors of h directly.
Does not modify tss.
func (*DB) IterateExpired ¶
IterateExpired iterates over all objects in DB which are out of date relative to epoch. Locked objects are not included (do not confuse with objects of type LOCK).
If h returns ErrInterruptIterator, nil returns immediately. Returns other errors of h directly.
func (*DB) IterateOverContainers ¶ added in v0.43.0
func (db *DB) IterateOverContainers(ctx context.Context, prm IterateOverContainersPrm) error
IterateOverContainers lists physical containers available in metabase starting from first.
func (*DB) IterateOverGarbage ¶
func (db *DB) IterateOverGarbage(ctx context.Context, p GarbageIterationPrm) error
IterateOverGarbage iterates over all objects marked with GC mark.
If h returns ErrInterruptIterator, nil returns immediately. Returns other errors of h directly.
func (*DB) IterateOverGraveyard ¶
func (db *DB) IterateOverGraveyard(ctx context.Context, p GraveyardIterationPrm) error
IterateOverGraveyard iterates over all graves in DB.
If h returns ErrInterruptIterator, nil returns immediately. Returns other errors of h directly.
func (*DB) IterateOverObjectsInContainer ¶ added in v0.43.0
func (db *DB) IterateOverObjectsInContainer(ctx context.Context, prm IterateOverObjectsInContainerPrm) error
IterateOverObjectsInContainer iterate over physical objects available in metabase starting from first.
func (*DB) ListWithCursor ¶
ListWithCursor lists physical objects available in metabase starting from cursor. Includes objects of all types. 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 is set to zero.
func (*DB) Lock ¶
Lock marks objects as locked with another object. All objects are from the specified container.
Allows locking regular objects only (otherwise returns apistatus.LockNonRegularObject).
Locked list should be unique. Panics if it is empty.
func (*DB) ObjectCounters ¶
func (db *DB) ObjectCounters() (cc ObjectCounters, err error)
ObjectCounters returns object counters that metabase has tracked since it was opened and initialized.
Returns only the errors that do not allow reading counter in Bolt database.
func (*DB) Put ¶
Put saves object header in metabase. Object payload expected to be cut.
Returns an error of type apistatus.ObjectAlreadyRemoved if object has been placed in graveyard. Returns the object.ErrObjectIsExpired if the object is presented but already expired.
func (*DB) Reload ¶
Reload reloads part of the configuration. It returns true iff database was reopened. 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.
If a metabase was couldn't be reopened because of an error, ErrDegradedMode is returned.
func (*DB) Reset ¶
Reset resets metabase. Works similar to Init but cleans up all static buckets and removes all dynamic (CID-dependent) ones in non-blank BoltDB instances.
func (*DB) SetLogger ¶
SetLogger sets logger. It is used after the shard ID was generated to use it in logs.
func (*DB) SetMode ¶
SetMode sets the metabase mode of operation. If the mode assumes no operation metabase, the database is closed.
func (*DB) SetParentID ¶ added in v0.37.0
SetParentID sets parent ID to nested components. It is used after the shard ID was generated to use it in logs.
func (*DB) SetShardID ¶ added in v0.38.2
SetShardID sets metabase operation mode and writes shard id to db.
func (*DB) StorageID ¶
func (db *DB) StorageID(ctx context.Context, prm StorageIDPrm) (res StorageIDRes, err error)
StorageID returns storage descriptor for objects from the blobstor. It is put together with the object can makes get/delete operation faster.
func (*DB) SyncCounters ¶
SyncCounters forces to synchronize the object counters.
func (*DB) UpdateStorageID ¶
func (db *DB) UpdateStorageID(ctx context.Context, prm UpdateStorageIDPrm) (res UpdateStorageIDRes, err error)
UpdateStorageID updates storage descriptor for objects from the blobstor.
func (*DB) ZeroCountContainers ¶ added in v0.38.0
ZeroCountContainers returns containers with objects count = 0 in metabase.
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.
type DeleteRes ¶
type DeleteRes struct {
// contains filtered or unexported fields
}
DeleteRes groups the resulting values of Delete operation.
func (DeleteRes) LogicCount ¶ added in v0.38.0
LogicCount returns the number of removed logic objects.
func (DeleteRes) LogicSize ¶ added in v0.38.0
LogicSize returns the size of removed logical objects.
func (DeleteRes) PhyCount ¶ added in v0.38.0
PhyCount returns the number of removed physical objects.
func (DeleteRes) RemovedByCnrID ¶ added in v0.38.0
func (d DeleteRes) RemovedByCnrID() map[cid.ID]ObjectCounters
RemovedByCnrID returns the number of removed objects by container ID.
type DeletionInfo ¶
DeletionInfo contains details on deleted object.
type EpochState ¶
type EpochState interface { // CurrentEpoch must return current epoch height. CurrentEpoch() uint64 }
EpochState is an interface that provides access to the current epoch number.
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.
func (*ExistsPrm) SetECParent ¶ added in v0.44.3
SetECParent is an Exists option to set objects parent.
type ExistsRes ¶
type ExistsRes struct {
// contains filtered or unexported fields
}
ExistsRes groups the resulting values of Exists operation.
type ExpiredObject ¶
type ExpiredObject struct {
// contains filtered or unexported fields
}
ExpiredObject is a descriptor of expired object from DB.
func (*ExpiredObject) Address ¶
func (e *ExpiredObject) Address() oid.Address
Address returns address of the expired object.
func (*ExpiredObject) Type ¶
func (e *ExpiredObject) Type() objectSDK.Type
Type returns type of the expired object.
type ExpiredObjectHandler ¶
type ExpiredObjectHandler func(*ExpiredObject) error
ExpiredObjectHandler is an ExpiredObject handling function.
type GarbageHandler ¶
type GarbageHandler func(GarbageObject) error
GarbageHandler is a GarbageObject handling function.
type GarbageIterationPrm ¶
type GarbageIterationPrm struct {
// contains filtered or unexported fields
}
GarbageIterationPrm groups parameters of the garbage iteration process.
func (*GarbageIterationPrm) SetHandler ¶
func (g *GarbageIterationPrm) SetHandler(h GarbageHandler)
SetHandler sets a handler that will be called on every GarbageObject.
func (*GarbageIterationPrm) SetOffset ¶
func (g *GarbageIterationPrm) SetOffset(offset oid.Address)
SetOffset sets an offset of the iteration operation. The handler will be applied to the next after the specified offset if any are left.
Note: if offset is not found in db, iteration starts from the element that WOULD BE the following after the offset if offset was presented. That means that it is safe to delete offset element and pass if to the iteration once again: iteration would start from the next element.
Nil offset means start an integration from the beginning.
type GarbageObject ¶
type GarbageObject struct {
// contains filtered or unexported fields
}
GarbageObject represents descriptor of the object that has been marked with GC.
func (GarbageObject) Address ¶
func (g GarbageObject) Address() oid.Address
Address returns garbage object address.
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.
type GetRes ¶
type GetRes struct {
// contains filtered or unexported fields
}
GetRes groups the resulting values of Get operation.
type GraveyardIterationPrm ¶
type GraveyardIterationPrm struct {
// contains filtered or unexported fields
}
GraveyardIterationPrm groups parameters of the graveyard iteration process.
func (*GraveyardIterationPrm) SetHandler ¶
func (g *GraveyardIterationPrm) SetHandler(h TombstonedHandler)
SetHandler sets a handler that will be called on every TombstonedObject.
func (*GraveyardIterationPrm) SetOffset ¶
func (g *GraveyardIterationPrm) SetOffset(offset oid.Address)
SetOffset sets an offset of the iteration operation. The handler will be applied to the next after the specified offset if any are left.
Note: if offset is not found in db, iteration starts from the element that WOULD BE the following after the offset if offset was presented. That means that it is safe to delete offset element and pass it to the iteration once again: iteration would start from the next element.
Nil offset means start an integration from the beginning.
type Info ¶
type Info struct { // Full path to the metabase. Path string // Permission of database file. Permission fs.FileMode }
Info groups the information about DB.
type InhumePrm ¶
type InhumePrm struct {
// contains filtered or unexported fields
}
InhumePrm encapsulates parameters for Inhume operation.
func (*InhumePrm) SetAddresses ¶
SetAddresses sets a list of object addresses that should be inhumed.
func (*InhumePrm) SetForceGCMark ¶
func (p *InhumePrm) SetForceGCMark()
SetForceGCMark allows removal any object. Expected to be called only in control service.
func (*InhumePrm) SetGCMark ¶
func (p *InhumePrm) SetGCMark()
SetGCMark marks the object to be physically removed.
Should not be called along with SetTombstoneAddress.
func (*InhumePrm) SetLockObjectHandling ¶
func (p *InhumePrm) SetLockObjectHandling()
SetLockObjectHandling checks if there were any LOCK object among the targets set via WithAddresses.
func (*InhumePrm) SetTombstoneAddress ¶
SetTombstoneAddress sets tombstone address as the reason for inhume operation.
addr should not be nil. Should not be called along with SetGCMark.
type InhumeRes ¶
type InhumeRes struct {
// contains filtered or unexported fields
}
InhumeRes encapsulates results of Inhume operation.
func (InhumeRes) DeletedLockObjects ¶
DeletedLockObjects returns deleted object of LOCK type. Returns always nil if WithoutLockObjectHandling was provided to the InhumePrm.
func (InhumeRes) GetDeletionInfoByIndex ¶
func (i InhumeRes) GetDeletionInfoByIndex(target int) DeletionInfo
GetDeletionInfoByIndex returns both deleted object sizes and associated container ID by index.
func (InhumeRes) GetDeletionInfoLength ¶
GetDeletionInfoLength returns amount of stored elements in deleted sizes array.
func (InhumeRes) InhumedByCnrID ¶ added in v0.38.0
func (i InhumeRes) InhumedByCnrID() map[cid.ID]ObjectCounters
InhumedByCnrID return number of object that have been inhumed by container ID.
func (InhumeRes) LogicInhumed ¶ added in v0.38.0
LogicInhumed return number of logic object that have been inhumed.
func (InhumeRes) UserInhumed ¶ added in v0.38.0
type IsLockedPrm ¶
type IsLockedPrm struct {
// contains filtered or unexported fields
}
IsLockedPrm groups the parameters of IsLocked operation.
func (*IsLockedPrm) SetAddress ¶
func (i *IsLockedPrm) SetAddress(addr oid.Address)
SetAddress sets object address that will be checked for lock relations.
type IsLockedRes ¶
type IsLockedRes struct {
// contains filtered or unexported fields
}
IsLockedRes groups the resulting values of IsLocked operation.
func (IsLockedRes) Locked ¶
func (i IsLockedRes) Locked() bool
Locked describes the requested object status according to the metabase current state.
type IterateOverContainersPrm ¶ added in v0.43.0
type IterateOverContainersPrm struct { // Handler function executed upon containers in db. Handler func(context.Context, objectSDK.Type, cid.ID) error }
IterateOverContainersPrm contains parameters for IterateOverContainers operation.
type IterateOverObjectsInContainerPrm ¶ added in v0.43.0
type IterateOverObjectsInContainerPrm struct { // ObjectType type of objects to iterate over. ObjectType objectSDK.Type // ContainerID container for objects to iterate over. ContainerID cid.ID // Handler function executed upon objects in db. Handler func(context.Context, *objectcore.Info) error }
IterateOverObjectsInContainerPrm contains parameters for IterateOverObjectsInContainer operation.
type ListPrm ¶
type ListPrm struct {
// contains filtered or unexported fields
}
ListPrm contains parameters for ListWithCursor operation.
type ListRes ¶
type ListRes struct {
// contains filtered or unexported fields
}
ListRes contains values returned from ListWithCursor operation.
func (ListRes) AddressList ¶
func (l ListRes) AddressList() []objectcore.Info
AddressList returns addresses selected by ListWithCursor operation.
type ObjectCounters ¶
ObjectCounters groups object counter according to metabase state.
func (ObjectCounters) IsZero ¶ added in v0.38.0
func (o ObjectCounters) IsZero() bool
type Option ¶
type Option func(*cfg)
Option is an option of DB constructor.
func WithBoltDBOptions ¶
WithBoltDBOptions returns option to specify BoltDB options.
func WithEpochState ¶
func WithEpochState(s EpochState) Option
WithEpochState return option to specify a source of current epoch height.
func WithLogger ¶
WithLogger returns option to set logger of DB.
func WithMaxBatchDelay ¶
WithMaxBatchDelay returns option to specify maximum time to wait before the batch of concurrent transactions is processed. This option is missing from `bbolt.Options` but is set right after DB is open.
func WithMaxBatchSize ¶
WithMaxBatchSize returns option to specify maximum concurrent operations to be processed in a single transactions. This option is missing from `bbolt.Options` but is set right after DB is open.
func WithMetrics ¶ added in v0.37.0
WithMetrics returns option to specify metrics collector.
func WithPermissions ¶
WithPermissions returns option to specify permission bits of Metabase system path.
type PutPrm ¶
type PutPrm struct {
// contains filtered or unexported fields
}
PutPrm groups the parameters of Put operation.
func (*PutPrm) SetIndexAttributes ¶ added in v0.44.0
func (*PutPrm) SetStorageID ¶
SetStorageID is a Put option to set storage ID to save.
type PutRes ¶
type PutRes struct {
Inserted bool
}
PutRes groups the resulting values of Put 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 objectSDK.SearchFilters)
SetFilters is a Select option to set the object filters.
func (*SelectPrm) SetUseAttributeIndex ¶ added in v0.44.0
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 StorageIDPrm ¶
type StorageIDPrm struct {
// contains filtered or unexported fields
}
StorageIDPrm groups the parameters of StorageID operation.
func (*StorageIDPrm) SetAddress ¶
func (p *StorageIDPrm) SetAddress(addr oid.Address)
SetAddress is a StorageID option to set the object address to check.
type StorageIDRes ¶
type StorageIDRes struct {
// contains filtered or unexported fields
}
StorageIDRes groups the resulting values of StorageID operation.
func (StorageIDRes) StorageID ¶
func (r StorageIDRes) StorageID() []byte
StorageID returns storage ID.
type TombstonedHandler ¶
type TombstonedHandler func(object TombstonedObject) error
TombstonedHandler is a TombstonedObject handling function.
type TombstonedObject ¶
type TombstonedObject struct {
// contains filtered or unexported fields
}
TombstonedObject represents descriptor of the object that has been covered with tombstone.
func (TombstonedObject) Address ¶
func (g TombstonedObject) Address() oid.Address
Address returns tombstoned object address.
func (TombstonedObject) Tombstone ¶
func (g TombstonedObject) Tombstone() oid.Address
Tombstone returns address of a tombstone that covers object.
type UpdateStorageIDPrm ¶
type UpdateStorageIDPrm struct {
// contains filtered or unexported fields
}
UpdateStorageIDPrm groups the parameters of UpdateStorageID operation.
func (*UpdateStorageIDPrm) SetAddress ¶
func (p *UpdateStorageIDPrm) SetAddress(addr oid.Address)
SetAddress is an UpdateStorageID option to set the object address to check.
func (*UpdateStorageIDPrm) SetStorageID ¶
func (p *UpdateStorageIDPrm) SetStorageID(id []byte)
SetStorageID is an UpdateStorageID option to set the storage ID.
type UpdateStorageIDRes ¶
type UpdateStorageIDRes struct{}
UpdateStorageIDRes groups the resulting values of UpdateStorageID operation.