txnkv

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 39

Documentation

Index

Constants

View Source
const (
	SI        = txnsnapshot.SI
	RC        = txnsnapshot.RC
	RCCheckTS = txnsnapshot.RCCheckTS
)

IsoLevel value for transaction priority.

View Source
const (
	PriorityHigh   = txnutil.PriorityHigh
	PriorityNormal = txnutil.PriorityNormal
	PriorityLow    = txnutil.PriorityLow
)

Priority value for transaction priority.

View Source
const MaxTxnTimeUse = transaction.MaxTxnTimeUse

MaxTxnTimeUse is the max time a Txn may use (in ms) from its begin to commit. We use it to abort the transaction to guarantee GC worker will not influence it.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinlogWriteResult

type BinlogWriteResult = transaction.BinlogWriteResult

BinlogWriteResult defines the result of prewrite binlog.

type Client

type Client struct {
	*tikv.KVStore
}

Client is a txn client.

func NewClient

func NewClient(pdAddrs []string, opts ...ClientOpt) (*Client, error)

NewClient creates a txn client with pdAddrs.

func (*Client) GetTimestamp

func (c *Client) GetTimestamp(ctx context.Context) (uint64, error)

GetTimestamp returns the current global timestamp.

type ClientOpt added in v2.0.5

type ClientOpt func(*option)

ClientOpt is factory to set the client options.

func WithAPIVersion added in v2.0.5

func WithAPIVersion(apiVersion kvrpcpb.APIVersion) ClientOpt

WithAPIVersion is used to set client's apiVersion.

func WithKeyspace added in v2.0.5

func WithKeyspace(keyspaceName string) ClientOpt

WithKeyspace is used to set client's keyspace.

type IsoLevel

type IsoLevel = txnsnapshot.IsoLevel

IsoLevel is the transaction's isolation level.

type KVFilter

type KVFilter = transaction.KVFilter

KVFilter is a filter that filters out unnecessary KV pairs.

type KVSnapshot

type KVSnapshot = txnsnapshot.KVSnapshot

KVSnapshot implements the tidbkv.Snapshot interface.

type KVTxn

type KVTxn = transaction.KVTxn

KVTxn contains methods to interact with a TiKV transaction.

type Lock

type Lock = txnlock.Lock

Lock represents a lock from tikv server.

func NewLock

func NewLock(l *kvrpcpb.LockInfo) *Lock

NewLock creates a new *Lock.

type LockResolver

type LockResolver = txnlock.LockResolver

LockResolver resolves locks and also caches resolved txn status.

type Priority

type Priority = txnutil.Priority

Priority is the priority for tikv to execute a command.

type ReplicaReadAdjuster added in v2.0.2

type ReplicaReadAdjuster = txnsnapshot.ReplicaReadAdjuster

ReplicaReadAdjuster is a function that adjust the StoreSelectorOption and ReplicaReadType based on the keys count for BatchPointGet and PointGet

type Scanner

type Scanner = txnsnapshot.Scanner

Scanner support tikv scan

type SchemaLeaseChecker

type SchemaLeaseChecker = transaction.SchemaLeaseChecker

SchemaLeaseChecker is used to validate schema version is not changed during transaction execution.

type SchemaVer

type SchemaVer = transaction.SchemaVer

SchemaVer is the infoSchema which will return the schema version.

type SnapshotRuntimeStats

type SnapshotRuntimeStats = txnsnapshot.SnapshotRuntimeStats

SnapshotRuntimeStats records the runtime stats of snapshot.

type TxnStatus

type TxnStatus = txnlock.TxnStatus

TxnStatus represents a txn's final status. It should be Lock or Commit or Rollback.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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