domain

package
v0.0.0-...-d224df5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResultSucc means schemaValidator's check is passing.
	ResultSucc checkResult = iota
	// ResultFail means schemaValidator's check is fail.
	ResultFail
	// ResultUnknown means schemaValidator doesn't know the check would be success or fail.
	ResultUnknown
)

Variables

View Source
var (
	// ErrInfoSchemaExpired returns the error that information schema is out of date.
	ErrInfoSchemaExpired = terror.ClassDomain.New(codeInfoSchemaExpired, "Information schema is out of date.")
	// ErrInfoSchemaChanged returns the error that information schema is changed.
	ErrInfoSchemaChanged = terror.ClassDomain.New(codeInfoSchemaChanged, "Information schema is changed.")
)

Functions

This section is empty.

Types

type Domain

type Domain struct {
}

Domain represents a storage space. Different domains can use the same database name. Multiple domains can be used in parallel without synchronization.

type EtcdBackend

type EtcdBackend interface {
	EtcdAddrs() []string
	StartGCWorker() error
}

EtcdBackend is used for judging a storage is a real TiKV.

type MockFailure

type MockFailure struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MockFailure mocks reload failed. It's used for fixing data race in tests.

func (*MockFailure) SetValue

func (m *MockFailure) SetValue(isFailed bool)

SetValue sets whether we need to mock reload failed.

type SchemaValidator

type SchemaValidator interface {
	// Update the schema validator, add a new item, delete the expired deltaSchemaInfos.
	// The latest schemaVer is valid within leaseGrantTime plus lease duration.
	// Add the changed table IDs to the new schema information,
	// which is produced when the oldSchemaVer is updated to the newSchemaVer.
	Update(leaseGrantTime uint64, oldSchemaVer, newSchemaVer int64, changedTableIDs []int64)
	// Check is it valid for a transaction to use schemaVer and related tables, at timestamp txnTS.
	Check(txnTS uint64, schemaVer int64, relatedTableIDs []int64) checkResult
	// Stop stops checking the valid of transaction.
	Stop()
	// Restart restarts the schema validator after it is stopped.
	Restart()
	// Reset resets SchemaValidator to initial state.
	Reset()
}

SchemaValidator is the interface for checking the validity of schema version.

func NewSchemaValidator

func NewSchemaValidator(lease time.Duration) SchemaValidator

NewSchemaValidator returns a SchemaValidator structure.

Jump to

Keyboard shortcuts

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