Documentation ¶
Index ¶
- type LeveldbShard
- func (l *LeveldbShard) Close() error
- func (l *LeveldbShard) Compact(start []byte, limit []byte) (err error)
- func (l *LeveldbShard) Delete(key []byte) error
- func (l *LeveldbShard) Get(key []byte) ([]byte, error)
- func (l *LeveldbShard) Has(key []byte) (bool, error)
- func (l *LeveldbShard) NewBatch() ethdb.Batch
- func (l *LeveldbShard) NewIterator() ethdb.Iterator
- func (l *LeveldbShard) NewIteratorWithPrefix(prefix []byte) ethdb.Iterator
- func (l *LeveldbShard) NewIteratorWithStart(start []byte) ethdb.Iterator
- func (l *LeveldbShard) Put(key []byte, value []byte) error
- func (l *LeveldbShard) Stat(property string) (string, error)
- type LeveldbShardBatch
- func (l *LeveldbShardBatch) Delete(key []byte) error
- func (l *LeveldbShardBatch) Put(key []byte, value []byte) error
- func (l *LeveldbShardBatch) Replay(w ethdb.KeyValueWriter) error
- func (l *LeveldbShardBatch) Reset()
- func (l *LeveldbShardBatch) ValueSize() int
- func (l *LeveldbShardBatch) Write() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeveldbShard ¶
type LeveldbShard struct {
// contains filtered or unexported fields
}
func NewLeveldbShard ¶
func NewLeveldbShard(savePath string, diskCount int, diskShards int) (shard *LeveldbShard, err error)
func (*LeveldbShard) Compact ¶
func (l *LeveldbShard) Compact(start []byte, limit []byte) (err error)
Compact flattens the underlying data store for the given key range. In essence, deleted and overwritten versions are discarded, and the data is rearranged to reduce the cost of operations needed to access them.
A nil start is treated as a key before all keys in the data store; a nil limit is treated as a key after all keys in the data store. If both is nil then it will compact entire data store.
func (*LeveldbShard) Delete ¶
func (l *LeveldbShard) Delete(key []byte) error
Delete removes the key from the key-value data store.
func (*LeveldbShard) Get ¶
func (l *LeveldbShard) Get(key []byte) ([]byte, error)
Get retrieves the given key if it's present in the key-value data store.
func (*LeveldbShard) Has ¶
func (l *LeveldbShard) Has(key []byte) (bool, error)
Has retrieves if a key is present in the key-value data store.
func (*LeveldbShard) NewBatch ¶
func (l *LeveldbShard) NewBatch() ethdb.Batch
NewBatch creates a write-only database that buffers changes to its host db until a final write is called.
func (*LeveldbShard) NewIterator ¶
func (l *LeveldbShard) NewIterator() ethdb.Iterator
NewIterator creates a binary-alphabetical iterator over the entire keyspace contained within the key-value database.
func (*LeveldbShard) NewIteratorWithPrefix ¶
func (l *LeveldbShard) NewIteratorWithPrefix(prefix []byte) ethdb.Iterator
NewIteratorWithPrefix creates a binary-alphabetical iterator over a subset of database content with a particular key prefix.
func (*LeveldbShard) NewIteratorWithStart ¶
func (l *LeveldbShard) NewIteratorWithStart(start []byte) ethdb.Iterator
NewIteratorWithStart creates a binary-alphabetical iterator over a subset of database content starting at a particular initial key (or after, if it does not exist).
type LeveldbShardBatch ¶
type LeveldbShardBatch struct {
// contains filtered or unexported fields
}
func NewLeveldbShardBatch ¶
func NewLeveldbShardBatch(shard *LeveldbShard) *LeveldbShardBatch
func (*LeveldbShardBatch) Delete ¶
func (l *LeveldbShardBatch) Delete(key []byte) error
Delete removes the key from the key-value data store.
func (*LeveldbShardBatch) Put ¶
func (l *LeveldbShardBatch) Put(key []byte, value []byte) error
Put inserts the given value into the key-value data store.
func (*LeveldbShardBatch) Replay ¶
func (l *LeveldbShardBatch) Replay(w ethdb.KeyValueWriter) error
Replay replays the batch contents.
func (*LeveldbShardBatch) Reset ¶
func (l *LeveldbShardBatch) Reset()
Reset resets the batch for reuse.
func (*LeveldbShardBatch) ValueSize ¶
func (l *LeveldbShardBatch) ValueSize() int
ValueSize retrieves the amount of data queued up for writing.
func (*LeveldbShardBatch) Write ¶
func (l *LeveldbShardBatch) Write() (err error)
Write flushes any accumulated data to disk.