remote

package
v0.1.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Put

func (b *NopRemoteBatch) Put(key []byte, value []byte) error

func (*NopRemoteBatch) Replay

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) Reset

func (b *RemoteBatch) Reset()

Reset resets the batch for reuse.

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) Close

func (d *RemoteDatabase) Close() error

Close disconnect the tikv

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

func (*RemoteDatabase) Stat

func (d *RemoteDatabase) Stat(property string) (string, error)

Stat returns a particular internal stat of the database.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL