Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Offset
- type Reader
- type ReaderOption
- type SegID
- type WalIO
- func (w *WalIO) Append(data []byte) (*Offset, error)
- func (w *WalIO) Close() error
- func (w *WalIO) GetTransactionRecords(startOffset *Offset) ([]*logrecord.LogRecord, error)
- func (w *WalIO) NewReader(options ...ReaderOption) (*Reader, error)
- func (w *WalIO) NewReaderWithStart(offset *Offset, options ...ReaderOption) (*Reader, error)
- func (w *WalIO) Read(pos *Offset) ([]byte, error)
- func (w *WalIO) RunWalCleanup(ctx context.Context, interval time.Duration, predicate walfs.DeletionPredicate)
- func (w *WalIO) Sync() error
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var ( ErrWalNextOffset = errors.New("wal next offset out of range") ErrWalFSync = walfs.ErrFsync ErrNoNewData = walfs.ErrNoNewData )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BytesPerSync uint32 `toml:"bytes_per_sync"` SegmentSize int64 `toml:"segment_size"` // should fsync be done after every writes. // FSync are costly // writes are buffered to OS. // Logs will be only lost, if the machine itself crashes. // Not the process, data will be still safe as os buffer persists. FSync bool `toml:"fsync"` // call FSync with at this interval. SyncInterval time.Duration `toml:"sync_interval"` AutoCleanup bool `toml:"auto_cleanup"` MaxAge time.Duration `toml:"max_age"` MinSegment int `toml:"min_segment"` MaxSegment int `toml:"max_segment"` CleanupInterval time.Duration `toml:"cleanup_interval"` }
Config stores all tunable parameters for WAL.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Offset ¶
type Offset = walfs.RecordPosition
Offset is a type alias to underlying wal implementation.
func DecodeOffset ¶
type ReaderOption ¶
type ReaderOption func(*Reader)
func WithActiveTail ¶
func WithActiveTail(enabled bool) ReaderOption
type WalIO ¶
type WalIO struct {
// contains filtered or unexported fields
}
WalIO provides a write and read to underlying file based wal store.
func (*WalIO) GetTransactionRecords ¶
GetTransactionRecords returns all the WalRecord that is part of the particular Txn.
func (*WalIO) NewReader ¶
func (w *WalIO) NewReader(options ...ReaderOption) (*Reader, error)
NewReader returns a new instance of WIOReader, allowing the caller to access WAL logs for replication, recovery, or log processing.
func (*WalIO) NewReaderWithStart ¶
func (w *WalIO) NewReaderWithStart(offset *Offset, options ...ReaderOption) (*Reader, error)
NewReaderWithStart returns a new instance of WIOReader from the provided Offset.
func (*WalIO) RunWalCleanup ¶
Click to show internal directories.
Click to hide internal directories.