Documentation ¶
Index ¶
- Constants
- type Reader
- type Wal
- func (w *Wal) Backup() (string, error)
- func (w *Wal) Close() error
- func (w *Wal) NewReader(pos int64) (*Reader, error)
- func (w *Wal) RecoverFromBackup(name string) error
- func (w *Wal) TruncateAfter(pos int64) error
- func (w *Wal) TruncateBefore(pos int64) error
- func (w *Wal) Write(p []byte) (int64, error)
Constants ¶
const ( // MaxRecordSize is the maximum size of a record MaxRecordSize = 1<<32 - 1 // SyncConcurrency is the number of concurrent syncs SyncConcurrency = 1 << 10 // RecordHeaderSize is the size of the record header RecordHeaderSize = 8 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents a reader for the write ahead log, Reader is thread-unsafe
type Wal ¶
WAL represents a write ahead log that provides durability and fault-tolerance for incoming writes
func (*Wal) Backup ¶
Backup backup the write ahead log, return the backup file name this operation is mutually exclusive with all read and write operations
func (*Wal) NewReader ¶
NewReader returns a new reader for the write ahead log, the created reader traverses the current point snapshot to read all the records in the current write ahead log
func (*Wal) RecoverFromBackup ¶
RecoverFromBackup recover the write ahead log from the backup this operation is mutually exclusive with all read and write operations
func (*Wal) TruncateAfter ¶
TruncateAfter truncates the back of the write ahead log by removing all records after the provided pos this operation is mutually exclusive with all read and write operations
func (*Wal) TruncateBefore ¶
TruncateBefore truncates the front of the write ahead log by removing all records that are before the provided pos this operation is mutually exclusive with all read and write operations