Documentation
¶
Index ¶
- Constants
- Variables
- type Bool
- type Bytes
- type DiffIter
- type Float
- type ID
- type IndexEntry
- type IndexIter
- type Int
- type IsolationPolicy
- type Nullable
- type PhysicalRow
- func (p *PhysicalRow[K, V]) Delete(now Time, tx *Transaction) (newRow *PhysicalRow[K, V], version *Version[V], err error)
- func (p *PhysicalRow[K, V]) Insert(now Time, tx *Transaction, value V) (newRow *PhysicalRow[K, V], version *Version[V], err error)
- func (p *PhysicalRow[K, V]) Read(now Time, tx *Transaction) (value V, err error)
- func (p *PhysicalRow[K, V]) Update(now Time, tx *Transaction, newValue V) (newRow *PhysicalRow[K, V], version *Version[V], err error)
- type ReadPolicy
- type ReverseIndexEntry
- type Row
- type Table
- func (t *Table[K, V, R]) AbortTx(tx *Transaction) error
- func (t *Table[K, V, R]) CommitTx(tx *Transaction) error
- func (t *Table[K, V, R]) Delete(tx *Transaction, key K) error
- func (t *Table[K, V, R]) Dump(out io.Writer)
- func (t *Table[K, V, R]) FilterVersions(filterFunc func(K, []Version[V]) ([]Version[V], error)) error
- func (t *Table[K, V, R]) Get(tx *Transaction, key K) (value V, err error)
- func (t *Table[K, V, R]) Index(tx *Transaction, index Tuple) (entries []*IndexEntry[K, V], err error)
- func (t *Table[K, V, R]) Insert(tx *Transaction, row R) error
- func (t *Table[K, V, R]) NewDiffIter(fromTime, toTime *Time) *DiffIter[K, V]
- func (t *Table[K, V, R]) NewIndexIter(tx *Transaction, min Tuple, max Tuple) *IndexIter[K, V]
- func (t *Table[K, V, R]) NewIter(tx *Transaction) *TableIter[K, V]
- func (t *Table[K, V, R]) Update(tx *Transaction, row R) error
- func (t *Table[K, V, R]) Upsert(tx *Transaction, row R) error
- type TableIter
- type Text
- type Time
- type Transaction
- type TransactionState
- type Tuple
- type TxCommitter
- type Uint
- type Version
- type WriteEntry
Constants ¶
View Source
const ( Active = iota Committed Aborted )
Variables ¶
View Source
var ( ToOrdered = memorytable.ToOrdered TypeMatch = memorytable.TypeMatch Min = memorytable.Min Max = memorytable.Max )
View Source
var Serializable = IsolationPolicy{ Read: ReadNoStale, }
View Source
var SnapshotIsolation = IsolationPolicy{ Read: ReadSnapshot, }
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool = memorytable.Bool
type Bytes ¶
type Bytes = memorytable.Bytes
type DiffIter ¶
type DiffIter[ K memorytable.Ordered[K], V any, ] struct { // contains filtered or unexported fields }
type Float ¶
type Float = memorytable.Float
type ID ¶
type ID = memoryengine.ID
type IndexEntry ¶
type IndexEntry[ K memorytable.Ordered[K], V any, ] struct { Index Tuple Key K VersionID int64 }
type IndexIter ¶
type IndexIter[ K memorytable.Ordered[K], V any, ] struct { // contains filtered or unexported fields }
func (*IndexIter[K, V]) Item ¶
func (i *IndexIter[K, V]) Item() *IndexEntry[K, V]
type Int ¶
type Int = memorytable.Int
type IsolationPolicy ¶
type IsolationPolicy struct {
Read ReadPolicy
}
type Nullable ¶
type Nullable = memorytable.Nullable
type PhysicalRow ¶
type PhysicalRow[ K memorytable.Ordered[K], V any, ] struct { Key K LastUpdate time.Time Versions []Version[V] }
func (*PhysicalRow[K, V]) Delete ¶
func (p *PhysicalRow[K, V]) Delete( now Time, tx *Transaction, ) ( newRow *PhysicalRow[K, V], version *Version[V], err error, )
func (*PhysicalRow[K, V]) Insert ¶
func (p *PhysicalRow[K, V]) Insert( now Time, tx *Transaction, value V, ) ( newRow *PhysicalRow[K, V], version *Version[V], err error, )
func (*PhysicalRow[K, V]) Read ¶
func (p *PhysicalRow[K, V]) Read(now Time, tx *Transaction) (value V, err error)
Read reads the visible value from Values readTime's logical time should be monotonically increasing in one transaction to reflect commands order
func (*PhysicalRow[K, V]) Update ¶
func (p *PhysicalRow[K, V]) Update( now Time, tx *Transaction, newValue V, ) ( newRow *PhysicalRow[K, V], version *Version[V], err error, )
type ReadPolicy ¶
type ReadPolicy uint8
const ( ReadCommitted ReadPolicy = iota + 1 ReadSnapshot ReadNoStale )
type ReverseIndexEntry ¶
type ReverseIndexEntry[ K memorytable.Ordered[K], V any, ] struct { Key K VersionID int64 Index Tuple }
type Table ¶
type Table[ K memorytable.Ordered[K], V any, R Row[K, V], ] struct { sync.Mutex // contains filtered or unexported fields }
func (*Table[K, V, R]) AbortTx ¶
func (t *Table[K, V, R]) AbortTx(tx *Transaction) error
func (*Table[K, V, R]) CommitTx ¶
func (t *Table[K, V, R]) CommitTx(tx *Transaction) error
func (*Table[K, V, R]) Delete ¶
func (t *Table[K, V, R]) Delete( tx *Transaction, key K, ) error
func (*Table[K, V, R]) FilterVersions ¶
func (*Table[K, V, R]) Get ¶
func (t *Table[K, V, R]) Get( tx *Transaction, key K, ) ( value V, err error, )
func (*Table[K, V, R]) Index ¶
func (t *Table[K, V, R]) Index(tx *Transaction, index Tuple) (entries []*IndexEntry[K, V], err error)
func (*Table[K, V, R]) Insert ¶
func (t *Table[K, V, R]) Insert( tx *Transaction, row R, ) error
func (*Table[K, V, R]) NewDiffIter ¶
func (*Table[K, V, R]) NewIndexIter ¶
func (t *Table[K, V, R]) NewIndexIter(tx *Transaction, min Tuple, max Tuple) *IndexIter[K, V]
func (*Table[K, V, R]) NewIter ¶
func (t *Table[K, V, R]) NewIter(tx *Transaction) *TableIter[K, V]
func (*Table[K, V, R]) Update ¶
func (t *Table[K, V, R]) Update( tx *Transaction, row R, ) error
func (*Table[K, V, R]) Upsert ¶
func (t *Table[K, V, R]) Upsert( tx *Transaction, row R, ) error
type TableIter ¶
type TableIter[ K memorytable.Ordered[K], V any, ] struct { // contains filtered or unexported fields }
func (*TableIter[K, V]) Item ¶
func (t *TableIter[K, V]) Item() (row *PhysicalRow[K, V])
type Text ¶
type Text = memorytable.Text
type Transaction ¶
type Transaction struct {
ID string
BeginTime Time
Time Time
CommitTime Time
State *memorytable.Atomic[TransactionState]
IsolationPolicy IsolationPolicy
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction( id string, t Time, isolationPolicy IsolationPolicy, ) *Transaction
func (*Transaction) Abort ¶
func (t *Transaction) Abort() error
func (*Transaction) Commit ¶
func (t *Transaction) Commit(commitTime Time) error
func (*Transaction) Copy ¶
func (t *Transaction) Copy() *Transaction
type TransactionState ¶
type TransactionState uint8
type Tuple ¶
type Tuple = memorytable.Tuple
type TxCommitter ¶
type TxCommitter interface {
CommitTx(*Transaction) error
AbortTx(*Transaction) error
}
type Uint ¶
type Uint = memorytable.Uint
type Version ¶
type Version[T any] struct { ID int64 BornTx *Transaction BornTime Time LockTx *Transaction LockTime Time Value T }
type WriteEntry ¶
type WriteEntry[ K memorytable.Ordered[K], V any, ] struct { Transaction *Transaction Key *K VersionID int64 }
Click to show internal directories.
Click to hide internal directories.