Documentation
¶
Index ¶
- Constants
- Variables
- type Batch
- func (b *Batch) Close() error
- func (b *Batch) Commit(o *WriteOptions) error
- func (b *Batch) Count() uint32
- func (b *Batch) Delete(key []byte, opts *WriteOptions) error
- func (b *Batch) Empty() bool
- func (b *Batch) PrefixDeleteKeySet(key []byte, opts *WriteOptions) error
- func (b *Batch) Reset()
- func (b *Batch) Set(key, value []byte, opts *WriteOptions) error
- func (b *Batch) SetMultiValue(key []byte, values ...[]byte) error
- type BatchBitower
- func (b *BatchBitower) Close() error
- func (b *BatchBitower) Commit(o *WriteOptions) error
- func (b *BatchBitower) Count() uint32
- func (b *BatchBitower) Delete(key []byte, _ *WriteOptions) error
- func (b *BatchBitower) DeleteDeferred(keyLen int) *DeferredBatchOp
- func (b *BatchBitower) Empty() bool
- func (b *BatchBitower) LogData(data []byte, _ *WriteOptions) error
- func (b *BatchBitower) PrefixDeleteKeySet(key []byte, _ *WriteOptions) error
- func (b *BatchBitower) Reader() BatchBitowerReader
- func (b *BatchBitower) Repr() []byte
- func (b *BatchBitower) Reset()
- func (b *BatchBitower) SeqNum() uint64
- func (b *BatchBitower) Set(key, value []byte, _ *WriteOptions) error
- func (b *BatchBitower) SetDeferred(keyLen, valueLen int) *DeferredBatchOp
- func (b *BatchBitower) SetMultiValue(key []byte, values ...[]byte) error
- func (b *BatchBitower) SetRepr(data []byte) error
- type BatchBitowerReader
- type BitableOptions
- type Bitower
- type CheckpointOption
- type CompactEnv
- type Compare
- type Comparer
- type DB
- func (d *DB) Apply(batch *Batch, opts *WriteOptions) error
- func (d *DB) ApplyBitower(batch *BatchBitower, opts *WriteOptions) error
- func (d *DB) AsyncFlush() (<-chan struct{}, error)
- func (d *DB) CacheInfo() string
- func (d *DB) CheckAndCompact(jobId int)
- func (d *DB) CheckKeySize(key []byte) error
- func (d *DB) Checkpoint(destDir string, opts ...CheckpointOption) (ckErr error)
- func (d *DB) Close() (err error)
- func (d *DB) CompactBitree(jobId int)
- func (d *DB) DebugInfo() string
- func (d *DB) Delete(key []byte, opts *WriteOptions) error
- func (d *DB) Exist(key []byte) (bool, error)
- func (d *DB) Flush() error
- func (d *DB) Get(key []byte) ([]byte, func(), error)
- func (d *DB) GetAutoCompact() bool
- func (d *DB) Id() int
- func (d *DB) IsClosed() bool
- func (d *DB) LockTask()
- func (d *DB) LogData(data []byte, index int, opts *WriteOptions) error
- func (d *DB) ManualFlushBitpage()
- func (d *DB) MetricsInfo() MetricsInfo
- func (d *DB) NewBatch() *Batch
- func (d *DB) NewBatchBitower() *BatchBitower
- func (d *DB) NewIter(o *IterOptions) *Iterator
- func (d *DB) PrefixDeleteKeySet(key []byte, opts *WriteOptions) error
- func (d *DB) Set(key, value []byte, opts *WriteOptions) error
- func (d *DB) SetAutoCompact(newVal bool)
- func (d *DB) SetCheckpointHighPriority(v bool)
- func (d *DB) SetCheckpointLock(lock bool)
- func (d *DB) UnlockTask()
- type DeferredBatchOp
- type Equal
- type EventListener
- type FileNum
- type FlushInfo
- type InternalKey
- type InternalKeyKind
- type IterOptions
- type IterValidityState
- type Iterator
- func (i *Iterator) Close() error
- func (i *Iterator) Error() error
- func (i *Iterator) First() bool
- func (i *Iterator) Key() []byte
- func (i *Iterator) Last() bool
- func (i *Iterator) Metrics() IteratorMetrics
- func (i *Iterator) Next() bool
- func (i *Iterator) NextWithLimit() IterValidityState
- func (i *Iterator) Prev() bool
- func (i *Iterator) PrevWithLimit() IterValidityState
- func (i *Iterator) ResetStats()
- func (i *Iterator) SeekGE(key []byte) bool
- func (i *Iterator) SeekGEWithLimit(key []byte) IterValidityState
- func (i *Iterator) SeekLT(key []byte) bool
- func (i *Iterator) SeekLTWithLimit(key []byte) IterValidityState
- func (i *Iterator) SeekPrefixGE(key []byte) bool
- func (i *Iterator) SetBounds(lower, upper []byte)
- func (i *Iterator) Stats() IteratorStats
- func (i *Iterator) Valid() bool
- func (i *Iterator) Value() []byte
- type IteratorMetrics
- type IteratorStats
- type IteratorStatsKind
- type Logger
- type MetricsInfo
- type Options
- type Reader
- type Split
- type WALCreateInfo
- type WALDeleteInfo
- type WriteOptions
- type WriteStallBeginInfo
- type Writer
Constants ¶
View Source
const ( InternalKeyKindDelete = base.InternalKeyKindDelete InternalKeyKindSet = base.InternalKeyKindSet InternalKeyKindLogData = base.InternalKeyKindLogData InternalKeyKindPrefixDelete = base.InternalKeyKindPrefixDelete InternalKeyKindMax = base.InternalKeyKindMax InternalKeySeqNumMax = base.InternalKeySeqNumMax )
Variables ¶
View Source
var ( ErrNotFound = base.ErrNotFound ErrClosed = errors.New("bitalosdb: closed") )
View Source
var DefaultComparer = base.DefaultComparer
View Source
var DefaultLogger = base.DefaultLogger
View Source
var ErrInvalidBatch = errors.New("bitalosdb: invalid batch")
View Source
var IterAll = IterOptions{IsAll: true}
View Source
var NoSync = &WriteOptions{Sync: false}
View Source
var Sync = &WriteOptions{Sync: true}
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) Commit ¶
func (b *Batch) Commit(o *WriteOptions) error
func (*Batch) PrefixDeleteKeySet ¶ added in v1.1.0
func (b *Batch) PrefixDeleteKeySet(key []byte, opts *WriteOptions) error
type BatchBitower ¶ added in v1.1.0
type BatchBitower struct {
// contains filtered or unexported fields
}
func (*BatchBitower) Close ¶ added in v1.1.0
func (b *BatchBitower) Close() error
func (*BatchBitower) Commit ¶ added in v1.1.0
func (b *BatchBitower) Commit(o *WriteOptions) error
func (*BatchBitower) Count ¶ added in v1.1.0
func (b *BatchBitower) Count() uint32
func (*BatchBitower) Delete ¶ added in v1.1.0
func (b *BatchBitower) Delete(key []byte, _ *WriteOptions) error
func (*BatchBitower) DeleteDeferred ¶ added in v1.1.0
func (b *BatchBitower) DeleteDeferred(keyLen int) *DeferredBatchOp
func (*BatchBitower) Empty ¶ added in v1.1.0
func (b *BatchBitower) Empty() bool
func (*BatchBitower) LogData ¶ added in v1.1.0
func (b *BatchBitower) LogData(data []byte, _ *WriteOptions) error
func (*BatchBitower) PrefixDeleteKeySet ¶ added in v1.1.0
func (b *BatchBitower) PrefixDeleteKeySet(key []byte, _ *WriteOptions) error
func (*BatchBitower) Reader ¶ added in v1.1.0
func (b *BatchBitower) Reader() BatchBitowerReader
func (*BatchBitower) Repr ¶ added in v1.1.0
func (b *BatchBitower) Repr() []byte
func (*BatchBitower) Reset ¶ added in v1.1.0
func (b *BatchBitower) Reset()
func (*BatchBitower) SeqNum ¶ added in v1.1.0
func (b *BatchBitower) SeqNum() uint64
func (*BatchBitower) Set ¶ added in v1.1.0
func (b *BatchBitower) Set(key, value []byte, _ *WriteOptions) error
func (*BatchBitower) SetDeferred ¶ added in v1.1.0
func (b *BatchBitower) SetDeferred(keyLen, valueLen int) *DeferredBatchOp
func (*BatchBitower) SetMultiValue ¶ added in v1.1.0
func (b *BatchBitower) SetMultiValue(key []byte, values ...[]byte) error
func (*BatchBitower) SetRepr ¶ added in v1.1.0
func (b *BatchBitower) SetRepr(data []byte) error
type BatchBitowerReader ¶ added in v1.1.0
type BatchBitowerReader []byte
func ReadBatchBitower ¶ added in v1.1.0
func ReadBatchBitower(repr []byte) (r BatchBitowerReader, count uint32)
func (*BatchBitowerReader) Next ¶ added in v1.1.0
func (r *BatchBitowerReader) Next() (kind InternalKeyKind, ukey []byte, value []byte, ok bool)
type BitableOptions ¶
type BitableOptions = options.BitableOptions
type Bitower ¶ added in v1.1.0
type Bitower struct {
// contains filtered or unexported fields
}
func (*Bitower) AsyncFlush ¶ added in v1.1.0
func (*Bitower) ManualFlushBitpage ¶ added in v1.3.0
func (s *Bitower) ManualFlushBitpage()
type CheckpointOption ¶
type CheckpointOption func(*checkpointOptions)
func WithFlushedWAL ¶
func WithFlushedWAL() CheckpointOption
type CompactEnv ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) ApplyBitower ¶ added in v1.1.0
func (d *DB) ApplyBitower(batch *BatchBitower, opts *WriteOptions) error
func (*DB) AsyncFlush ¶
func (*DB) CheckAndCompact ¶
func (*DB) CheckKeySize ¶
func (*DB) Checkpoint ¶
func (d *DB) Checkpoint(destDir string, opts ...CheckpointOption) (ckErr error)
func (*DB) CompactBitree ¶
func (*DB) GetAutoCompact ¶ added in v1.1.0
func (*DB) ManualFlushBitpage ¶ added in v1.3.0
func (d *DB) ManualFlushBitpage()
func (*DB) MetricsInfo ¶ added in v1.1.0
func (d *DB) MetricsInfo() MetricsInfo
func (*DB) NewBatchBitower ¶ added in v1.1.0
func (d *DB) NewBatchBitower() *BatchBitower
func (*DB) NewIter ¶
func (d *DB) NewIter(o *IterOptions) *Iterator
func (*DB) PrefixDeleteKeySet ¶ added in v1.1.0
func (d *DB) PrefixDeleteKeySet(key []byte, opts *WriteOptions) error
func (*DB) SetAutoCompact ¶ added in v1.1.0
func (*DB) SetCheckpointHighPriority ¶
func (*DB) SetCheckpointLock ¶
func (*DB) UnlockTask ¶
func (d *DB) UnlockTask()
type DeferredBatchOp ¶
type DeferredBatchOp struct {
Key, Value []byte
// contains filtered or unexported fields
}
func (DeferredBatchOp) Finish ¶
func (d DeferredBatchOp) Finish() error
type EventListener ¶
type EventListener struct {
BackgroundError func(error)
FlushBegin func(FlushInfo)
FlushEnd func(FlushInfo)
WALCreated func(WALCreateInfo)
WALDeleted func(WALDeleteInfo)
WriteStallBegin func(WriteStallBeginInfo)
WriteStallEnd func()
}
func MakeLoggingEventListener ¶
func MakeLoggingEventListener(logger Logger) EventListener
func TeeEventListener ¶
func TeeEventListener(a, b EventListener) EventListener
func (*EventListener) EnsureDefaults ¶
func (l *EventListener) EnsureDefaults(logger Logger)
type FlushInfo ¶
type FlushInfo struct {
Index int
Reason string
Input int
Iterated uint64
Written int64
Duration time.Duration
Done bool
Err error
// contains filtered or unexported fields
}
func (FlushInfo) SafeFormat ¶
func (i FlushInfo) SafeFormat(w redact.SafePrinter, _ rune)
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 Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) Metrics ¶
func (i *Iterator) Metrics() IteratorMetrics
func (*Iterator) NextWithLimit ¶
func (i *Iterator) NextWithLimit() IterValidityState
func (*Iterator) PrevWithLimit ¶
func (i *Iterator) PrevWithLimit() IterValidityState
func (*Iterator) ResetStats ¶
func (i *Iterator) ResetStats()
func (*Iterator) SeekGEWithLimit ¶
func (i *Iterator) SeekGEWithLimit(key []byte) IterValidityState
func (*Iterator) SeekLTWithLimit ¶
func (i *Iterator) SeekLTWithLimit(key []byte) IterValidityState
func (*Iterator) SeekPrefixGE ¶
func (*Iterator) Stats ¶
func (i *Iterator) Stats() IteratorStats
type IteratorMetrics ¶
type IteratorMetrics struct {
ReadAmp int
}
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 MetricsInfo ¶ added in v1.1.0
type MetricsInfo struct {
FlushMemTime int64 `json:"-"`
BithashFileTotal int `json:"bithash_file_total"`
BithashKeyTotal int `json:"bithash_key_total"`
BithashDelKeyTotal int `json:"bithash_del_key_total"`
}
func (MetricsInfo) String ¶ added in v1.1.0
func (s MetricsInfo) String() string
type Options ¶
type Options struct {
BytesPerSync int
Comparer *Comparer
DisableWAL bool
EventListener EventListener
MemTableSize int
MemTableStopWritesThreshold int
WALBytesPerSync int
WALDir string
WALMinSyncInterval func() time.Duration
FS vfs.FS
Logger Logger
Id int
Verbose bool
LogTag string
DataType string
CompressionType int
DeleteFileInternal int
UseBithash bool
UseBitable bool
BitableOpts *options.BitableOptions
AutoCompact bool
CompactInfo CompactEnv
CacheSize int64
CacheType int
CacheShards int
CacheHashSize int
UseMapIndex bool
UsePrefixCompress bool
UseBlockCompress bool
BlockCacheSize int64
FlushReporter func(int)
KeyHashFunc func([]byte) int
KvCheckExpireFunc func(int, []byte, []byte) bool
KvTimestampFunc func([]byte, uint8) (bool, uint64)
IOWriteLoadThresholdFunc func() bool
KeyPrefixDeleteFunc func([]byte) uint64
FlushPrefixDeleteKeyMultiplier int
FlushFileLifetime int
BitpageFlushSize uint64
BitpageSplitSize uint64
// contains filtered or unexported fields
}
func (*Options) EnsureDefaults ¶
type WALCreateInfo ¶
type WALCreateInfo struct {
Index int
Path string
FileNum FileNum
RecycledFileNum FileNum
Err error
}
func (WALCreateInfo) SafeFormat ¶
func (i WALCreateInfo) SafeFormat(w redact.SafePrinter, _ rune)
func (WALCreateInfo) String ¶
func (i WALCreateInfo) String() string
type WALDeleteInfo ¶
func (WALDeleteInfo) SafeFormat ¶
func (i WALDeleteInfo) SafeFormat(w redact.SafePrinter, _ rune)
func (WALDeleteInfo) String ¶
func (i WALDeleteInfo) String() string
type WriteOptions ¶
type WriteOptions struct {
Sync bool
}
func (*WriteOptions) GetSync ¶
func (o *WriteOptions) GetSync() bool
type WriteStallBeginInfo ¶
func (WriteStallBeginInfo) SafeFormat ¶
func (i WriteStallBeginInfo) SafeFormat(w redact.SafePrinter, _ rune)
func (WriteStallBeginInfo) String ¶
func (i WriteStallBeginInfo) String() string
type Writer ¶
type Writer interface {
Apply(batch *Batch, o *WriteOptions) error
ApplyBitower(batch *BatchBitower, o *WriteOptions) error
Delete(key []byte, o *WriteOptions) error
LogData(data []byte, index int, opts *WriteOptions) error
Set(key, value []byte, o *WriteOptions) error
PrefixDeleteKeySet(key []byte, o *WriteOptions) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.

