Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SerializeRecord ¶
SerializeRecord encodes a LogRecord into a binary byte slice.
Types ¶
type LogRecord ¶
type LogRecord struct {
LSN uint64
TxID uint64
Type RecordType
PageID page.PageID
Data []byte // Page content (after-image)
}
LogRecord represents a single entry in the Write-Ahead Log.
type RecordType ¶
type RecordType byte
RecordType represents the action logged in the WAL.
const ( Begin RecordType = iota Update Commit Abort )
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
WAL manages appending and reading log records from the log file.
func (*WAL) Append ¶
func (w *WAL) Append(txID uint64, recType RecordType, pageID page.PageID, data []byte) (uint64, error)
Append logs a new record to the WAL and returns its Log Sequence Number (LSN).
func (*WAL) ReadAllRecords ¶
ReadAllRecords reads all records from the beginning of the WAL.
Click to show internal directories.
Click to hide internal directories.