tuple

package
v0.0.0-...-116f2a3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tuple

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

@owned Write lock of this tuple. Acquired before committing.

@rcond Condition variable to wake up readers of this tuple.

@tslast Timestamp of the last reader or last writer + 1.

@vers Versions.

func MkTuple

func MkTuple() *Tuple

func (*Tuple) AppendVersion

func (tuple *Tuple) AppendVersion(tid uint64, val string)

Append a new version (@tid, @val) to this tuple.

func (*Tuple) Free

func (tuple *Tuple) Free()

Release the write lock without modifying the tuple.

func (*Tuple) KillVersion

func (tuple *Tuple) KillVersion(tid uint64) uint64

Append a tombstone version of timestamp @tid to this tuple.

func (*Tuple) Own

func (tuple *Tuple) Own(tid uint64) uint64

func (*Tuple) ReadVersion

func (tuple *Tuple) ReadVersion(tid uint64) (string, bool)

func (*Tuple) ReadWait

func (tuple *Tuple) ReadWait(tid uint64)

Call @ReadWait before @ReadVersion. This design allows us to resolve the prophecy at the txn level.

func (*Tuple) RemoveVersions

func (tuple *Tuple) RemoveVersions(tid uint64)

Remove all versions whose lifetime ends before @tid.

func (*Tuple) WriteOpen

func (tuple *Tuple) WriteOpen()

Call @WriteOpen before @AppendVersion and @KillVersion.

type Version

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

@ts Starting timestamp of this version, and also ending timestamp of the next version. Lifetime is a half-open interval: (ts of this, ts of next].

@del Tombstone of this version.

@val Value of this version.

Jump to

Keyboard shortcuts

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