Documentation ¶
Index ¶
- Variables
- type NopRemoteBatch
- type RemoteBatch
- type RemoteDatabase
- func (d *RemoteDatabase) Close() error
- func (d *RemoteDatabase) Compact(start []byte, limit []byte) error
- func (d *RemoteDatabase) Delete(key []byte) error
- func (d *RemoteDatabase) Get(key []byte) ([]byte, error)
- func (d *RemoteDatabase) Has(key []byte) (bool, error)
- func (d *RemoteDatabase) NewBatch() ethdb.Batch
- func (d *RemoteDatabase) NewIterator(start, end []byte) ethdb.Iterator
- func (d *RemoteDatabase) Put(key []byte, value []byte) error
- func (d *RemoteDatabase) ReadOnly()
- func (d *RemoteDatabase) Stat(property string) (string, error)
- type RemoteIterator
Constants ¶
This section is empty.
Variables ¶
var EmptyValueStub = []byte("HarmonyTiKVEmptyValueStub")
Functions ¶
This section is empty.
Types ¶
type NopRemoteBatch ¶
type NopRemoteBatch struct { }
NopRemoteBatch on readonly mode, write operator will be reject
func (*NopRemoteBatch) Delete ¶
func (b *NopRemoteBatch) Delete(key []byte) error
func (*NopRemoteBatch) Replay ¶
func (b *NopRemoteBatch) Replay(w ethdb.KeyValueWriter) error
func (*NopRemoteBatch) Reset ¶
func (b *NopRemoteBatch) Reset()
func (*NopRemoteBatch) ValueSize ¶
func (b *NopRemoteBatch) ValueSize() int
func (*NopRemoteBatch) Write ¶
func (b *NopRemoteBatch) Write() error
type RemoteBatch ¶
type RemoteBatch struct {
// contains filtered or unexported fields
}
func (*RemoteBatch) Delete ¶
func (b *RemoteBatch) Delete(key []byte) error
Delete removes the key from the key-value data store.
func (*RemoteBatch) Put ¶
func (b *RemoteBatch) Put(key []byte, value []byte) error
Put inserts the given value into the key-value data store.
func (*RemoteBatch) Replay ¶
func (b *RemoteBatch) Replay(w ethdb.KeyValueWriter) error
Replay replays the batch contents.
func (*RemoteBatch) ValueSize ¶
func (b *RemoteBatch) ValueSize() int
ValueSize retrieves the amount of data queued up for writing.
func (*RemoteBatch) Write ¶
func (b *RemoteBatch) Write() error
Write flushes any accumulated data to disk.
type RemoteDatabase ¶
type RemoteDatabase struct {
// contains filtered or unexported fields
}
func NewRemoteDatabase ¶
func NewRemoteDatabase(pdAddr []string, readOnly bool) (*RemoteDatabase, error)
func (*RemoteDatabase) Compact ¶
func (d *RemoteDatabase) Compact(start []byte, limit []byte) error
Compact tikv current not supprot manual compact
func (*RemoteDatabase) Delete ¶
func (d *RemoteDatabase) Delete(key []byte) error
Delete removes the key from the key-value data store.
func (*RemoteDatabase) Get ¶
func (d *RemoteDatabase) Get(key []byte) ([]byte, error)
Get retrieves the given key if it's present in the key-value data store.
func (*RemoteDatabase) Has ¶
func (d *RemoteDatabase) Has(key []byte) (bool, error)
Has retrieves if a key is present in the key-value data store.
func (*RemoteDatabase) NewBatch ¶
func (d *RemoteDatabase) NewBatch() ethdb.Batch
NewBatch creates a write-only database that buffers changes to its host db until a final write is called.
func (*RemoteDatabase) NewIterator ¶
func (d *RemoteDatabase) NewIterator(start, end []byte) ethdb.Iterator
func (*RemoteDatabase) Put ¶
func (d *RemoteDatabase) Put(key []byte, value []byte) error
Put inserts the given value into the key-value data store.
func (*RemoteDatabase) ReadOnly ¶
func (d *RemoteDatabase) ReadOnly()
ReadOnly set storage to readonly mode
type RemoteIterator ¶
type RemoteIterator struct {
// contains filtered or unexported fields
}
func (*RemoteIterator) Error ¶
func (i *RemoteIterator) Error() error
Error returns any accumulated error. Exhausting all the key/value pairs is not considered to be an error.
func (*RemoteIterator) Key ¶
func (i *RemoteIterator) Key() []byte
Key returns the key of the current key/value pair, or nil if done. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.
func (*RemoteIterator) Next ¶
func (i *RemoteIterator) Next() bool
Next moves the iterator to the next key/value pair. It returns whether the iterator is exhausted.
func (*RemoteIterator) Release ¶
func (i *RemoteIterator) Release()
Release releases associated resources. Release should always succeed and can be called multiple times without causing error.
func (*RemoteIterator) Value ¶
func (i *RemoteIterator) Value() []byte
Value returns the value of the current key/value pair, or nil if done. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.