txn

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package txn implements a full transaction interface on top of GoJournal.

Transactions in this package do not have to implement concurrency control, since the package uses two-phase locking to automatically synchronize transactions. Lock ordering is still up to the caller to avoid deadlocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log added in v0.3.0

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

func Init added in v0.3.0

func Init(d disk.Disk) *Log

func (*Log) Flush added in v0.5.2

func (tsys *Log) Flush()

type Txn

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

func Begin added in v0.3.0

func Begin(tsys *Log) *Txn

Start a local transaction with no writes from a global Log.

func (*Txn) Acquire added in v0.3.0

func (txn *Txn) Acquire(addr addr.Addr)

func (*Txn) Commit added in v0.3.0

func (txn *Txn) Commit(wait bool) bool

func (*Txn) NDirty added in v0.3.0

func (txn *Txn) NDirty() uint64

NDirty reports an upper bound on the size of this transaction when committed.

TODO: number of locks acquired also bounds size of transaction

The caller cannot rely on any particular properties of this function for safety.

func (*Txn) OverWrite added in v0.3.0

func (txn *Txn) OverWrite(addr addr.Addr, sz uint64, data []byte)

OverWrite writes an object to addr

func (*Txn) OverWriteBit added in v0.3.0

func (txn *Txn) OverWriteBit(addr addr.Addr, data bool)

func (*Txn) ReadBuf added in v0.3.0

func (txn *Txn) ReadBuf(addr addr.Addr, sz uint64) []byte

func (*Txn) ReadBufBit added in v0.3.0

func (txn *Txn) ReadBufBit(addr addr.Addr) bool

func (*Txn) ReleaseAll added in v0.3.0

func (txn *Txn) ReleaseAll()

Jump to

Keyboard shortcuts

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