Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBdbOptions = &BdbOptions{ Options: &Options{ Logger: base.DefaultLogger, Cmp: base.DefaultComparer.Compare, }, Timeout: 0, NoGrowSync: false, FreelistType: consts.BdbFreelistArrayType, }
View Source
var DefaultBitableOptions = &BitableOptions{ MemTableSize: consts.BitableMemTableSize, MemTableStopWritesThreshold: consts.BitableMemTableStopWritesThreshold, L0FileSize: consts.BitableL0FileSize, CacheSize: consts.BitableCacheSize, L0CompactionFileThreshold: consts.BitableL0CompactionFileThreshold, L0CompactionThreshold: consts.BitableL0CompactionThreshold, L0StopWritesThreshold: consts.BitableL0StopWritesThreshold, LBaseMaxBytes: consts.BitableLBaseMaxBytes, MaxOpenFiles: consts.BitableMaxOpenFiles, }
View Source
var DefaultCheckExpireFunc = func(k, v []byte) bool { return false }
View Source
var DefaultIOWriteLoadThresholdFunc = func() bool { return true }
View Source
var DefaultKeyHashFunc = func(k []byte) int { if len(k) < 2 { return int(k[0]) } return int(binary.BigEndian.Uint16(k[0:2])) }
View Source
var DefaultKeyPrefixDeleteFunc = func(k []byte) uint64 {
return 0
}
View Source
var DefaultKvCheckExpireFunc = func(id int, k, v []byte) bool { return false }
View Source
var DefaultKvTimestampFunc = func(v []byte, t uint8) (bool, uint64) { if t == 2 { return false, uint64(time.Now().UnixMilli()) } return false, 0 }
View Source
var TestKeyHashFunc = func(k []byte) int { return int(binary.BigEndian.Uint16(k[0:2])) }
View Source
var TestKeyPrefixDeleteFunc = func(k []byte) uint64 { if len(k) < 10 { return 0 } return binary.LittleEndian.Uint64(k[2:10]) }
View Source
var TestKvCheckExpireFunc = func(id int, k, v []byte) bool { if len(v) == 0 { return false } else if uint8(v[0]) == 1 { timestamp := binary.BigEndian.Uint64(v[1:9]) if timestamp == 0 { return false } if timestamp <= uint64(time.Now().UnixMilli()) { return true } return false } return false }
Functions ¶
func NewDefaultDeletionFileLimiter ¶
func NewDefaultDeletionFileLimiter() *base.DeletionFileLimiter
Types ¶
type BdbOptions ¶
type BdbOptions struct { *Options Index int Timeout time.Duration NoGrowSync bool NoFreelistSync bool FreelistType string ReadOnly bool MmapFlags int InitialMmapSize int PageSize int NoSync bool OpenFile func(string, int, os.FileMode) (*os.File, error) Mlock bool CheckPageSplitted func(uint32) bool }
type BitableOptions ¶
type BithashOptions ¶
type BitpageOptions ¶
type BitreeOptions ¶
type BitreeOptions struct { *Options Index int BdbOpts *BdbOptions BitpageOpts *BitpageOptions BithashOpts *BithashOptions BitableOpts *BitableOptions IsFlushedBitableCB func() bool }
type CacheOptions ¶
type IterOptions ¶
type IterOptions struct { LowerBound []byte UpperBound []byte Logger base.Logger SlotId uint32 IsAll bool DisableCache bool }
func (*IterOptions) GetLogger ¶
func (o *IterOptions) GetLogger() base.Logger
func (*IterOptions) GetLowerBound ¶
func (o *IterOptions) GetLowerBound() []byte
func (*IterOptions) GetSlotId ¶
func (o *IterOptions) GetSlotId() uint32
func (*IterOptions) GetUpperBound ¶
func (o *IterOptions) GetUpperBound() []byte
func (*IterOptions) IsGetAll ¶
func (o *IterOptions) IsGetAll() bool
type Options ¶
type Options struct { Id int FS vfs.FS Cmp base.Compare Logger base.Logger Compressor compress.Compressor UseBithash bool UseBitable bool UseMapIndex bool UsePrefixCompress bool UseBlockCompress bool BitpageBlockCacheSize int64 BytesPerSync int KvSeparateSize int BitpageFlushSize uint64 BitpageSplitSize uint64 BitpageTaskPushFunc func(*bitask.BitpageTaskData) DbState *statemachine.DbStateMachine DeleteFilePacer *base.DeletionFileLimiter KeyHashFunc func([]byte) int KvCheckExpireFunc func(int, []byte, []byte) bool KvTimestampFunc func([]byte, uint8) (bool, uint64) KeyPrefixDeleteFunc func([]byte) uint64 }
func (*Options) KvCheckExpire ¶
type OptionsPool ¶
type OptionsPool struct { BaseOptions *Options BitableOptions *BitableOptions BithashOptions *BithashOptions BitpageOptions *BitpageOptions BdbOptions *BdbOptions BitreeOptions *BitreeOptions DbState *statemachine.DbStateMachine }
func InitDefaultsOptionsPool ¶
func InitDefaultsOptionsPool() *OptionsPool
func InitTestDefaultsOptionsPool ¶
func InitTestDefaultsOptionsPool() *OptionsPool
func (*OptionsPool) CloneBithashOptions ¶
func (o *OptionsPool) CloneBithashOptions() *BithashOptions
func (*OptionsPool) CloneBitpageOptions ¶
func (o *OptionsPool) CloneBitpageOptions() *BitpageOptions
func (*OptionsPool) CloneBitreeOptions ¶
func (o *OptionsPool) CloneBitreeOptions() *BitreeOptions
func (*OptionsPool) Close ¶
func (o *OptionsPool) Close()
Click to show internal directories.
Click to hide internal directories.