objectstore

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowDraining

func AllowDraining(config controller.Config, isBootstrapController bool) bool

AllowDraining returns true if the worker should allow draining. This currently is only true for the bootstrap controller.

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs the trace worker.

func NewWorker

func NewWorker(cfg WorkerConfig) (*objectStoreWorker, error)

NewWorker creates a new object store worker.

Types

type ControllerConfigService

type ControllerConfigService interface {
	// ControllerConfig returns the current controller configuration.
	ControllerConfig(context.Context) (controller.Config, error)
}

ControllerConfigService is the interface that the worker uses to get the controller configuration.

func GetControllerConfigService

func GetControllerConfigService(getter dependency.Getter, name string) (ControllerConfigService, error)

GetControllerConfigService is a helper function that gets a service from the manifold.

type GetControllerConfigServiceFunc

type GetControllerConfigServiceFunc func(getter dependency.Getter, name string) (ControllerConfigService, error)

GetControllerConfigServiceFunc is a helper function that gets a service from the manifold.

type GetMetadataServiceFunc

type GetMetadataServiceFunc func(getter dependency.Getter, name string) (MetadataService, error)

GetMetadataServiceFunc is a helper function that gets a service from the manifold.

type IsBootstrapControllerFunc

type IsBootstrapControllerFunc func(dataDir string) bool

IsBootstrapControllerFunc is a helper function that checks if the controller is the initial bootstrap controller.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName               string
	TraceName               string
	ObjectStoreServicesName string
	LeaseManagerName        string
	S3ClientName            string

	Clock                      clock.Clock
	Logger                     logger.Logger
	NewObjectStoreWorker       objectstore.ObjectStoreWorkerFunc
	GetControllerConfigService GetControllerConfigServiceFunc
	GetMetadataService         GetMetadataServiceFunc
	IsBootstrapController      IsBootstrapControllerFunc
}

ManifoldConfig defines the configuration for the objectstore manifold.

func (ManifoldConfig) Validate

func (cfg ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type MetadataService

type MetadataService interface {
	ObjectStore() coreobjectstore.ObjectStoreMetadata
}

MetadataService is the interface that is used to get a object store.

func GetMetadataService

func GetMetadataService(getter dependency.Getter, name string) (MetadataService, error)

GetMetadataService is a helper function that gets a service from the manifold.

type MetadataServiceGetter

type MetadataServiceGetter interface {
	// For returns the MetadataService for the given model UUID.
	ForModelUUID(model.UUID) MetadataService
}

MetadataServiceGetter is the interface that is used to get the MetadataService for a given model UUID.

type ModelClaimGetter

type ModelClaimGetter interface {
	ForModelUUID(model.UUID) (objectstore.Claimer, error)
}

ModelClaimGetter is the interface that is used to get a model claimer.

type TrackedObjectStore

type TrackedObjectStore interface {
	worker.Worker
	coreobjectstore.ObjectStore
}

TrackedObjectStore is a ObjectStore that is also a worker, to ensure the lifecycle of the objectStore is managed.

type WorkerConfig

type WorkerConfig struct {
	TracerGetter               trace.TracerGetter
	RootDir                    string
	RootBucket                 string
	Clock                      clock.Clock
	Logger                     logger.Logger
	S3Client                   coreobjectstore.Client
	NewObjectStoreWorker       internalobjectstore.ObjectStoreWorkerFunc
	ObjectStoreType            coreobjectstore.BackendType
	ControllerMetadataService  MetadataService
	ModelMetadataServiceGetter MetadataServiceGetter
	ModelClaimGetter           ModelClaimGetter
	AllowDraining              bool
}

WorkerConfig encapsulates the configuration options for the objectStore worker.

func (*WorkerConfig) Validate

func (c *WorkerConfig) Validate() error

Validate ensures that the config values are valid.

Jump to

Keyboard shortcuts

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