context

package
v1.1.0-beta.0...-e2f85cd Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistSQLContext

type DistSQLContext struct {
	WarnHandler contextutil.WarnAppender

	InRestrictedSQL bool
	Client          kv.Client

	EnabledRateLimitAction bool
	EnableChunkRPC         bool
	OriginalSQL            string
	KVVars                 *tikvstore.Variables
	KvExecCounter          *stmtstats.KvExecCounter
	SessionMemTracker      *memory.Tracker

	Location         *time.Location
	RuntimeStatsColl *execdetails.RuntimeStatsColl
	SQLKiller        *sqlkiller.SQLKiller
	CPUUsage         *ppcpuusage.SQLCPUUsages
	ErrCtx           errctx.Context

	// TiFlash related configurations
	TiFlashReplicaRead                   tiflash.ReplicaRead
	TiFlashMaxThreads                    int64
	TiFlashMaxBytesBeforeExternalJoin    int64
	TiFlashMaxBytesBeforeExternalGroupBy int64
	TiFlashMaxBytesBeforeExternalSort    int64
	TiFlashMaxQueryMemoryPerNode         int64
	TiFlashQuerySpillRatio               float64
	TiFlashHashJoinVersion               string

	QueryCopStoreLimiter          *kv.QueryCopStoreLimiter
	DistSQLConcurrency            int
	ReplicaReadType               kv.ReplicaReadType
	WeakConsistency               bool
	RCCheckTS                     bool
	NotFillCache                  bool
	TaskID                        uint64
	Priority                      mysql.PriorityEnum
	ResourceGroupTagger           *kv.ResourceGroupTagBuilder
	EnablePaging                  bool
	MinPagingSize                 int
	MaxPagingSize                 int
	PagingSizeBytes               int
	RequestSourceType             string
	ExplicitRequestSourceType     string
	StoreBatchSize                int
	ResourceGroupName             string
	LoadBasedReplicaReadThreshold time.Duration
	RunawayChecker                resourcegroup.RunawayChecker
	RUConsumptionReporter         resourcegroup.ConsumptionReporter
	TiKVClientReadTimeout         uint64
	MaxExecutionTime              uint64
	MaxKeysRead                   uint64
	// MaxKeysReadCounter, when non-nil, is the shared atomic accumulator used by
	// copIterator to enforce a statement-wide max_keys_read budget across all
	// coprocessor iterators belonging to the same statement. nil when MaxKeysRead == 0.
	MaxKeysReadCounter *atomic.Uint64

	ReplicaClosestReadThreshold int64
	ConnectionID                uint64
	SessionAlias                string

	ExecDetails *execdetails.SyncExecDetails

	// Only one cop-reader can use lite worker at the same time. Using lite-worker in multiple readers will affect the concurrent execution of readers.
	TryCopLiteWorker atomic.Uint32
}

DistSQLContext provides all information needed by using functions in `distsql`

func (*DistSQLContext) AppendWarning

func (dctx *DistSQLContext) AppendWarning(warn error)

AppendWarning appends the warning to the warning handler.

func (*DistSQLContext) Detach

func (dctx *DistSQLContext) Detach() *DistSQLContext

Detach detaches this context from the session context.

NOTE: Though this session context can be used parallelly with this context after calling it, the `StatementContext` cannot. The session context should create a new `StatementContext` before executing another statement.

Jump to

Keyboard shortcuts

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