Documentation
¶
Index ¶
- Constants
- Variables
- func NewFlushStats() *dbFlushStats
- type Bituple
- func (b *Bituple) Close() (err error)
- func (b *Bituple) GetDebugInfo() string
- func (b *Bituple) GetDirDiskInfo() string
- func (b *Bituple) GetDiskInfo() (bitupleDisk, bitpageDisk, bithashDisk uint64)
- func (b *Bituple) GetInfo() string
- func (b *Bituple) NewBitupleIter() *TupleIterator
- func (b *Bituple) RemoveDir() error
- func (b *Bituple) RunVtGC(force bool)
- func (b *Bituple) RunVtRehash(force bool)
- type BitupleIterator
- type CompactEnv
- type Compare
- type Comparer
- type DB
- func (d *DB) AsyncMemFlush(flushForce bool) (<-chan struct{}, error)
- func (d *DB) AsyncVmFlush() (<-chan struct{}, error)
- func (d *DB) BitCount64(key []byte, slotId uint16, begin, end int) (int64, error)
- func (d *DB) BitPos64(key []byte, slotId uint16, on, begin, end int) (int64, error)
- func (d *DB) Checkpoint(dstDir string) (func(), error)
- func (d *DB) Close() (err error)
- func (d *DB) DKCreate(key []byte, slotId uint16, dataType uint8, shardNum uint32) error
- func (d *DB) DKCreateShard(key []byte, slotId uint16, dataType uint8) error
- func (d *DB) DKIncrBySize(key []byte, slotId uint16, incr int64) (int64, error)
- func (d *DB) DebugInfo() string
- func (d *DB) Delete(key []byte, slotId uint16) (int64, uint8, error)
- func (d *DB) DeleteKKV(key []byte, slotId uint16, dataType uint8, subKeys ...[]byte) (int64, error)
- func (d *DB) DeleteXKKV(key []byte, slotId uint16, dataType uint8, subKeys ...[]byte) (int64, error)
- func (d *DB) DirDiskInfo() string
- func (d *DB) DiskInfo() (bitupleDisk, bitpageDisk, bithashDisk uint64)
- func (d *DB) Exist(key []byte, slotId uint16) (bool, error)
- func (d *DB) ExpireAt(key []byte, slotId uint16, newTs uint64) (int64, uint8, error)
- func (d *DB) Flush(flushForce bool) error
- func (d *DB) FlushBitpage()
- func (d *DB) FlushMemtable() error
- func (d *DB) FlushVm() error
- func (d *DB) Get(key []byte, slotId uint16) (value []byte, dataType uint8, timestamp uint64, closer func(), err error)
- func (d *DB) GetBit64(key []byte, slotId uint16, offset uint64) (int64, error)
- func (d *DB) GetMeta(key []byte, slotId uint16) (dataType uint8, timestamp, version, lindex, rindex uint64, size uint32, ...)
- func (d *DB) GetMetaSize(key []byte, slotId uint16) (size uint32, err error)
- func (d *DB) GetStats() DbStats
- func (d *DB) GetTimestamp(key []byte, slotId uint16) (uint8, uint64, error)
- func (d *DB) HDel(key []byte, slotId uint16, subKeys ...[]byte) (int64, error)
- func (d *DB) HDelX(key []byte, slotId uint16, subKeys ...[]byte) (int64, error)
- func (d *DB) HGet(key []byte, slotId uint16, subKey []byte) ([]byte, func(), error)
- func (d *DB) HGetAll(key []byte, slotId uint16) ([][]byte, func(), error)
- func (d *DB) HIncrBy(key []byte, slotId uint16, subKey []byte, incr int64) (int64, error)
- func (d *DB) HKeys(key []byte, slotId uint16) ([][]byte, func(), error)
- func (d *DB) HMGet(key []byte, slotId uint16, subKeys ...[]byte) ([][]byte, []func(), error)
- func (d *DB) HMSet(key []byte, slotId uint16, kvs ...[]byte) (int64, error)
- func (d *DB) HMSetX(key []byte, slotId uint16, isExist bool, kvs ...[]byte) (int64, error)
- func (d *DB) HValues(key []byte, slotId uint16) ([][]byte, func(), error)
- func (d *DB) IsCheckpointHighPriority() bool
- func (d *DB) IsCheckpointSyncing() bool
- func (d *DB) IsClosed() bool
- func (d *DB) ListIndex(key []byte, slotId uint16, index int64) ([]byte, func(), error)
- func (d *DB) ListPop(key []byte, slotId uint16, isLeft bool) ([]byte, func(), error)
- func (d *DB) ListPush(key []byte, slotId uint16, isLeft bool, isExist bool, values ...[]byte) (int64, error)
- func (d *DB) ListRange(key []byte, slotId uint16, start, stop int64) ([][]byte, func(), error)
- func (d *DB) ListSet(key []byte, slotId uint16, index int64, value []byte) error
- func (d *DB) ListTrim(key []byte, slotId uint16, start, stop int64) (err error)
- func (d *DB) NewBitupleIter() *BitupleIterator
- func (d *DB) NewKKVIterator(o *IterOptions) *KKVIterator
- func (d *DB) RemoveSlot(slotId uint16) error
- func (d *DB) SAdd(key []byte, slotId uint16, kvs ...[]byte) (int64, error)
- func (d *DB) SAddX(key []byte, slotId uint16, isExist bool, kvs ...[]byte) (int64, error)
- func (d *DB) SIsMember(key []byte, slotId uint16, subKey []byte) (int64, error)
- func (d *DB) SMembers(key []byte, slotId uint16) ([][]byte, func(), error)
- func (d *DB) SPop(key []byte, slotId uint16, count int64) ([][]byte, func(), error)
- func (d *DB) SPopX(key []byte, slotId uint16, count int64) ([][]byte, func(), error)
- func (d *DB) SRandMember(key []byte, slotId uint16, count int64) ([][]byte, func(), error)
- func (d *DB) SRem(key []byte, slotId uint16, members ...[]byte) (int64, error)
- func (d *DB) SRemX(key []byte, slotId uint16, members ...[]byte) (int64, error)
- func (d *DB) Scan(cursor []byte, count int, dt uint8, cmp func(member string) bool) ([]byte, [][]byte, error)
- func (d *DB) Set(key []byte, slotId uint16, dataType uint8, timestamp uint64, value []byte) error
- func (d *DB) SetAutoCompact(newVal bool)
- func (d *DB) SetBit64(key []byte, slotId uint16, offset uint64, on int) (int64, error)
- func (d *DB) SetMeta(key []byte, slotId uint16, dataType uint8, hi, lo, timestamp, version uint64, ...) error
- func (d *DB) VtableGC(slotId uint16)
- func (d *DB) VtableRehash(slotId uint16)
- func (d *DB) ZAdd(key []byte, slotId uint16, kvs ...[]byte) (int64, error)
- func (d *DB) ZCount(key []byte, slotId uint16, min float64, max float64, leftClose bool, ...) (int64, error)
- func (d *DB) ZIncrBy(key []byte, slotId uint16, member []byte, incr float64) (float64, error)
- func (d *DB) ZLexCount(key []byte, slotId uint16, min []byte, max []byte, leftClose bool, ...) (int64, error)
- func (d *DB) ZRange(key []byte, slotId uint16, start int64, stop int64, reverse bool) ([]ScorePair, func(), error)
- func (d *DB) ZRangeByLex(key []byte, slotId uint16, min []byte, max []byte, leftClose bool, ...) ([][]byte, func(), error)
- func (d *DB) ZRangeByScore(key []byte, slotId uint16, min float64, max float64, leftClose bool, ...) ([]ScorePair, func(), error)
- func (d *DB) ZRank(key []byte, slotId uint16, member []byte, reverse bool) (int64, error)
- func (d *DB) ZRem(key []byte, slotId uint16, members ...[]byte) (int64, error)
- func (d *DB) ZRemRangeByLex(key []byte, slotId uint16, min []byte, max []byte, leftClose bool, ...) (int64, error)
- func (d *DB) ZRemRangeByRank(key []byte, slotId uint16, start int64, stop int64) (int64, error)
- func (d *DB) ZRemRangeByScore(key []byte, slotId uint16, min float64, max float64, leftClose bool, ...) (int64, error)
- func (d *DB) ZRevRangeByScore(key []byte, slotId uint16, min float64, max float64, leftClose bool, ...) ([]ScorePair, func(), error)
- func (d *DB) ZScore(key []byte, slotId uint16, member []byte) (float64, error)
- type DbStats
- type Equal
- type FileNum
- type FileType
- type InternalKKVIterator
- type InternalKKVKey
- type InternalKey
- type InternalKeyKind
- type IterOptions
- type IterValidityState
- type IteratorStats
- type IteratorStatsKind
- type KKVIterator
- func (i *KKVIterator) Close() error
- func (i *KKVIterator) Error() error
- func (i *KKVIterator) First() bool
- func (i *KKVIterator) GetListIndex() uint64
- func (i *KKVIterator) GetSubKey() []byte
- func (i *KKVIterator) GetZsetKey() (float64, []byte)
- func (i *KKVIterator) GetZsetMember() []byte
- func (i *KKVIterator) GetZsetScore() (float64, bool)
- func (i *KKVIterator) Key() []byte
- func (i *KKVIterator) Last() bool
- func (i *KKVIterator) Next() bool
- func (i *KKVIterator) NextWithLimit() IterValidityState
- func (i *KKVIterator) Prev() bool
- func (i *KKVIterator) PrevWithLimit() IterValidityState
- func (i *KKVIterator) SeekGE(key []byte) bool
- func (i *KKVIterator) SeekGEWithLimit(key []byte) IterValidityState
- func (i *KKVIterator) SeekLT(key []byte) bool
- func (i *KKVIterator) SetBounds(lower, upper []byte)
- func (i *KKVIterator) Stats() IteratorStats
- func (i *KKVIterator) Valid() bool
- func (i *KKVIterator) Value() []byte
- type Logger
- type Options
- type ScorePair
- type Tuple
- type TupleIterator
Constants ¶
View Source
const ( InternalKeyKindDelete = base.InternalKeyKindDelete InternalKeyKindSet = base.InternalKeyKindSet InternalKeyKindSetBithash = base.InternalKeyKindSetBithash InternalKeyKindLogData = base.InternalKeyKindLogData InternalKeyKindPrefixDelete = base.InternalKeyKindPrefixDelete InternalKeyKindExpireAt = base.InternalKeyKindExpireAt InternalKeyKindMax = base.InternalKeyKindMax InternalKeySeqNumMax = base.InternalKeySeqNumMax InternalKeyKindInvalid = base.InternalKeyKindInvalid )
View Source
const ( DataTypeNone = kkv.DataTypeNone DataTypeString = kkv.DataTypeString DataTypeBitmap = kkv.DataTypeBitmap DataTypeHash = kkv.DataTypeHash DataTypeList = kkv.DataTypeList DataTypeSet = kkv.DataTypeSet DataTypeZset = kkv.DataTypeZset DataTypeZsetIndex = kkv.DataTypeZsetIndex DataTypeDKHash = kkv.DataTypeDKHash DataTypeDKSet = kkv.DataTypeDKSet )
Variables ¶
View Source
var ( ErrNotFound = base.ErrNotFound ErrWrongType = base.ErrWrongType ErrClosed = errors.New("bitalosdb: closed") ErrNoSlotId = errors.New("bitalosdb: not set slotId") ErrSubKeySize = errors.New("invalid subKey size") ErrKeySize = errors.New("invalid key size") ErrSiKeySize = errors.New("invalid siKey size") ErrValueSize = errors.New("invalid value size") ErrZsetMemberNil = errors.New("zset member is nil") ErrDKExist = errors.New("bitalosdb: distributed key exist") ErrDKShardNum = errors.New("invalid shard num") ErrBitUnmarshal = errors.New("ERR bitmap unmarshal fail") ErrBitMarshal = errors.New("ERR bitmap marshal fail") ErrBitupleNil = errors.New("bituple is nil") )
View Source
var DefaultComparer = base.DefaultComparer
View Source
var DefaultLogger = base.DefaultLogger
Functions ¶
func NewFlushStats ¶
func NewFlushStats() *dbFlushStats
Types ¶
type Bituple ¶
type Bituple struct {
// contains filtered or unexported fields
}
func (*Bituple) GetDebugInfo ¶
func (*Bituple) GetDirDiskInfo ¶
func (*Bituple) GetDiskInfo ¶
func (*Bituple) NewBitupleIter ¶
func (b *Bituple) NewBitupleIter() *TupleIterator
func (*Bituple) RunVtRehash ¶
type BitupleIterator ¶
type BitupleIterator struct {
// contains filtered or unexported fields
}
func (*BitupleIterator) Close ¶
func (i *BitupleIterator) Close() error
func (*BitupleIterator) GetCursor ¶
func (i *BitupleIterator) GetCursor() []byte
type CompactEnv ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) AsyncMemFlush ¶
func (*DB) AsyncVmFlush ¶
func (*DB) BitCount64 ¶
func (*DB) Checkpoint ¶
func (*DB) DKCreateShard ¶
func (*DB) DKIncrBySize ¶
func (*DB) DeleteXKKV ¶
func (*DB) DirDiskInfo ¶
func (*DB) FlushBitpage ¶
func (d *DB) FlushBitpage()
func (*DB) FlushMemtable ¶
func (*DB) GetMetaSize ¶
func (*DB) GetTimestamp ¶
func (*DB) IsCheckpointHighPriority ¶
func (*DB) IsCheckpointSyncing ¶
func (*DB) NewBitupleIter ¶
func (d *DB) NewBitupleIter() *BitupleIterator
func (*DB) NewKKVIterator ¶
func (d *DB) NewKKVIterator(o *IterOptions) *KKVIterator
func (*DB) RemoveSlot ¶
func (*DB) SRandMember ¶
func (*DB) SetAutoCompact ¶
func (*DB) VtableRehash ¶
func (*DB) ZRangeByLex ¶
func (*DB) ZRangeByScore ¶
func (*DB) ZRemRangeByLex ¶
func (*DB) ZRemRangeByRank ¶
func (*DB) ZRemRangeByScore ¶
func (*DB) ZRevRangeByScore ¶
type InternalKKVIterator ¶
type InternalKKVIterator = kkv.InternalIterator
type InternalKKVKey ¶
type InternalKKVKey = kkv.InternalKey
type InternalKey ¶
type InternalKey = base.InternalKey
type InternalKeyKind ¶
type InternalKeyKind = base.InternalKeyKind
type IterOptions ¶
type IterOptions = options.IterOptions
type IterValidityState ¶
type IterValidityState int8
const ( IterExhausted IterValidityState = iota IterValid )
type IteratorStats ¶
type IteratorStats struct {
ForwardSeekCount [NumStatsKind]int
ReverseSeekCount [NumStatsKind]int
ForwardStepCount [NumStatsKind]int
ReverseStepCount [NumStatsKind]int
}
type IteratorStatsKind ¶
type IteratorStatsKind int8
const ( InterfaceCall IteratorStatsKind = iota InternalIterCall NumStatsKind )
type KKVIterator ¶
type KKVIterator struct {
// contains filtered or unexported fields
}
func (*KKVIterator) Close ¶
func (i *KKVIterator) Close() error
func (*KKVIterator) Error ¶
func (i *KKVIterator) Error() error
func (*KKVIterator) First ¶
func (i *KKVIterator) First() bool
func (*KKVIterator) GetListIndex ¶
func (i *KKVIterator) GetListIndex() uint64
func (*KKVIterator) GetSubKey ¶
func (i *KKVIterator) GetSubKey() []byte
func (*KKVIterator) GetZsetKey ¶
func (i *KKVIterator) GetZsetKey() (float64, []byte)
func (*KKVIterator) GetZsetMember ¶
func (i *KKVIterator) GetZsetMember() []byte
func (*KKVIterator) GetZsetScore ¶
func (i *KKVIterator) GetZsetScore() (float64, bool)
func (*KKVIterator) Key ¶
func (i *KKVIterator) Key() []byte
func (*KKVIterator) Last ¶
func (i *KKVIterator) Last() bool
func (*KKVIterator) Next ¶
func (i *KKVIterator) Next() bool
func (*KKVIterator) NextWithLimit ¶
func (i *KKVIterator) NextWithLimit() IterValidityState
func (*KKVIterator) Prev ¶
func (i *KKVIterator) Prev() bool
func (*KKVIterator) PrevWithLimit ¶
func (i *KKVIterator) PrevWithLimit() IterValidityState
func (*KKVIterator) SeekGE ¶
func (i *KKVIterator) SeekGE(key []byte) bool
func (*KKVIterator) SeekGEWithLimit ¶
func (i *KKVIterator) SeekGEWithLimit(key []byte) IterValidityState
func (*KKVIterator) SeekLT ¶
func (i *KKVIterator) SeekLT(key []byte) bool
func (*KKVIterator) SetBounds ¶
func (i *KKVIterator) SetBounds(lower, upper []byte)
func (*KKVIterator) Stats ¶
func (i *KKVIterator) Stats() IteratorStats
func (*KKVIterator) Valid ¶
func (i *KKVIterator) Valid() bool
func (*KKVIterator) Value ¶
func (i *KKVIterator) Value() []byte
type Options ¶
type Options struct {
BytesPerSync int
Comparer *Comparer
FS vfs.FS
Logger Logger
CompressionType int
Verbose bool
LogTag string
DeleteFileInternal int
DisableStoreKey bool
VectorTableCount uint16
VectorTableHashSize uint32
VmTableSize int
VmTableStopWritesThreshold int
MemTableSize int
MemTableStopWritesThreshold int
GetNowTimestamp func() uint64
IOWriteLoadThresholdFunc func() bool
MaxKeySize int
MaxSubKeySize int
MaxValueSize int
FlushPrefixDeleteKeyMultiplier int
FlushFileLifetime int
BitpageFlushSize uint64
BitpageSplitSize uint64
BitpageDisableMiniVi bool
BitpageTaskWorkerNum int
BithashTableSize int
AutoCompact bool
CompactInfo CompactEnv
FlushReporter func(int)
// contains filtered or unexported fields
}
func (*Options) EnsureDefaults ¶
type TupleIterator ¶
type TupleIterator struct {
// contains filtered or unexported fields
}
func (*TupleIterator) Close ¶
func (i *TupleIterator) Close() error
Source Files
¶
- bituple.go
- bituple_iterator.go
- checkpoint.go
- db.go
- db_api.go
- eliminate.go
- filename.go
- internal.go
- kkv.go
- kkv_bitmap.go
- kkv_compaction.go
- kkv_dk.go
- kkv_hash.go
- kkv_iterator.go
- kkv_list.go
- kkv_mem_flush.go
- kkv_mem_table.go
- kkv_set.go
- kkv_zset.go
- meta.go
- open.go
- options.go
- read_state.go
- stats.go
- vm_flush.go
- vm_pool.go
- vm_table.go
- vtable_gc.go
Click to show internal directories.
Click to hide internal directories.

