Documentation ¶
Index ¶
- type CoreAPI
- type DB
- func (db *DB) Close() error
- func (db *DB) Del(key []byte) error
- func (db *DB) Get(key []byte) (*utils.Entry, error)
- func (db *DB) Info() *Stats
- func (db *DB) NewIterator(opt *utils.Options) utils.Iterator
- func (db *DB) RunValueLogGC(discardRatio float64) error
- func (db *DB) Set(data *utils.Entry) error
- type DBIterator
- type Item
- type Options
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoreAPI ¶
type CoreAPI interface { Set(data *utils.Entry) error Get(key []byte) (*utils.Entry, error) Del(key []byte) error NewIterator(opt *utils.Options) utils.Iterator Info() *Stats Close() error }
coreKV对外提供的功能集合
type DB ¶
DB 对外暴露的接口对象 全局唯一,持有各种资源句柄
func Open ¶
* SSTableMaxSz: 1024, MemTableSize: 1024, BlockSize: 1024, BloomFalsePositive: 0, BaseLevelSize: 10 << 20, LevelSizeMultiplier: 10, BaseTableSize: 2 << 20, TableSizeMultiplier: 2, NumLevelZeroTables: 15, MaxLevelNum: 7, NumCompactors: 3,
Open DB TODO 这里是不是要上一个目录锁比较好,防止多个进程打开同一个目录?
func (*DB) RunValueLogGC ¶
RunValueLogGC triggers a value log garbage collection.
type DBIterator ¶
type DBIterator struct {
// contains filtered or unexported fields
}
func (*DBIterator) Close ¶
func (iter *DBIterator) Close() error
func (*DBIterator) Item ¶
func (iter *DBIterator) Item() utils.Item
func (*DBIterator) Next ¶
func (iter *DBIterator) Next()
func (*DBIterator) Rewind ¶
func (iter *DBIterator) Rewind()
func (*DBIterator) Seek ¶
func (iter *DBIterator) Seek(key []byte)
func (*DBIterator) Valid ¶
func (iter *DBIterator) Valid() bool
type Options ¶
type Options struct { ValueThreshold int64 WorkDir string MemTableSize int64 SSTableMaxSz int64 MaxBatchCount int64 MaxBatchSize int64 // max batch size in bytes ValueLogFileSize int VerifyValueChecksum bool ValueLogMaxEntries uint32 LogRotatesToFlush int32 MaxTableSize int64 }
Options corekv 总的配置文件
Click to show internal directories.
Click to hide internal directories.