kvcc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const OCCVerboseLevel = 160
View Source
const TimestampCacheVerboseLevel = 260

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(serverAddr string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string, opt types.KVCCReadOption) (types.ValueCC, error)

func (*Client) RemoveTxnRecord

func (c *Client) RemoveTxnRecord(ctx context.Context, version uint64, opt types.KVCCRemoveTxnRecordOption) error

func (*Client) RollbackKey

func (c *Client) RollbackKey(ctx context.Context, key string, version uint64, opt types.KVCCRollbackKeyOption) error

func (*Client) Set

func (c *Client) Set(ctx context.Context, key string, val types.Value, opt types.KVCCWriteOption) error

func (*Client) UpdateMeta

func (c *Client) UpdateMeta(ctx context.Context, key string, version uint64, opt types.KVCCUpdateMetaOption) error

type KVCC

type KVCC struct {
	types.TabletTxnConfig
	// contains filtered or unexported fields
}

KV with concurrency control

func NewKVCC

func NewKVCC(db types.KV, cfg types.TabletTxnConfig) *KVCC

func NewKVCCForTesting

func NewKVCCForTesting(db types.KV, cfg types.TabletTxnConfig) *KVCC

func (*KVCC) Close

func (kv *KVCC) Close() error

func (*KVCC) Get

func (kv *KVCC) Get(ctx context.Context, key string, opt types.KVCCReadOption) (types.ValueCC, error)

func (*KVCC) RemoveTxnRecord

func (kv *KVCC) RemoveTxnRecord(ctx context.Context, version uint64, opt types.KVCCRemoveTxnRecordOption) error

func (*KVCC) RollbackKey

func (kv *KVCC) RollbackKey(ctx context.Context, key string, version uint64, opt types.KVCCRollbackKeyOption) (err error)

func (*KVCC) Set

func (kv *KVCC) Set(ctx context.Context, key string, val types.Value, opt types.KVCCWriteOption) error

Set must be non-blocking in current io framework.

func (*KVCC) UpdateMeta

func (kv *KVCC) UpdateMeta(ctx context.Context, key string, version uint64, opt types.KVCCUpdateMetaOption) (err error)

type KeyInfo

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

func NewKeyInfo

func NewKeyInfo(key string) *KeyInfo

func (*KeyInfo) GetMaxReaderVersion

func (i *KeyInfo) GetMaxReaderVersion() uint64

func (*KeyInfo) RemoveVersion

func (i *KeyInfo) RemoveVersion(version uint64)

func (*KeyInfo) TryLock

func (i *KeyInfo) TryLock(dbMeta types.DBMeta, txn *transaction.Transaction) (writer *transaction.Writer, err error)

type Server

type Server struct {
	Port int

	Done chan struct{}
	// contains filtered or unexported fields
}

func NewServer

func NewServer(port int, db types.KV, cfg types.TabletTxnConfig, gid int, store *topo.Store) *Server

readOnly indicate this is outer service

func NewServerForTesting

func NewServerForTesting(port int, db types.KV, cfg types.TabletTxnConfig, gid int, store *topo.Store) *Server

func (*Server) Close

func (s *Server) Close() (err error)

func (*Server) Start

func (s *Server) Start() error

type Stub

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

func (*Stub) Get

func (*Stub) RollbackKey

func (*Stub) Set

func (*Stub) UpdateMeta

type TimestampCache

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

func NewTimestampCache

func NewTimestampCache() *TimestampCache

func (*TimestampCache) FindWriters

func (cache *TimestampCache) FindWriters(key string, opt *types.KVCCReadOption) (w *transaction.Writer, writingWritersBefore transaction.WritingWriters, maxReadVersion uint64, err error)

func (*TimestampCache) GetMaxReaderVersion

func (cache *TimestampCache) GetMaxReaderVersion(key string) uint64

func (*TimestampCache) RemoveVersion

func (cache *TimestampCache) RemoveVersion(key string, writerVersion uint64)

func (*TimestampCache) TryLock

func (cache *TimestampCache) TryLock(key string, meta types.DBMeta, txn *transaction.Transaction) (writer *transaction.Writer, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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