scheduler

package
v0.0.0-...-b800767 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBlobStoreAvailable = errors.New("no blob store available")
)

Functions

This section is empty.

Types

type BlobStore

type BlobStore struct {
	ID uint64

	Size      int64
	Remaining int64

	Host string
	Rack string
	Az   string
}

type BlobStoreHeap

type BlobStoreHeap []*BlobStore

func (*BlobStoreHeap) Len

func (b *BlobStoreHeap) Len() int

func (*BlobStoreHeap) Less

func (b *BlobStoreHeap) Less(i, j int) bool

func (*BlobStoreHeap) Pop

func (b *BlobStoreHeap) Pop() any

func (*BlobStoreHeap) Push

func (b *BlobStoreHeap) Push(x any)

func (*BlobStoreHeap) Swap

func (b *BlobStoreHeap) Swap(i, j int)

type Handler

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

func NewHandler

func NewHandler() *Handler

func (*Handler) AddBlobStore

func (h *Handler) AddBlobStore(in *BlobStore)

func (*Handler) Schedule

func (h *Handler) Schedule(req *Req)

func (*Handler) Start

func (h *Handler) Start()

func (*Handler) Stop

func (h *Handler) Stop()

func (*Handler) UpdateBlobStore

func (h *Handler) UpdateBlobStore(in *BlobStore)

type Req

type Req struct {
	FaultTolerateLevel goproto.FaultTolerateLevel
	BlobCount          int
	BlobSize           int64
	BannedMap          [goproto.FaultTolerateLevel_Az]map[string]struct{}
	RespChannel        chan *Resp
}

func (*Req) BanIt

func (r *Req) BanIt(bsd *BlobStore)

func (*Req) CheckIfBlobStoreBanned

func (r *Req) CheckIfBlobStoreBanned(bsd *BlobStore) bool

type Resp

type Resp struct {
	ResultBSDIDS []uint64
	TimeCostNano int64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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