txthrottler

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 18 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()
}

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 TopologyWatcherInterface

type TopologyWatcherInterface interface {
	Start()
	Stop()
}

TopologyWatcherInterface defines the public interface that is implemented by discovery.LegacyTopologyWatcher. It is only used here to allow mocking out go/vt/discovery.LegacyTopologyWatcher.

type TxThrottler

type TxThrottler interface {
	InitDBConfig(target *querypb.Target)
	Open() (err error)
	Close()
	Throttle(priority int) (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.Config object. It returns a disabled TxThrottler if any error occurs. This function calls tryCreateTxThrottler that does the actual creation work and returns an error if one occurred.

Jump to

Keyboard shortcuts

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