manager

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RefreshSPInfoAndStorageParamsTimer define the period of refresh sp info and storage params
	RefreshSPInfoAndStorageParamsTimer = 5 * 60
)

Functions

This section is empty.

Types

type GCWorker added in v0.2.0

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

GCWorker is responsible for releasing the space occupied by the deleted object in the piece-store. TODO: Will be refactored into task-node in the future.

func (*GCWorker) Start added in v0.2.0

func (w *GCWorker) Start()

Start is a non-blocking function that starts a goroutine execution logic internally.

func (*GCWorker) Stop added in v0.2.0

func (w *GCWorker) Stop()

Stop is responsible for stop gc.

type Manager

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

Manager module is responsible for implementing internal management functions. Currently, it supports periodic update of sp info list and storage params information in sp-db. TODO: support gc and configuration management, etc.

func NewManagerService

func NewManagerService(cfg *ManagerConfig) (*Manager, error)

NewManagerService returns an instance of manager

func (*Manager) Name

func (m *Manager) Name() string

Name return the manager service name

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start function start background goroutine to execute refresh sp meta

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop manager background goroutine

type ManagerConfig

type ManagerConfig struct {
	SpOperatorAddress   string
	ChainConfig         *gnfd.GreenfieldChainConfig
	SpDBConfig          *config.SQLDBConfig
	MetadataGrpcAddress string
	PieceStoreConfig    *storage.PieceStoreConfig
}

ManagerConfig defines manager service config

Jump to

Keyboard shortcuts

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