Documentation ¶
Index ¶
- Constants
- type BackwardIter
- type BackwardIterMem
- type ForwardIter
- type ForwardIterMem
- type HeightCompactionFilter
- type Iterator
- type MockIndexTree
- func (it *MockIndexTree) ActiveCount() int
- func (it *MockIndexTree) BeginWrite(height int64)
- func (it *MockIndexTree) Close()
- func (it *MockIndexTree) Delete(key []byte)
- func (it *MockIndexTree) EndWrite()
- func (it *MockIndexTree) Get(key []byte) (uint64, bool)
- func (it *MockIndexTree) GetAtHeight(k []byte, height uint64) (uint64, bool)
- func (it *MockIndexTree) Init(repFn func([]byte)) error
- func (it *MockIndexTree) Iterator(start, end []byte) Iterator
- func (it *MockIndexTree) ReverseIterator(start, end []byte) Iterator
- func (it *MockIndexTree) Set(key []byte, v uint64)
- func (it *MockIndexTree) SetPruneHeight(h uint64)
- type NVTreeMem
- func (tree *NVTreeMem) ActiveCount() int
- func (tree *NVTreeMem) BeginWrite(currHeight int64)
- func (tree *NVTreeMem) Close()
- func (tree *NVTreeMem) Delete(k []byte)
- func (tree *NVTreeMem) EndWrite()
- func (tree *NVTreeMem) Get(k []byte) (uint64, bool)
- func (tree *NVTreeMem) GetAtHeight(k []byte, height uint64) (position uint64, ok bool)
- func (tree *NVTreeMem) Init(repFn func([]byte)) (err error)
- func (tree *NVTreeMem) Iterator(start, end []byte) Iterator
- func (tree *NVTreeMem) ReverseIterator(start, end []byte) Iterator
- func (tree *NVTreeMem) Set(k []byte, v uint64)
- type RocksDB
- func (db *RocksDB) Close()
- func (db *RocksDB) CloseOldBatch()
- func (db *RocksDB) CurrBatch() dbm.Batch
- func (db *RocksDB) DB() *gorocksdb.DB
- func (db *RocksDB) Delete(key []byte)
- func (db *RocksDB) DeleteSync(key []byte)
- func (db *RocksDB) Get(key []byte) []byte
- func (db *RocksDB) GetPruneHeight() (uint64, bool)
- func (db *RocksDB) Has(key []byte) bool
- func (db *RocksDB) Iterator(start, end []byte) dbm.Iterator
- func (db *RocksDB) NewBatch() dbm.Batch
- func (db *RocksDB) OpenNewBatch()
- func (db *RocksDB) Print()
- func (db *RocksDB) ReverseIterator(start, end []byte) dbm.Iterator
- func (db *RocksDB) Set(key []byte, value []byte)
- func (db *RocksDB) SetPruneHeight(h uint64)
- func (db *RocksDB) SetSync(key []byte, value []byte)
- func (db *RocksDB) Stats() map[string]string
Constants ¶
View Source
const (
MaxKeyLength = 8192
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackwardIter ¶
type BackwardIter struct {
// contains filtered or unexported fields
}
func (*BackwardIter) Close ¶
func (iter *BackwardIter) Close()
func (*BackwardIter) Domain ¶
func (iter *BackwardIter) Domain() ([]byte, []byte)
func (*BackwardIter) Key ¶
func (iter *BackwardIter) Key() []byte
func (*BackwardIter) Next ¶
func (iter *BackwardIter) Next()
func (*BackwardIter) Valid ¶
func (iter *BackwardIter) Valid() bool
func (*BackwardIter) Value ¶
func (iter *BackwardIter) Value() uint64
type BackwardIterMem ¶
type BackwardIterMem struct {
// contains filtered or unexported fields
}
func (*BackwardIterMem) Close ¶
func (iter *BackwardIterMem) Close()
func (*BackwardIterMem) Domain ¶
func (iter *BackwardIterMem) Domain() ([]byte, []byte)
func (*BackwardIterMem) Key ¶
func (iter *BackwardIterMem) Key() []byte
func (*BackwardIterMem) Next ¶
func (iter *BackwardIterMem) Next()
func (*BackwardIterMem) Valid ¶
func (iter *BackwardIterMem) Valid() bool
func (*BackwardIterMem) Value ¶
func (iter *BackwardIterMem) Value() uint64
type ForwardIter ¶
type ForwardIter struct {
// contains filtered or unexported fields
}
func (*ForwardIter) Close ¶
func (iter *ForwardIter) Close()
func (*ForwardIter) Domain ¶
func (iter *ForwardIter) Domain() ([]byte, []byte)
func (*ForwardIter) Key ¶
func (iter *ForwardIter) Key() []byte
func (*ForwardIter) Next ¶
func (iter *ForwardIter) Next()
func (*ForwardIter) Valid ¶
func (iter *ForwardIter) Valid() bool
func (*ForwardIter) Value ¶
func (iter *ForwardIter) Value() uint64
type ForwardIterMem ¶
type ForwardIterMem struct {
// contains filtered or unexported fields
}
func (*ForwardIterMem) Close ¶
func (iter *ForwardIterMem) Close()
func (*ForwardIterMem) Domain ¶
func (iter *ForwardIterMem) Domain() ([]byte, []byte)
func (*ForwardIterMem) Key ¶
func (iter *ForwardIterMem) Key() []byte
func (*ForwardIterMem) Next ¶
func (iter *ForwardIterMem) Next()
func (*ForwardIterMem) Valid ¶
func (iter *ForwardIterMem) Valid() bool
func (*ForwardIterMem) Value ¶
func (iter *ForwardIterMem) Value() uint64
type HeightCompactionFilter ¶
type HeightCompactionFilter struct {
// contains filtered or unexported fields
}
We use rocksdb's customizable compact filter to prune old records
func (*HeightCompactionFilter) Filter ¶
func (f *HeightCompactionFilter) Filter(level int, key, val []byte) (remove bool, newVal []byte)
The last 8 bytes of keys are expiring height. If it is too small, we prune the record
func (*HeightCompactionFilter) Name ¶
func (f *HeightCompactionFilter) Name() string
type MockIndexTree ¶
type MockIndexTree struct {
// contains filtered or unexported fields
}
func NewMockIndexTree ¶
func NewMockIndexTree() *MockIndexTree
func (*MockIndexTree) ActiveCount ¶
func (it *MockIndexTree) ActiveCount() int
func (*MockIndexTree) BeginWrite ¶
func (it *MockIndexTree) BeginWrite(height int64)
func (*MockIndexTree) Close ¶
func (it *MockIndexTree) Close()
func (*MockIndexTree) Delete ¶
func (it *MockIndexTree) Delete(key []byte)
func (*MockIndexTree) EndWrite ¶
func (it *MockIndexTree) EndWrite()
func (*MockIndexTree) GetAtHeight ¶
func (it *MockIndexTree) GetAtHeight(k []byte, height uint64) (uint64, bool)
func (*MockIndexTree) Init ¶
func (it *MockIndexTree) Init(repFn func([]byte)) error
func (*MockIndexTree) Iterator ¶
func (it *MockIndexTree) Iterator(start, end []byte) Iterator
Create a forward iterator from the B-Tree
func (*MockIndexTree) ReverseIterator ¶
func (it *MockIndexTree) ReverseIterator(start, end []byte) Iterator
Create a backward iterator from the B-Tree
func (*MockIndexTree) Set ¶
func (it *MockIndexTree) Set(key []byte, v uint64)
func (*MockIndexTree) SetPruneHeight ¶
func (it *MockIndexTree) SetPruneHeight(h uint64)
type NVTreeMem ¶
type NVTreeMem struct {
// contains filtered or unexported fields
}
func NewNVTreeMem ¶
func (*NVTreeMem) ActiveCount ¶
func (*NVTreeMem) BeginWrite ¶
Begin the write phase of block execution
func (*NVTreeMem) Delete ¶
Delete a key-position record in B-Tree and RocksDB Write the historical record to RocksDB
func (*NVTreeMem) EndWrite ¶
func (tree *NVTreeMem) EndWrite()
End the write phase of block execution
func (*NVTreeMem) GetAtHeight ¶
Get the position of k, at the specified height.
func (*NVTreeMem) Init ¶
Load the RocksDB and use its up-to-date records to initialize the in-memory B-Tree. RocksDB's historical records are ignored.
func (*NVTreeMem) ReverseIterator ¶
Create a backward iterator from the B-Tree
type RocksDB ¶
type RocksDB struct {
// contains filtered or unexported fields
}
func NewRocksDBWithOptions ¶
func (*RocksDB) CloseOldBatch ¶
func (db *RocksDB) CloseOldBatch()
func (*RocksDB) GetPruneHeight ¶
func (*RocksDB) OpenNewBatch ¶
func (db *RocksDB) OpenNewBatch()
func (*RocksDB) ReverseIterator ¶
func (*RocksDB) SetPruneHeight ¶
Click to show internal directories.
Click to hide internal directories.