tikv

package
v0.10.3-0...-ffc12fb Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// We are using a Snapshot instead of transaction when doing read only operations due to the
	// lower overhead (50% less overhead in small tests). In order to guarantee the latest values are
	// grabbed at call, we can set the TS to be the max uint64.
	MaxSnapshotTS = uint64(math.MaxUint64)
	// Whether to enable transaction rollback if a transaction fails. Due to TiKV transactions being
	// optimistic by default, a rollback does not need to be done and the transaction can just be
	// discarded. Discarding saw a small bump in performance on small scale tests.
	EnableRollback = false
	// This empty value is what we are reserving within TiKv to represent an empty string value.
	// TiKV does not allow storing empty values for keys which is something we do in Milvus, so
	// to get over this we are using the reserved keyword as placeholder.
	EmptyValueString = "__milvus_reserved_empty_tikv_value_DO_NOT_USE"
)

Variables

View Source
var EmptyValueByte = []byte(EmptyValueString)
View Source
var SnapshotScanSize int

For reads by prefix we can customize the scan size to increase/decrease rpc calls.

Functions

func CheckElapseAndWarn

func CheckElapseAndWarn(start time.Time, message string, fields ...zap.Field) bool

CheckElapseAndWarn checks the elapsed time and warns if it is too long.

func NewTiKV

func NewTiKV(txn *txnkv.Client, rootPath string, options ...Option) *txnTiKV

NewTiKV creates a new txnTiKV client.

Types

type Option

type Option func(*tikvOpt)

func WithRequestTimeout

func WithRequestTimeout(timeout time.Duration) Option

Jump to

Keyboard shortcuts

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