mpather

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package mpather provides per-mountpath concepts.

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Package mpather provides per-mountpath concepts.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	ThrottleMinDur = time.Millisecond
	ThrottleAvgDur = time.Millisecond * 10
	ThrottleMaxDur = time.Millisecond * 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Jgroup

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

Jgroup runs jogger per mountpath which walk the entire bucket and call callback on each of the encountered object. When jogger encounters error it stops and informs other joggers about the error (so they stop too).

func NewJoggerGroup

func NewJoggerGroup(opts *JgroupOpts, selectedMpaths ...string) *Jgroup

func (*Jgroup) ListenFinished

func (jg *Jgroup) ListenFinished() <-chan struct{}

func (*Jgroup) Num

func (jg *Jgroup) Num() int

func (*Jgroup) Run

func (jg *Jgroup) Run()

func (*Jgroup) Stop

func (jg *Jgroup) Stop() error

type JgroupOpts

type JgroupOpts struct {
	T cluster.Target

	VisitObj              func(lom *cluster.LOM, buf []byte) error
	VisitCT               func(ct *cluster.CT, buf []byte) error
	Slab                  *memsys.Slab
	Bck                   cmn.Bck
	Prefix                string
	CTs                   []string
	DoLoad                LoadType // if specified, lom.Load(lock type)
	Parallel              int      // num parallel calls
	IncludeCopy           bool     // visit copies (aka replicas)
	SkipGloballyMisplaced bool     // skip globally misplaced
	Throttle              bool     // true: pace itself depending on disk utilization
	// contains filtered or unexported fields
}

type LoadType

type LoadType int
const (
	Load LoadType
	LoadRLock
	LoadLock
)

type WorkerGroup

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

WorkerGroup starts one worker per mountpath; each worker receives (*cluster.LOM) tasks and executes the specified callback.

func NewWorkerGroup

func NewWorkerGroup(opts *WorkerGroupOpts) *WorkerGroup

func (*WorkerGroup) Do

func (wg *WorkerGroup) Do(lom *cluster.LOM) bool

func (*WorkerGroup) Run

func (wg *WorkerGroup) Run()

func (*WorkerGroup) Stop

func (wg *WorkerGroup) Stop() (n int)

Stop aborts all the workers. It should be called after we are sure no more new tasks will be dispatched.

type WorkerGroupOpts

type WorkerGroupOpts struct {
	Callback  func(lom *cluster.LOM, buf []byte)
	Slab      *memsys.Slab
	QueueSize int
}

Jump to

Keyboard shortcuts

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