storage

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "infra"
	Subsystem = "lmstfy_v2_storage"
)

Variables

This section is empty.

Functions

func Init

func Init(cfg *config.Config) (err error)

Types

type Manager

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

func Get

func Get() *Manager

func NewManger

func NewManger(cfg *config.Config) (*Manager, error)

func (*Manager) AddJob

func (m *Manager) AddJob(ctx context.Context, poolName string, job engine.Job) error

func (*Manager) AddPool

func (m *Manager) AddPool(name string, pool engine.Engine, threshold int64)

func (*Manager) GetJobByID

func (m *Manager) GetJobByID(ctx context.Context, ID string) ([]engine.Job, error)

func (*Manager) PumpFn

func (m *Manager) PumpFn(name string, pool engine.Engine, threshold int64) func() bool

func (*Manager) Shutdown

func (m *Manager) Shutdown()

type Metrics

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

Metrics contains storage related metrics

type Persistence

type Persistence interface {
	// BatchAddJobs write jobs data into secondary storage
	BatchAddJobs(ctx context.Context, poolName string, jobs []engine.Job) (err error)
	// GetQueueSize returns the size of data in storage which are due before certain due time
	GetQueueSize(ctx context.Context, req []*model.DBJobReq) (count map[string]int64, err error)
	// DelJobs remove job data from storage based on job id
	DelJobs(ctx context.Context, jobIDs []string) (count int64, err error)
	// GetReadyJobs return jobs which are ready based on input ready time from data storage
	GetReadyJobs(ctx context.Context, req *model.DBJobReq) (jobs []engine.Job, err error)
	// BatchGetJobsByID returns job data by job ID
	BatchGetJobsByID(ctx context.Context, IDs []string) (jobs []engine.Job, err error)
	Close()
}

Persistence handles requests related to secondary storage

Directories

Path Synopsis
persistence

Jump to

Keyboard shortcuts

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