rawkv

package
v1.1.0-beta.0...-b4c719a Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVPair

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

type RawKVBatchClient

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

RawKVBatchClient is used to put raw kv-entry into tikv. Note: it is not thread safe.

func NewRawKVBatchClient

func NewRawKVBatchClient(
	rawkvClient RawkvClient,
	batchCount int,
) *RawKVBatchClient

NewRawKVBatchClient create a batch rawkv client.

func (*RawKVBatchClient) Close

func (c *RawKVBatchClient) Close()

Close closes the RawKVBatchClient.

func (*RawKVBatchClient) Put

func (c *RawKVBatchClient) Put(ctx context.Context, key, value []byte, originTs uint64) error

Put puts (key, value) into buffer justly, wait for batch write if the buffer is full.

func (*RawKVBatchClient) PutRest

func (c *RawKVBatchClient) PutRest(ctx context.Context) error

PutRest writes the rest pairs (key, values) into tikv.

func (*RawKVBatchClient) SetColumnFamily

func (c *RawKVBatchClient) SetColumnFamily(columnFamily string)

SetColumnFamily set the columnFamily for the client.

type RawkvClient

type RawkvClient interface {
	Get(ctx context.Context, key []byte, options ...rawkv.RawOption) ([]byte, error)
	Put(ctx context.Context, key, value []byte, options ...rawkv.RawOption) error
	BatchGet(ctx context.Context, keys [][]byte, options ...rawkv.RawOption) ([][]byte, error)
	BatchPut(ctx context.Context, keys, values [][]byte, options ...rawkv.RawOption) error
	Close() error
}

RawkvClient is the interface for rawkv.client

func NewRawkvClient

func NewRawkvClient(ctx context.Context, pdAddrs []string, security config.Security) (RawkvClient, error)

NewRawkvClient create a rawkv client.

Jump to

Keyboard shortcuts

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