Documentation
¶
Index ¶
- Variables
- type BatchSession
- func (s *BatchSession) Close() error
- func (s *BatchSession) Commit() error
- func (s *BatchSession) Delete(k []byte) error
- func (s *BatchSession) DeleteRange(start []byte, end []byte) error
- func (s *BatchSession) Exists(k []byte) (bool, error)
- func (s *BatchSession) Get(k []byte) ([]byte, error)
- func (s *BatchSession) Insert(k, v []byte) error
- func (s *BatchSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
- func (s *BatchSession) Put(k, v []byte) error
- type Options
- type PebbleEngine
- func (s *PebbleEngine) CleanupTransientNamespaces() error
- func (s *PebbleEngine) Close() error
- func (s *PebbleEngine) DB() *pebble.DB
- func (s *PebbleEngine) LockSharedSnapshot()
- func (s *PebbleEngine) NewBatchSession() engine.Session
- func (s *PebbleEngine) NewSnapshotSession() engine.Session
- func (s *PebbleEngine) NewTransientSession() engine.Session
- func (s *PebbleEngine) Recover() error
- func (s *PebbleEngine) Rollback() error
- func (s *PebbleEngine) UnlockSharedSnapshot()
- type RollbackSegment
- type SnapshotSession
- func (s *SnapshotSession) Close() error
- func (s *SnapshotSession) Commit() error
- func (s *SnapshotSession) Delete(k []byte) error
- func (s *SnapshotSession) DeleteRange(start []byte, end []byte) error
- func (s *SnapshotSession) Exists(k []byte) (bool, error)
- func (s *SnapshotSession) Get(k []byte) ([]byte, error)
- func (s *SnapshotSession) Insert(k, v []byte) error
- func (s *SnapshotSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
- func (s *SnapshotSession) Put(k, v []byte) error
- type TransientSession
- func (s *TransientSession) Close() error
- func (s *TransientSession) Commit() error
- func (s *TransientSession) Delete(k []byte) error
- func (s *TransientSession) DeleteRange(start []byte, end []byte) error
- func (s *TransientSession) Exists(k []byte) (bool, error)
- func (s *TransientSession) Get(k []byte) ([]byte, error)
- func (s *TransientSession) Insert(k, v []byte) error
- func (s *TransientSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
- func (s *TransientSession) Put(k, v []byte) error
Constants ¶
This section is empty.
Variables ¶
var DefaultComparer = &pebble.Comparer{ Compare: func(a, b []byte) int { an := encoding.Split(a) bn := encoding.Split(b) if prefixCmp := bytes.Compare(a[:an], b[:bn]); prefixCmp != 0 { return prefixCmp } return encoding.Compare(a[an:], b[bn:]) }, Equal: encoding.Equal, AbbreviatedKey: encoding.AbbreviatedKey, FormatKey: pebble.DefaultComparer.FormatKey, Separator: encoding.Separator, Successor: func(dst, a []byte) []byte { return a }, Split: encoding.Split, ComparePointSuffixes: encoding.Compare, CompareRangeSuffixes: encoding.Compare, Name: "leveldb.BytewiseComparator", }
DefaultComparer is the default implementation of the Comparer interface for chai.
Functions ¶
This section is empty.
Types ¶
type BatchSession ¶
type BatchSession struct {
Store *PebbleEngine
DB *pebble.DB
Batch *pebble.Batch
// contains filtered or unexported fields
}
func (*BatchSession) Close ¶
func (s *BatchSession) Close() error
func (*BatchSession) Commit ¶
func (s *BatchSession) Commit() error
func (*BatchSession) Delete ¶
func (s *BatchSession) Delete(k []byte) error
Delete a record by key. If the key doesn't exist, it doesn't do anything.
func (*BatchSession) DeleteRange ¶
func (s *BatchSession) DeleteRange(start []byte, end []byte) error
DeleteRange deletes all keys in the given range. This implementation deletes all keys one by one to simplify the rollback.
func (*BatchSession) Exists ¶
func (s *BatchSession) Exists(k []byte) (bool, error)
Exists returns whether a key exists and is visible by the current session.
func (*BatchSession) Get ¶
func (s *BatchSession) Get(k []byte) ([]byte, error)
Get returns a value associated with the given key. If not found, returns ErrKeyNotFound.
func (*BatchSession) Insert ¶
func (s *BatchSession) Insert(k, v []byte) error
Insert inserts a key-value pair. If it already exists, it returns ErrKeyAlreadyExists.
func (*BatchSession) Iterator ¶
func (s *BatchSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
func (*BatchSession) Put ¶
func (s *BatchSession) Put(k, v []byte) error
Put stores a key value pair. If it already exists, it overrides it.
type PebbleEngine ¶ added in v0.17.0
type PebbleEngine struct {
// contains filtered or unexported fields
}
func NewEngineWith ¶
func (*PebbleEngine) CleanupTransientNamespaces ¶ added in v0.17.0
func (s *PebbleEngine) CleanupTransientNamespaces() error
func (*PebbleEngine) Close ¶ added in v0.17.0
func (s *PebbleEngine) Close() error
func (*PebbleEngine) DB ¶ added in v0.17.0
func (s *PebbleEngine) DB() *pebble.DB
func (*PebbleEngine) LockSharedSnapshot ¶ added in v0.17.0
func (s *PebbleEngine) LockSharedSnapshot()
func (*PebbleEngine) NewBatchSession ¶ added in v0.17.0
func (s *PebbleEngine) NewBatchSession() engine.Session
func (*PebbleEngine) NewSnapshotSession ¶ added in v0.17.0
func (s *PebbleEngine) NewSnapshotSession() engine.Session
func (*PebbleEngine) NewTransientSession ¶ added in v0.17.0
func (s *PebbleEngine) NewTransientSession() engine.Session
func (*PebbleEngine) Recover ¶ added in v0.17.0
func (s *PebbleEngine) Recover() error
func (*PebbleEngine) Rollback ¶ added in v0.17.0
func (s *PebbleEngine) Rollback() error
func (*PebbleEngine) UnlockSharedSnapshot ¶ added in v0.17.0
func (s *PebbleEngine) UnlockSharedSnapshot()
type RollbackSegment ¶
type RollbackSegment struct {
// contains filtered or unexported fields
}
func NewRollbackSegment ¶
func NewRollbackSegment(db *pebble.DB, namespace int64) *RollbackSegment
func (*RollbackSegment) Reset ¶
func (s *RollbackSegment) Reset() error
func (*RollbackSegment) Rollback ¶
func (s *RollbackSegment) Rollback() error
type SnapshotSession ¶
type SnapshotSession struct {
Store *PebbleEngine
Snapshot *snapshot
// contains filtered or unexported fields
}
func (*SnapshotSession) Close ¶
func (s *SnapshotSession) Close() error
func (*SnapshotSession) Commit ¶
func (s *SnapshotSession) Commit() error
func (*SnapshotSession) Delete ¶
func (s *SnapshotSession) Delete(k []byte) error
Delete a record by key. If not found, returns ErrKeyNotFound.
func (*SnapshotSession) DeleteRange ¶
func (s *SnapshotSession) DeleteRange(start []byte, end []byte) error
func (*SnapshotSession) Exists ¶
func (s *SnapshotSession) Exists(k []byte) (bool, error)
Exists returns whether a key exists and is visible by the current session.
func (*SnapshotSession) Get ¶
func (s *SnapshotSession) Get(k []byte) ([]byte, error)
Get returns a value associated with the given key. If not found, returns ErrKeyNotFound.
func (*SnapshotSession) Insert ¶
func (s *SnapshotSession) Insert(k, v []byte) error
func (*SnapshotSession) Iterator ¶
func (s *SnapshotSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
func (*SnapshotSession) Put ¶
func (s *SnapshotSession) Put(k, v []byte) error
type TransientSession ¶
type TransientSession struct {
// contains filtered or unexported fields
}
func (*TransientSession) Close ¶
func (s *TransientSession) Close() error
func (*TransientSession) Commit ¶
func (s *TransientSession) Commit() error
func (*TransientSession) Delete ¶
func (s *TransientSession) Delete(k []byte) error
Delete a record by key. If not found, returns ErrKeyNotFound.
func (*TransientSession) DeleteRange ¶
func (s *TransientSession) DeleteRange(start []byte, end []byte) error
func (*TransientSession) Exists ¶
func (s *TransientSession) Exists(k []byte) (bool, error)
Exists returns whether a key exists and is visible by the current session.
func (*TransientSession) Get ¶
func (s *TransientSession) Get(k []byte) ([]byte, error)
Get returns a value associated with the given key. If not found, returns ErrKeyNotFound.
func (*TransientSession) Insert ¶
func (s *TransientSession) Insert(k, v []byte) error
func (*TransientSession) Iterator ¶
func (s *TransientSession) Iterator(opts *engine.IterOptions) (engine.Iterator, error)
func (*TransientSession) Put ¶
func (s *TransientSession) Put(k, v []byte) error
Put stores a key value pair. If it already exists, it overrides it.