Documentation
¶
Index ¶
- Variables
- type DBIterator
- type Request
- type TrainKVDB
- func (db *TrainKVDB) BatchSet(entries []*model.Entry) error
- func (db *TrainKVDB) Close() error
- func (db *TrainKVDB) Del(key []byte, version int64) error
- func (db *TrainKVDB) Get(key []byte) (model.Entry, error)
- func (db *TrainKVDB) NewDBIterator(opt *model.Options) *DBIterator
- func (db *TrainKVDB) RunValueLogGC(discardRatio float64) error
- func (db *TrainKVDB) SendToWriteCh(entries []*model.Entry) (*Request, error)
- func (db *TrainKVDB) Set(entry model.Entry) error
- func (db *TrainKVDB) ShouldWriteValueToLSM(entry model.Entry) bool
- type VLogFileDisCardStaInfo
- type ValueLog
- func (vlog *ValueLog) Close() error
- func (vlog *ValueLog) Entry(read io.Reader, offset uint32) (*model.Entry, error)
- func (vlog *ValueLog) NewValuePtr(entry *model.Entry) (*model.ValuePtr, error)
- func (vlog *ValueLog) Open(replayFn model.LogEntry) error
- func (vlog *ValueLog) Read(vp *model.ValuePtr) ([]byte, func(), error)
- func (vlog *ValueLog) ReadValueBytes(vp *model.ValuePtr) ([]byte, *file.VLogFile, error)
- func (vlog *ValueLog) Write(reqs []*Request) error
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestPool = sync.Pool{ New: func() interface{} { return new(Request) }, }
Functions ¶
This section is empty.
Types ¶
type DBIterator ¶
type DBIterator struct {
// contains filtered or unexported fields
}
func (*DBIterator) Close ¶
func (dbIter *DBIterator) Close() error
func (*DBIterator) Item ¶
func (dbIter *DBIterator) Item() model.Item
func (*DBIterator) Next ¶
func (dbIter *DBIterator) Next()
func (*DBIterator) Rewind ¶
func (dbIter *DBIterator) Rewind()
func (*DBIterator) Seek ¶
func (dbIter *DBIterator) Seek(key []byte)
func (*DBIterator) Valid ¶
func (dbIter *DBIterator) Valid() bool
type Request ¶
type TrainKVDB ¶
type TrainKVDB struct { Mux sync.Mutex Lsm *lsm.LSM Opt *lsm.Options VlogReplayHead model.ValuePtr Closer closer // contains filtered or unexported fields }
func (*TrainKVDB) NewDBIterator ¶
func (db *TrainKVDB) NewDBIterator(opt *model.Options) *DBIterator
func (*TrainKVDB) RunValueLogGC ¶
func (*TrainKVDB) SendToWriteCh ¶
SendToWriteCh 发送数据到 db.writeCh 通道中; vlog 组件调用; 1. Re重放: openVlog() -> go vlog.flushDiscardStats(); 监听并收集vlog文件的GC信息, 必要时将序列化统计表数据, 发送到 db 的写通道中, 以便重启时可以直接获得; 2. GC重写: db.batchSet(); 批处理(加速vlog GC重写速度), 将多个 []entry 写到指定通道中;
type VLogFileDisCardStaInfo ¶
type ValueLog ¶
type ValueLog struct { DirPath string Mux sync.RWMutex FilesToDel []uint32 Opt *lsm.Options Db *TrainKVDB GarbageCh chan struct{} VLogFileDisCardStaInfo *VLogFileDisCardStaInfo // contains filtered or unexported fields }
func (*ValueLog) NewValuePtr ¶
func (*ValueLog) ReadValueBytes ¶
Click to show internal directories.
Click to hide internal directories.