Documentation
¶
Overview ¶
Package wal (Write-ahead logging) is an independent component to ensure data reliability.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Segment ¶
type Segment interface {
GetSegmentID() SegmentID
}
Segment allows reading underlying segments that hold WAl entities.
type WAL ¶
type WAL interface {
// Write a logging entity.
// It will return immediately when the data is written in the buffer,
// The returned function will be called when the entity is flushed on the persistent storage.
Write(seriesID common.SeriesID, timestamp time.Time, data []byte) (func(), error)
// Read specified segment by SegmentID.
Read(segmentID SegmentID) (*Segment, error)
// ReadAllSegments reads all segments sorted by their creation time in ascending order.
ReadAllSegments() ([]*Segment, error)
// Rotate closes the open segment and opens a new one, returning the closed segment details.
Rotate() (*Segment, error)
// Delete the specified segment.
Delete(segmentID SegmentID) error
}
WAL denotes a Write-ahead logging. Modules who want their data reliable could write data to an instance of WAL. A WAL combines several segments, ingesting data on a single opened one. Rotating the WAL will create a new segment, marking it as opened and persisting previous segments on the disk.
Click to show internal directories.
Click to hide internal directories.