Documentation ¶
Index ¶
- type Backoffer
- func (b *Backoffer) Backoff(cfg *tikv.BackoffConfig, err error) error
- func (b *Backoffer) BackoffWithMaxSleepTxnLockFast(maxSleepMs int, err error) error
- func (b *Backoffer) GetBackoffSleepMS() map[string]int
- func (b *Backoffer) GetBackoffTimes() map[string]int
- func (b *Backoffer) GetCtx() context.Context
- func (b *Backoffer) GetTotalSleep() int
- func (b *Backoffer) GetVars() *tikv.Variables
- func (b *Backoffer) TiKVBackoffer() *tikv.Backoffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoffer ¶
type Backoffer struct {
// contains filtered or unexported fields
}
Backoffer wraps tikv.Backoffer and converts the error which returns by the functions of tikv.Backoffer to tidb error.
func NewBackoffer ¶
NewBackoffer creates a Backoffer with maximum sleep time(in ms).
func NewBackofferWithTikvBo ¶
NewBackofferWithTikvBo creates a Backoffer with tikv.Backoffer
func NewBackofferWithVars ¶
NewBackofferWithVars creates a Backoffer with maximum sleep time(in ms) and kv.Variables.
func (*Backoffer) Backoff ¶
func (b *Backoffer) Backoff(cfg *tikv.BackoffConfig, err error) error
Backoff sleeps a while base on the BackoffConfig and records the error message. It returns a retryable error if total sleep time exceeds maxSleep.
func (*Backoffer) BackoffWithMaxSleepTxnLockFast ¶
BackoffWithMaxSleepTxnLockFast sleeps a while for the operation TxnLockFast and records the error message and never sleep more than maxSleepMs for each sleep.
func (*Backoffer) GetBackoffSleepMS ¶
GetBackoffSleepMS returns a map contains backoff sleep time by type.
func (*Backoffer) GetBackoffTimes ¶
GetBackoffTimes returns a map contains backoff time count by type.
func (*Backoffer) GetTotalSleep ¶
GetTotalSleep returns total sleep time.
func (*Backoffer) TiKVBackoffer ¶
TiKVBackoffer returns tikv.Backoffer.