gcworker

package
v7.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunDistributedGCJob

func RunDistributedGCJob(ctx context.Context, s tikv.Storage, pd pd.Client, safePoint uint64, identifier string, concurrency int) error

RunDistributedGCJob notifies TiKVs to do GC. It is exported for kv api, do not use it with GCWorker at the same time. This function may not finish immediately because it may take some time to do resolveLocks. Param concurrency specifies the concurrency of resolveLocks phase.

func RunGCJob

func RunGCJob(ctx context.Context, s tikv.Storage, pd pd.Client, safePoint uint64, identifier string, concurrency int) error

RunGCJob sends GC command to KV. It is exported for kv api, do not use it with GCWorker at the same time.

func RunResolveLocks

func RunResolveLocks(ctx context.Context, s tikv.Storage, pd pd.Client, safePoint uint64, identifier string, concurrency int, usePhysical bool) (bool, error)

RunResolveLocks resolves all locks before the safePoint and returns whether the physical scan mode is used. It is exported only for test, do not use it in the production environment.

Types

type GCWorker

type GCWorker struct {
	// contains filtered or unexported fields
}

GCWorker periodically triggers GC process on tikv server.

func NewGCWorker

func NewGCWorker(store kv.Storage, pdClient pd.Client) (*GCWorker, error)

NewGCWorker creates a GCWorker instance.

func (*GCWorker) Close

func (w *GCWorker) Close()

Close stops background goroutines.

func (*GCWorker) GetScope

func (w *GCWorker) GetScope(status string) variable.ScopeFlag

GetScope gets the status variables scope.

func (*GCWorker) Start

func (w *GCWorker) Start()

Start starts the worker.

func (*GCWorker) Stats

func (w *GCWorker) Stats(vars *variable.SessionVars) (map[string]interface{}, error)

Stats returns the server statistics.

type MockGCWorker

type MockGCWorker struct {
	// contains filtered or unexported fields
}

MockGCWorker is for test.

func NewMockGCWorker

func NewMockGCWorker(store kv.Storage) (*MockGCWorker, error)

NewMockGCWorker creates a MockGCWorker instance ONLY for test.

func (*MockGCWorker) DeleteRanges

func (w *MockGCWorker) DeleteRanges(ctx context.Context, safePoint uint64) error

DeleteRanges calls deleteRanges internally, just for test.

Jump to

Keyboard shortcuts

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