txthrottler

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const TxThrottlerName = "TransactionThrottler"

TxThrottlerName is the name the wrapped go/vt/throttler object will be registered with go/vt/throttler.GlobalManager.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThrottlerInterface

type ThrottlerInterface interface {
	Throttle(threadID int) time.Duration
	ThreadFinished(threadID int)
	Close()
	MaxRate() int64
	SetMaxRate(rate int64)
	RecordReplicationLag(time time.Time, th *discovery.TabletHealth)
	GetConfiguration() *throttlerdatapb.Configuration
	UpdateConfiguration(configuration *throttlerdatapb.Configuration, copyZeroValues bool) error
	ResetConfiguration()
	MaxLag(tabletType topodatapb.TabletType) uint32
}

ThrottlerInterface defines the public interface that is implemented by go/vt/throttler.Throttler It is only used here to allow mocking out a throttler object.

type TxThrottler

type TxThrottler interface {
	InitDBConfig(target *querypb.Target)
	Open() (err error)
	Close()
	Throttle(priority int, workload string) (result bool)
}

TxThrottler defines the interface for the transaction throttler.

func NewTxThrottler

func NewTxThrottler(env tabletenv.Env, topoServer *topo.Server) TxThrottler

NewTxThrottler tries to construct a txThrottler from the relevant fields in the tabletenv.Env and topo.Server objects.

Jump to

Keyboard shortcuts

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