tikv

package
v0.0.0-...-360e525 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLruSize = 100000

Variables

This section is empty.

Functions

func NewLru

func NewLru(lruCache *lru.TwoQueueCache, address string, peers []string) chan<- Notice

func NewLruClient

func NewLruClient(address string) chan<- Notice

Types

type KvData

type KvData struct {
	Key []byte
	Val []byte
}

type KvScanData

type KvScanData struct {
	Keys   [][]byte
	Values [][]byte
}

type Lru

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

func (*Lru) Remove

func (s *Lru) Remove(ctx context.Context, in *pb.Key) (*pb.Response, error)

func (*Lru) RemoveBatch

func (s *Lru) RemoveBatch(ctx context.Context, in *pb.Keys) (*pb.Response, error)

type LruClient

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

type Notice

type Notice struct {
	Type NoticeType
	Data interface{}
}

type NoticeType

type NoticeType uint
const (
	None NoticeType = iota
	RemoveKey
	BatchRemoveKey
)

type Tikv

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

Bolt bolt store struct

func OpenTikv

func OpenTikv(addr string, listen string, peers string, lruSize ...int) (*Tikv, error)

OpenBolt open Bolt store

func (*Tikv) BatchDelete

func (s *Tikv) BatchDelete(keys [][]byte)

func (*Tikv) BatchPut

func (s *Tikv) BatchPut(data map[string][]byte, reTokens ...string)

func (*Tikv) Close

func (s *Tikv) Close() error

Close releases all database resources. All transactions must be closed before closing the database.

func (*Tikv) Delete

func (s *Tikv) Delete(k []byte) error

Delete deletes a key. Exposing this so that user does not have to specify the Entry directly.

func (*Tikv) Get

func (s *Tikv) Get(k []byte) (b []byte, err error)

Get executes a function within the context of a managed read-only transaction. Any error that is returned from the function is returned from the View() method.

func (*Tikv) Has

func (s *Tikv) Has(k []byte) (bool, error)

Has returns true if the DB does contains the given key.

func (*Tikv) PreLike

func (s *Tikv) PreLike(key []byte) (keys [][]byte, values [][]byte, err error)

左匹配,开区间

func (*Tikv) Set

func (s *Tikv) Set(k []byte, v []byte) error

Set executes a function within the context of a read-write managed transaction. If no error is returned from the function then the transaction is committed. If an error is returned then the entire transaction is rolled back. Any error that is returned from the function or returned from the commit is returned from the Update() method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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