membatch

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapmutation

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

func NewHashBatch

func NewHashBatch(tx kv.Tx, quit <-chan struct{}, tmpdir string, logger log.Logger) *Mapmutation

NewBatch - starts in-mem batch

Common pattern:

batch := db.NewBatch() defer batch.Close() ... some calculations on `batch` batch.Commit()

func (*Mapmutation) Append

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

func (*Mapmutation) AppendDup

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

func (*Mapmutation) BatchSize

func (m *Mapmutation) BatchSize() int

func (*Mapmutation) Close

func (m *Mapmutation) Close()

func (*Mapmutation) Commit

func (m *Mapmutation) Commit() error

func (*Mapmutation) Delete

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

func (*Mapmutation) Flush

func (m *Mapmutation) Flush(ctx context.Context, tx kv.RwTx) error

func (*Mapmutation) ForAmount

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

func (*Mapmutation) ForEach

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

func (*Mapmutation) ForPrefix

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

func (*Mapmutation) GetOne

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

Can only be called from the worker thread

func (*Mapmutation) Has

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

func (*Mapmutation) IncrementSequence

func (m *Mapmutation) IncrementSequence(bucket string, amount uint64) (res uint64, err error)

func (*Mapmutation) Last

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

func (*Mapmutation) Put

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

puts a table key with a value and if the table is not found then it appends a table

func (*Mapmutation) ReadSequence

func (m *Mapmutation) ReadSequence(bucket string) (res uint64, err error)

func (*Mapmutation) Rollback

func (m *Mapmutation) Rollback()

Jump to

Keyboard shortcuts

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