membatchwithdb

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryDiff

type MemoryDiff struct {
	// contains filtered or unexported fields
}

func (*MemoryDiff) Flush

func (m *MemoryDiff) Flush(tx kv.RwTx) error

type MemoryMutation

type MemoryMutation struct {
	// contains filtered or unexported fields
}

func NewMemoryBatch

func NewMemoryBatch(tx kv.Tx, tmpDir string) *MemoryMutation

NewMemoryBatch - starts in-mem batch

Common pattern:

batch := NewMemoryBatch(db, tmpDir) defer batch.Close() ... some calculations on `batch` batch.Commit()

func NewMemoryBatchWithCustomDB

func NewMemoryBatchWithCustomDB(tx kv.Tx, db kv.RwDB, uTx kv.RwTx, tmpDir string) *MemoryMutation

func (*MemoryMutation) Append

func (m *MemoryMutation) Append(table string, key []byte, value []byte) error

func (*MemoryMutation) AppendDup

func (m *MemoryMutation) AppendDup(table string, key []byte, value []byte) error

func (*MemoryMutation) BucketSize

func (m *MemoryMutation) BucketSize(bucket string) (uint64, error)

func (*MemoryMutation) CHandle

func (m *MemoryMutation) CHandle() unsafe.Pointer

func (*MemoryMutation) ClearBucket

func (m *MemoryMutation) ClearBucket(bucket string) error

func (*MemoryMutation) Close

func (m *MemoryMutation) Close()

func (*MemoryMutation) CollectMetrics

func (m *MemoryMutation) CollectMetrics()

func (*MemoryMutation) Commit

func (m *MemoryMutation) Commit() error

func (*MemoryMutation) CreateBucket

func (m *MemoryMutation) CreateBucket(bucket string) error

func (*MemoryMutation) Cursor

func (m *MemoryMutation) Cursor(bucket string) (kv.Cursor, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) CursorDupSort

func (m *MemoryMutation) CursorDupSort(bucket string) (kv.CursorDupSort, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) DBSize

func (m *MemoryMutation) DBSize() (uint64, error)

func (*MemoryMutation) Delete

func (m *MemoryMutation) Delete(table string, k []byte) error

func (*MemoryMutation) Diff

func (m *MemoryMutation) Diff() (*MemoryDiff, error)

func (*MemoryMutation) DropBucket

func (m *MemoryMutation) DropBucket(bucket string) error

func (*MemoryMutation) ExistsBucket

func (m *MemoryMutation) ExistsBucket(bucket string) (bool, error)

func (*MemoryMutation) Flush

func (m *MemoryMutation) Flush(tx kv.RwTx) error

func (*MemoryMutation) ForAmount

func (m *MemoryMutation) ForAmount(bucket string, prefix []byte, amount uint32, walker func(k, v []byte) error) error

func (*MemoryMutation) ForEach

func (m *MemoryMutation) ForEach(bucket string, fromPrefix []byte, walker func(k, v []byte) error) error

func (*MemoryMutation) ForPrefix

func (m *MemoryMutation) ForPrefix(bucket string, prefix []byte, walker func(k, v []byte) error) error

func (*MemoryMutation) GetOne

func (m *MemoryMutation) GetOne(table string, key []byte) ([]byte, error)

Can only be called from the worker thread

func (*MemoryMutation) Has

func (m *MemoryMutation) Has(table string, key []byte) (bool, error)

Has return whether a key is present in a certain table.

func (*MemoryMutation) IncrementSequence

func (m *MemoryMutation) IncrementSequence(bucket string, amount uint64) (uint64, error)

func (*MemoryMutation) Last

func (m *MemoryMutation) Last(table string) ([]byte, []byte, error)

func (*MemoryMutation) ListBuckets

func (m *MemoryMutation) ListBuckets() ([]string, error)

func (*MemoryMutation) MemDB

func (m *MemoryMutation) MemDB() kv.RwDB

func (*MemoryMutation) MemTx

func (m *MemoryMutation) MemTx() kv.RwTx

func (*MemoryMutation) Prefix

func (m *MemoryMutation) Prefix(table string, prefix []byte) (iter.KV, error)

func (*MemoryMutation) Put

func (m *MemoryMutation) Put(table string, k, v []byte) error

func (*MemoryMutation) Range

func (m *MemoryMutation) Range(table string, fromPrefix, toPrefix []byte) (iter.KV, error)

func (*MemoryMutation) RangeAscend

func (m *MemoryMutation) RangeAscend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) RangeDescend

func (m *MemoryMutation) RangeDescend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) RangeDupSort

func (m *MemoryMutation) RangeDupSort(table string, key []byte, fromPrefix, toPrefix []byte, asc order.By, limit int) (iter.KV, error)

func (*MemoryMutation) ReadSequence

func (m *MemoryMutation) ReadSequence(bucket string) (uint64, error)

func (*MemoryMutation) Rollback

func (m *MemoryMutation) Rollback()

func (*MemoryMutation) RwCursor

func (m *MemoryMutation) RwCursor(bucket string) (kv.RwCursor, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) RwCursorDupSort

func (m *MemoryMutation) RwCursorDupSort(bucket string) (kv.RwCursorDupSort, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) Stream

func (m *MemoryMutation) Stream(table string, fromPrefix, toPrefix []byte) (iter.KV, error)

func (*MemoryMutation) StreamAscend

func (m *MemoryMutation) StreamAscend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) StreamDescend

func (m *MemoryMutation) StreamDescend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) UpdateTxn

func (m *MemoryMutation) UpdateTxn(tx kv.Tx)

func (*MemoryMutation) ViewID

func (m *MemoryMutation) ViewID() uint64

type NextType

type NextType int
const (
	Normal NextType = iota
	Dup
	NoDup
)

Jump to

Keyboard shortcuts

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