Documentation ¶
Overview ¶
Package wal provides a simple write-ahead log implementation inspired by Indeed's BasicRecordFile implementation. Each record in the file is stored using the following format:
[length - varint][record content][checksum]
Unlike the reference implementation, the record length is written as a varint to help conserve space. The checksum is a simple CRC32 checksum. Reference: https://github.com/indeedeng/lsmtree/blob/master/recordlog/src/main/java/com/indeed/lsmtree/recordlog/BasicRecordFile.java
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements the logic for reading information from the write-ahead log. The underlying file is wrapped with a buffered reader to help improve performance.
func OpenReader ¶
OpenReader opens a new read-only handle to the target file.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements the logic for writing information to the write-ahead log. The underlying file is wrapped with a buffered writer to help improve durability of writes.
func OpenWriter ¶
OpenWriter opens a new append-only handle that writes data to the target file.