rez

package
v4.15.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

README

Load shedding resource manager

You are likely here because you saw an error message like

[426] The cluster is underprovisioned and is shedding load. You drew the short straw. Sorry.

The correct response to this message is to retry your request using an exponential backoff time, and report to your BTrDB cluster administrator that they need to provision more resources.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultResourceTunables

func DefaultResourceTunables() [][]string

func NopDel

func NopDel(v interface{})

func NopNew

func NopNew() interface{}

Types

type Resource

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

func (*Resource) Release

func (r *Resource) Release()

func (*Resource) Val

func (r *Resource) Val() interface{}

type ResourceIdentifier

type ResourceIdentifier string
const CephColdHandle ResourceIdentifier = "ceph_cold"
const CephHotHandle ResourceIdentifier = "ceph_hot"
const ConcurrentOp ResourceIdentifier = "concurrent_op"
const MaximumConnections ResourceIdentifier = "max_conns"
const OpenReadTrees ResourceIdentifier = "open_read_trees"
const OpenTrees ResourceIdentifier = "open_trees"

type RezManager

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

func NewResourceManager

func NewResourceManager(cfg TunableProvider) *RezManager

func (*RezManager) CreateResourcePool

func (rez *RezManager) CreateResourcePool(id ResourceIdentifier,
	newfunc func() interface{},
	delfunc func(v interface{}))

func (*RezManager) Get

func (*RezManager) MustGet

func (rez *RezManager) MustGet(ctx context.Context, id ResourceIdentifier) *Resource

type TunableProvider

type TunableProvider interface {
	// Get a tunable, and watch it for all future changes. Only meant to be
	// used by Rez
	WatchTunable(name string, onchange func(v string)) error
}

Jump to

Keyboard shortcuts

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