Documentation
¶
Index ¶
- type AdaptiveRadixTree
- func (art *AdaptiveRadixTree) Close() error
- func (art *AdaptiveRadixTree) Delete(key []byte) (*data.LogRecordPos, bool)
- func (art *AdaptiveRadixTree) Get(key []byte) *data.LogRecordPos
- func (art *AdaptiveRadixTree) Iterator(reverse bool) Iterator
- func (art *AdaptiveRadixTree) Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
- func (art *AdaptiveRadixTree) Size() int
- type BPlusTree
- func (bpt *BPlusTree) Close() error
- func (bpt *BPlusTree) Delete(key []byte) (*data.LogRecordPos, bool)
- func (bpt *BPlusTree) Get(key []byte) *data.LogRecordPos
- func (bpt *BPlusTree) Iterator(reverse bool) Iterator
- func (bpt *BPlusTree) Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
- func (bpt *BPlusTree) Size() int
- type BTree
- type IndexType
- type Indexer
- type Item
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveRadixTree ¶
type AdaptiveRadixTree struct {
// contains filtered or unexported fields
}
AdaptiveRadixTree defines an ART index
refer to [https://github.com/plar/go-adaptive-radix-tree]
func NewART ¶
func NewART() *AdaptiveRadixTree
func (*AdaptiveRadixTree) Close ¶
func (art *AdaptiveRadixTree) Close() error
func (*AdaptiveRadixTree) Delete ¶
func (art *AdaptiveRadixTree) Delete(key []byte) (*data.LogRecordPos, bool)
func (*AdaptiveRadixTree) Get ¶
func (art *AdaptiveRadixTree) Get(key []byte) *data.LogRecordPos
func (*AdaptiveRadixTree) Iterator ¶
func (art *AdaptiveRadixTree) Iterator(reverse bool) Iterator
func (*AdaptiveRadixTree) Put ¶
func (art *AdaptiveRadixTree) Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
func (*AdaptiveRadixTree) Size ¶
func (art *AdaptiveRadixTree) Size() int
type BPlusTree ¶
type BPlusTree struct {
// contains filtered or unexported fields
}
BPlusTree defines a B+ tree index
refer to [https://github.com/etcd-io/bbolt]
func NewBPlusTree ¶
NewBPlusTree initialize a new BPlusTree index
func (*BPlusTree) Put ¶
func (bpt *BPlusTree) Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
type BTree ¶
type BTree struct {
// contains filtered or unexported fields
}
BTree defines the BTree index
it mainly encapsulates Google's btree library: [https://github.com/google/btree]
func (*BTree) Put ¶
func (bt *BTree) Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
type Indexer ¶
type Indexer interface {
// Put stores information about the location of the data corresponding to the key in the index
Put(key []byte, pos *data.LogRecordPos) *data.LogRecordPos
// Get Fetches the index position information according to the key
Get(key []byte) *data.LogRecordPos
// Delete deletes the index position information according to the key
Delete(key []byte) (*data.LogRecordPos, bool)
// Size defines the size of index
Size() int
// Iterator defines an iterator to iterator over the index
Iterator(reverse bool) Iterator
// Close closes the index
Close() error
}
Indexer is the abstract index interface If there are other data structures that require integration, implement this interface directly
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item defines each item to be inserted into the BTree structure
type Iterator ¶
type Iterator interface {
// Rewind returns to the start (first item) of the iterator
Rewind()
// Seek finds the first target key that is greater than (or less than) or equal to the key passed in
// and starts traversing from this key
Seek(key []byte)
// Next jumps to the next key
Next()
// Valid checks the validity
// by checking whether all keys have been traversed, which can be used to exit traversal
Valid() bool
// Key returns the current iterating Key data
Key() []byte
// Value returns the current iterating Value data
Value() *data.LogRecordPos
// Close closes the iterator, freeing the resources
Close()
}
Iterator defines a generic index iterator
Click to show internal directories.
Click to hide internal directories.