Documentation ¶
Overview ¶
Copyright 2021 hardcore-os Project Authors
Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func IsDeletedOrExpired(e *utils.Entry) bool
- func NewMergeIterator(iters []utils.Iterator, reverse bool) utils.Iterator
- type ConcatIterator
- type Item
- type Iterator
- type LSM
- func (lsm *LSM) Close() error
- func (lsm *LSM) Get(key []byte) (*utils.Entry, error)
- func (lsm *LSM) GetSkipListFromMemTable() *utils.Skiplist
- func (lsm *LSM) MemSize() int64
- func (lsm *LSM) MemTableIsNil() bool
- func (lsm *LSM) NewIterators(opt *utils.Options) []utils.Iterator
- func (lsm *LSM) NewMemtable() *memTable
- func (lsm *LSM) Rotate()
- func (lsm *LSM) Set(entry *utils.Entry) (err error)
- func (lsm *LSM) StartCompacter()
- type MergeIterator
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConcatIterator ¶
type ConcatIterator struct {
// contains filtered or unexported fields
}
ConcatIterator 将table 数组链接成一个迭代器,这样迭代效率更高
func NewConcatIterator ¶
func NewConcatIterator(tbls []*table, opt *utils.Options) *ConcatIterator
NewConcatIterator creates a new concatenated iterator
func (*ConcatIterator) Seek ¶
func (s *ConcatIterator) Seek(key []byte)
Seek brings us to element >= key if reversed is false. Otherwise, <= key.
type LSM ¶
type LSM struct {
// contains filtered or unexported fields
}
LSM _
func (*LSM) GetSkipListFromMemTable ¶
func (*LSM) MemTableIsNil ¶
type MergeIterator ¶
type MergeIterator struct {
// contains filtered or unexported fields
}
MergeIterator 多路合并迭代器 NOTE: MergeIterator owns the array of iterators and is responsible for closing them.
func (*MergeIterator) Item ¶
func (mi *MergeIterator) Item() utils.Item
Key returns the key associated with the current iterator.
func (*MergeIterator) Next ¶
func (mi *MergeIterator) Next()
Next returns the next element. If it is the same as the current key, ignore it.
func (*MergeIterator) Rewind ¶
func (mi *MergeIterator) Rewind()
Rewind seeks to first element (or last element for reverse iterator).
func (*MergeIterator) Seek ¶
func (mi *MergeIterator) Seek(key []byte)
Seek brings us to element with key >= given key.
func (*MergeIterator) Valid ¶
func (mi *MergeIterator) Valid() bool
Valid returns whether the MergeIterator is at a valid element.
type Options ¶
type Options struct { WorkDir string MemTableSize int64 SSTableMaxSz int64 // BlockSize is the size of each block inside SSTable in bytes. BlockSize int // BloomFalsePositive is the false positive probabiltiy of bloom filter. BloomFalsePositive float64 // compact NumCompactors int BaseLevelSize int64 LevelSizeMultiplier int // 决定level之间期望的size比例 TableSizeMultiplier int BaseTableSize int64 NumLevelZeroTables int MaxLevelNum int DiscardStatsCh *chan map[uint32]int64 }
Options _