writer

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NeedAdditionalBroadcast

func NeedAdditionalBroadcast(obj *objectSDK.Object, localOnly bool) bool

func New

Types

type ClientConstructor

type ClientConstructor interface {
	Get(client.NodeInfo) (client.MultiAddressClient, error)
}

type Config

type Config struct {
	KeyStorage *objutil.KeyStorage

	MaxSizeSrc MaxSizeSource

	LocalStore ObjectStorage

	ContainerSource container.Source

	NetmapSource netmap.Source

	RemotePool, LocalPool util.WorkerPool

	NetmapKeys netmap.AnnouncedKeys

	FormatValidator *object.FormatValidator

	NetworkState netmap.State

	ClientConstructor ClientConstructor

	Logger *logger.Logger

	VerifySessionTokenIssuer bool
}

Config represents a set of static parameters that are established during the initialization phase of all services.

func (*Config) NewNodeIterator

func (c *Config) NewNodeIterator(opts []placement.Option) *NodeIterator

type ECWriter

type ECWriter struct {
	Config        *Config
	PlacementOpts []placement.Option
	Container     containerSDK.Container
	Key           *ecdsa.PrivateKey
	CommonPrm     *svcutil.CommonPrm
	Relay         func(context.Context, client.NodeInfo, client.MultiAddressClient) error

	ObjectMeta      object.ContentMeta
	ObjectMetaValid bool
}

func (*ECWriter) WriteObject

func (e *ECWriter) WriteObject(ctx context.Context, obj *objectSDK.Object) error

type FormatValidatorConfig

type FormatValidatorConfig interface {
	VerifySessionTokenIssuer() bool
}

type InnerRing

type InnerRing interface {
	InnerRingKeys() ([][]byte, error)
}

type LocalTarget

type LocalTarget struct {
	Storage ObjectStorage
}

func (LocalTarget) WriteObject

func (t LocalTarget) WriteObject(ctx context.Context, obj *objectSDK.Object, meta objectCore.ContentMeta) error

type MaxSizeSource

type MaxSizeSource interface {
	// MaxObjectSize returns maximum payload size
	// of physically stored object in system.
	//
	// Must return 0 if value can not be obtained.
	MaxObjectSize() uint64
}

type NodeDescriptor

type NodeDescriptor struct {
	Local bool

	Info placement.Node
}

type NodeIterator

type NodeIterator struct {
	Traversal
	// contains filtered or unexported fields
}

func (*NodeIterator) ForEachNode

func (n *NodeIterator) ForEachNode(ctx context.Context, f func(context.Context, NodeDescriptor) error) error

type ObjectStorage

type ObjectStorage interface {
	// Put must save passed object
	// and return any appeared error.
	Put(context.Context, *objectSDK.Object) error
	// Delete must delete passed objects
	// and return any appeared error.
	Delete(ctx context.Context, tombstone oid.Address, toDelete []oid.ID) error
	// Lock must lock passed objects
	// and return any appeared error.
	Lock(ctx context.Context, locker oid.Address, toLock []oid.ID) error
	// IsLocked must clarify object's lock status.
	IsLocked(context.Context, oid.Address) (bool, error)
}

ObjectStorage is an object storage interface.

type Option

type Option func(*Config)

func WithLogger

func WithLogger(l *logger.Logger) Option

func WithVerifySessionTokenIssuer

func WithVerifySessionTokenIssuer(v bool) Option

func WithWorkerPools

func WithWorkerPools(remote, local util.WorkerPool) Option

type Params

type Params struct {
	Config *Config

	Common *objutil.CommonPrm

	Header *objectSDK.Object

	Container containerSDK.Container

	TraverseOpts []placement.Option

	Relay func(context.Context, client.NodeInfo, client.MultiAddressClient) error

	SignRequestPrivateKey *ecdsa.PrivateKey
}

type RemotePutPrm

type RemotePutPrm struct {
	// contains filtered or unexported fields
}

RemotePutPrm groups remote put operation parameters.

func (*RemotePutPrm) WithNodeInfo

func (p *RemotePutPrm) WithNodeInfo(v netmap.NodeInfo) *RemotePutPrm

WithNodeInfo sets information about the remote node.

func (*RemotePutPrm) WithObject

func (p *RemotePutPrm) WithObject(v *objectSDK.Object) *RemotePutPrm

WithObject sets transferred object.

type RemoteSender

type RemoteSender struct {
	// contains filtered or unexported fields
}

RemoteSender represents utility for sending an object to a remote host.

func NewRemoteSender

func NewRemoteSender(keyStorage *util.KeyStorage, cons ClientConstructor) *RemoteSender

NewRemoteSender creates, initializes and returns new RemoteSender instance.

func (*RemoteSender) PutObject

func (s *RemoteSender) PutObject(ctx context.Context, p *RemotePutPrm) error

PutObject sends object to remote node.

type Traversal

type Traversal struct {
	Opts []placement.Option

	// need of additional broadcast after the object is saved
	ExtraBroadcastEnabled bool

	// container nodes which was processed during the primary object placement
	Exclude map[string]*bool

	ResetSuccessAfterOnBroadcast bool
}

parameters and state of container Traversal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL