awol

package
v0.0.0-...-cd2353e Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTxnWrites uint64 = 10 // 10 is completely arbitrary

MaxTxnWrites is a guaranteed reservation for each transaction.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

func New

func New() Log

New initializes a fresh log

func Open

func Open() Log

Open recovers the log following a crash or shutdown

func (Log) Apply

func (l Log) Apply()

Apply all the committed transactions.

Frees all the space in the log.

func (Log) BeginTxn

func (l Log) BeginTxn() bool

BeginTxn allocates space for a new transaction in the log.

Returns true if the allocation succeeded.

func (Log) Commit

func (l Log) Commit()

Commit the current transaction.

func (Log) Read

func (l Log) Read(a uint64) disk.Block

Read from the logical disk.

Reads must go through the log to return committed but un-applied writes.

func (Log) Size

func (l Log) Size() uint64

func (Log) Write

func (l Log) Write(a uint64, v disk.Block)

Write to the disk through the log.

Jump to

Keyboard shortcuts

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