range_partition

package
v0.0.0-...-6aa601a Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1024
	MB = KB * 1024
)

Variables

View Source
var (
	ErrBlockedWrites = errors.New("Writes are blocked, possibly due to DropAll or Close")
)

Functions

func NewDiscardManager

func NewDiscardManager(si map[uint64]pb.StreamInfo) *discardManager

Types

type OpenStreamFunc

type OpenStreamFunc func(si pb.StreamInfo) streamclient.StreamClient

type Option

type Option struct {
	MaxSkipList     int64 //max size of skiplist, when compacting, the max is 2 * MaxSkipList
	WriteChCapacity int   //write channel length
	MustSync        bool
}

type OptionFunc

type OptionFunc func(*Option)

func DefaultOption

func DefaultOption() OptionFunc

func TestOption

func TestOption() OptionFunc

func WithMaxSkipList

func WithMaxSkipList(n int64) OptionFunc

func WithSync

func WithSync(b bool) OptionFunc

func WriteChCapacity

func WriteChCapacity(n int) OptionFunc

type RangePartition

type RangePartition struct {
	utils.SafeMutex //protect mt,imm when swapping mt, imm

	PartID   uint64
	StartKey []byte
	EndKey   []byte
	// contains filtered or unexported fields
}

func OpenRangePartition

func OpenRangePartition(id uint64, rowStream streamclient.StreamClient,
	logStream streamclient.StreamClient, blockReader streamclient.BlockReader,
	startKey []byte, endKey []byte, tableLocs []*pspb.Location, blobStreams []uint64,
	setlocs SetRowStreamTableFunc,
	openStream OpenStreamFunc, opts ...OptionFunc,
) (*RangePartition, error)

func (*RangePartition) CanSplit

func (rp *RangePartition) CanSplit() bool

split相关, 提供相关参数给上层 ADD more policy here, to support different Split policy

func (*RangePartition) Close

func (rp *RangePartition) Close() error

func (*RangePartition) Connect

func (rp *RangePartition) Connect() error

read metaStream, connect commitlog, rowDataStreamand blobDataStream

func (*RangePartition) Delete

func (rp *RangePartition) Delete(key []byte) error

func (*RangePartition) Get

func (rp *RangePartition) Get(userKey []byte, version uint64) ([]byte, error)

func (*RangePartition) GetSplitPoint

func (rp *RangePartition) GetSplitPoint() []byte

split相关, 提供相关参数给上层 ADD more policy here, to support different Split policy

func (*RangePartition) IsUserKeyInRange

func (rp *RangePartition) IsUserKeyInRange(userKey []byte) bool

func (*RangePartition) LogRowStreamEnd

func (rp *RangePartition) LogRowStreamEnd() (uint32, uint32)

func (*RangePartition) Range

func (rp *RangePartition) Range(prefix []byte, start []byte, limit uint32) [][]byte

func (*RangePartition) Write

func (rp *RangePartition) Write(key, value []byte) error

req.Wait will free the request

func (*RangePartition) WriteAsync

func (rp *RangePartition) WriteAsync(key, value []byte, f func(error))

type SetRowStreamTableFunc

type SetRowStreamTableFunc func(id uint64, tables []*pspb.Location) error

Directories

Path Synopsis
y

Jump to

Keyboard shortcuts

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