Documentation ¶
Index ¶
- Constants
- func Repair(opts *config.OpenkvOptions) (err error)
- type BatchData
- type BatchReplayItem
- type DB
- func (m *DB) Close() error
- func (db *DB) Compact() error
- func (db *DB) Delete(key []byte) error
- func (db *DB) Get(key []byte) ([]byte, error)
- func (db *DB) GetSlice(key []byte) (openkvDriver.ISlice, error)
- func (m *DB) NewIterator() *Iterator
- func (db *DB) NewSnapshot() (*Snapshot, error)
- func (db *DB) NewWriteBatch() *WriteBatch
- func (db *DB) Put(key []byte, value []byte) error
- func (db *DB) RangeIterator(min []byte, max []byte, rangeType driver.RangeType) *RangeLimitIterator
- func (db *DB) RangeLimitIterator(min []byte, max []byte, rangeType driver.RangeType, offset int, count int) *RangeLimitIterator
- func (db *DB) RevRangeIterator(min []byte, max []byte, rangeType driver.RangeType) *RangeLimitIterator
- func (db *DB) RevRangeLimitIterator(min []byte, max []byte, rangeType driver.RangeType, offset int, count int) *RangeLimitIterator
- func (m *DB) String() string
- type Iterator
- func (m *Iterator) BufKey(b []byte) []byte
- func (m *Iterator) BufValue(b []byte) []byte
- func (m *Iterator) Close()
- func (m *Iterator) Find(key []byte) []byte
- func (m *Iterator) Key() []byte
- func (m *Iterator) Next()
- func (m *Iterator) Prev()
- func (m *Iterator) RawFind(key []byte) []byte
- func (m *Iterator) RawKey() []byte
- func (m *Iterator) RawValue() []byte
- func (m *Iterator) Seek(key []byte)
- func (m *Iterator) SeekToFirst()
- func (m *Iterator) SeekToLast()
- func (m *Iterator) Valid() bool
- func (m *Iterator) Value() []byte
- type Limit
- type Range
- type RangeLimitIterator
- type Snapshot
- type WriteBatch
Constants ¶
const ( IteratorForward uint8 = 0 IteratorBackward uint8 = 1 )
Variables ¶
This section is empty.
Functions ¶
func Repair ¶
func Repair(opts *config.OpenkvOptions) (err error)
Types ¶
type BatchData ¶
BatchData use it(levedb.Batch) just for data kvStore WriteBatch to commit from log store data , don't use put/delete key,val again for WriteBatch to commit when load from Batch Data to WriteBatch commit load raw data([]byte) to BatchData dump BatchData to raw data([]byte) replay BatchData to WriteBatch impl which use Put/Delete op
func NewBatchData ¶
func (*BatchData) Data ¶
Data dump BatchData format []data (kt|klen|key|vlen|value)... -> raw data([]byte)
func (*BatchData) Replay ¶
func (d *BatchData) Replay(impl leveldb.BatchReplay) error
Replay batch data for leveldb.BatchReplay impl put/delete op like relay log to replay some w(insert/update/delete) op (CDC)
func (*BatchData) ReplayItems ¶
func (d *BatchData) ReplayItems() ([]BatchReplayItem, error)
type BatchReplayItem ¶
type BatchReplayItem struct {
// contains filtered or unexported fields
}
type DB ¶
type DB struct { // kv op interface openkvDriver.IDB // contains filtered or unexported fields }
DB wrap driver.IDB interface op impl IKV
func (*DB) GetSlice ¶
func (db *DB) GetSlice(key []byte) (openkvDriver.ISlice, error)
GetSlice wrap to adapte diff language kv store get op
func (*DB) NewIterator ¶
func (*DB) NewSnapshot ¶
func (*DB) NewWriteBatch ¶
func (db *DB) NewWriteBatch() *WriteBatch
func (*DB) RangeIterator ¶
RangeIterator
func (*DB) RangeLimitIterator ¶
func (db *DB) RangeLimitIterator(min []byte, max []byte, rangeType driver.RangeType, offset int, count int) *RangeLimitIterator
RangeLimitIterator count < 0, unlimit. offset must >= 0, if < 0, will get nothing.
func (*DB) RevRangeIterator ¶
func (db *DB) RevRangeIterator(min []byte, max []byte, rangeType driver.RangeType) *RangeLimitIterator
RevRangeIterator
func (*DB) RevRangeLimitIterator ¶
func (db *DB) RevRangeLimitIterator(min []byte, max []byte, rangeType driver.RangeType, offset int, count int) *RangeLimitIterator
RevRangeLimitIterator count < 0, unlimit. offset must >= 0, if < 0, will get nothing.
type Iterator ¶
Iterator wrap driver.IIterator, base iter
func (*Iterator) RawFind ¶
RawFind finds by key, if not found, nil returns, else a reference of value returns. you must be careful that it will be changed after next iterate.
func (*Iterator) RawKey ¶
RawKey returns a reference of key. you must be careful that it will be changed after next iterate.
func (*Iterator) RawValue ¶
RawValue returns a reference of value. you must be careful that it will be changed after next iterate.
func (*Iterator) SeekToFirst ¶
func (m *Iterator) SeekToFirst()
func (*Iterator) SeekToLast ¶
func (m *Iterator) SeekToLast()
type RangeLimitIterator ¶
type RangeLimitIterator struct { *Iterator // contains filtered or unexported fields }
func NewRangeIterator ¶
func NewRangeIterator(i *Iterator, r *Range) *RangeLimitIterator
func NewRangeLimitIterator ¶
func NewRangeLimitIterator(i *Iterator, r *Range, l *Limit) *RangeLimitIterator
func NewRevRangeIterator ¶
func NewRevRangeIterator(i *Iterator, r *Range) *RangeLimitIterator
func NewRevRangeLimitIterator ¶
func NewRevRangeLimitIterator(i *Iterator, r *Range, l *Limit) *RangeLimitIterator
func (*RangeLimitIterator) Next ¶
func (it *RangeLimitIterator) Next()
func (*RangeLimitIterator) Valid ¶
func (it *RangeLimitIterator) Valid() bool
type WriteBatch ¶
type WriteBatch struct { driver.IWriteBatch // contains filtered or unexported fields }
WriteBatch wrap driver.IWriteBatch interface op
func (*WriteBatch) BatchData ¶
func (wb *WriteBatch) BatchData() *BatchData
BatchData the data will be undefined after commit or rollback get from kvstore WriteBatch Data([]byte) load(no cp slice) to BatchData, in order to save to log store
func (*WriteBatch) Close ¶
func (m *WriteBatch) Close()
func (*WriteBatch) Commit ¶
func (m *WriteBatch) Commit() (err error)
func (*WriteBatch) Data ¶
func (wb *WriteBatch) Data() []byte
Data load from kvstort Data() to BatchData, then dump BatchData,return raw data []byte Batch data format: (kt|klen|key|vlen|value)
func (*WriteBatch) Delete ¶
func (m *WriteBatch) Delete(key []byte)
func (*WriteBatch) Put ¶
func (m *WriteBatch) Put(key []byte, value []byte)
func (*WriteBatch) Rollback ¶
func (m *WriteBatch) Rollback() error