block_stm

package module
v0.0.0-...-3c60e0c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

README

go-block-stm

Documentation

Index

Constants

View Source
const (
	ReadKindMap     = 0
	ReadKindStorage = 1
)
View Source
const FlagDone = 0
View Source
const FlagEstimate = 1

Variables

View Source
var (
	ErrLowerIncarnation   = errors.New("existing transaction value does not have lower incarnation")
	ErrInvalidKeyCellPath = errors.New("invalid key cell path, must already exist")
)

Functions

This section is empty.

Types

type BaseReadWrite

type BaseReadWrite interface {
	Read(k []byte) (v []byte, error error)
	Write(k, v []byte) error
}

type ExecResult

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

type ExecTask

type ExecTask interface {
	Execute(rw BaseReadWrite) error
}

type ExecVersionView

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

func (*ExecVersionView) Execute

func (ev *ExecVersionView) Execute() (er ExecResult)

func (*ExecVersionView) Read

func (ev *ExecVersionView) Read(k []byte) (v []byte, err error)

func (*ExecVersionView) Write

func (ev *ExecVersionView) Write(k, v []byte) error

type MVHashMap

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

func MakeMVHashMap

func MakeMVHashMap() *MVHashMap

func (*MVHashMap) Delete

func (mv *MVHashMap) Delete(k []byte, txIdx int)

func (*MVHashMap) MarkEstimate

func (mv *MVHashMap) MarkEstimate(k []byte, txIdx int)

func (*MVHashMap) Read

func (mv *MVHashMap) Read(k []byte, txIdx int) (res mvReadResult)

arguments: memory location and the transaction index returns: mvReadResult

func (*MVHashMap) Write

func (mv *MVHashMap) Write(k []byte, v Version, data []byte)

arguments: memory location, Version, data returns: mvReadResult

type ReadDescriptor

type ReadDescriptor struct {
	Path []byte
	Kind int
	V    Version
}

type Scheduler

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

func MakeScheduler

func MakeScheduler() *Scheduler

func (*Scheduler) Done

func (s *Scheduler) Done() bool

func (*Scheduler) NextTask

func (s *Scheduler) NextTask() SchedulerTask

type SchedulerTask

type SchedulerTask interface{}

type SchedulerTaskDone

type SchedulerTaskDone struct{}

type TxnIndexCells

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

Structure of tm (treemap): Key: TxnIndex Value: &WriteCell example: map[10:&{0 1 [53 48 101 114 58 49 49 101 114 58 53 101 114]}] map[TxnIndex:&{flag incarnation data}]

type TxnInput

type TxnInput []ReadDescriptor

type TxnInputOutput

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

func ExecuteParallel

func ExecuteParallel(tasks []ExecTask, rw BaseReadWrite) (lastTxIO *TxnInputOutput, err error)

func MakeTxnInputOutput

func MakeTxnInputOutput(numTx int) *TxnInputOutput

type TxnOutput

type TxnOutput []WriteDescriptor

type Version

type Version struct {
	TxnIndex    int
	Incarnation int
}

type WriteCell

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

type WriteDescriptor

type WriteDescriptor struct {
	Path []byte
	V    Version
	Val  []byte
}

Jump to

Keyboard shortcuts

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